From d8325c0223e35baca10c60ce1642678f1bfd41d4 Mon Sep 17 00:00:00 2001 From: uncor3 Date: Tue, 20 Jan 2026 00:11:59 +0000 Subject: [PATCH] update linux deploy script & fix warnings --- scripts/deploy-appimage.sh | 18 ++++++++++++++++++ src/afcexplorerwidget.cpp | 4 ++-- src/afcexplorerwidget.h | 9 +++++++++ src/airplaywindow.cpp | 2 ++ src/appswidget.cpp | 10 ++-------- src/appswidget.h | 14 ++++++++++++++ src/batterywidget.cpp | 8 +++++++- src/batterywidget.h | 3 +++ src/exportprogressdialog.cpp | 6 +++--- src/iDescriptor-ui.h | 29 ++++++++++++++++++++--------- src/installedappswidget.cpp | 6 ------ src/installedappswidget.h | 7 +++++++ src/networkdeviceswidget.cpp | 5 ----- src/networkdeviceswidget.h | 12 ++++++++++++ src/qprocessindicator.cpp | 2 -- src/qprocessindicator.h | 9 +++++++++ src/zlineedit.cpp | 9 +-------- src/zlineedit.h | 9 +++++++++ 18 files changed, 118 insertions(+), 44 deletions(-) diff --git a/scripts/deploy-appimage.sh b/scripts/deploy-appimage.sh index a8d511d..8c44421 100755 --- a/scripts/deploy-appimage.sh +++ b/scripts/deploy-appimage.sh @@ -90,6 +90,24 @@ plugins=( "libgstapp.so" "libgstautodetect.so" "libgstaudioresample.so" + "libgstvideoparsersbad.so" + "libgstvaapi.so" + "libgstva.so" + "libgstvideo4linux2.so" + "libgstvideoconvertscale.so" + "libgstvideoconvert.so" + "libgstvideoscale.so" + "libgstvideofilter.so" + "libgstjpeg.so" + "libgstimagefreeze.so" + "libgstximagesink.so" + "libgstxvimagesink.so" + "libgstgtk.so" + "libgstgl.so" + "libgstrtp.so" + "libgstrtpmanager.so" + "libgsttypefindfunctions.so" + "libgstisomp4.so" ) for i in "${plugins[@]}"; do diff --git a/src/afcexplorerwidget.cpp b/src/afcexplorerwidget.cpp index df98b72..ef1b5a7 100644 --- a/src/afcexplorerwidget.cpp +++ b/src/afcexplorerwidget.cpp @@ -525,8 +525,6 @@ void AfcExplorerWidget::setupFileExplorer() m_navWidget = new QWidget(); m_navWidget->setObjectName("navWidget"); m_navWidget->setFocusPolicy(Qt::StrongFocus); // Make it focusable - connect(qApp, &QApplication::paletteChanged, this, - &AfcExplorerWidget::updateNavStyles); m_navWidget->setMaximumWidth(500); m_navWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -693,6 +691,8 @@ void AfcExplorerWidget::onAddToFavoritesClicked() void AfcExplorerWidget::updateNavStyles() { + if (!m_navWidget || !m_addressBar) + return; bool isDark = isDarkMode(); QColor lightColor = qApp->palette().color(QPalette::Light); QColor darkColor = qApp->palette().color(QPalette::Dark); diff --git a/src/afcexplorerwidget.h b/src/afcexplorerwidget.h index 7c0e8e9..22a32ba 100644 --- a/src/afcexplorerwidget.h +++ b/src/afcexplorerwidget.h @@ -117,6 +117,15 @@ private: void updateNavStyles(); void updateButtonStates(); void goUp(); + +protected: + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::PaletteChange) { + updateNavStyles(); + } + QWidget::changeEvent(event); + } }; #endif // AFCEXPLORER_H diff --git a/src/airplaywindow.cpp b/src/airplaywindow.cpp index 01a0670..c885c27 100644 --- a/src/airplaywindow.cpp +++ b/src/airplaywindow.cpp @@ -248,6 +248,7 @@ void AirPlayWindow::showTutorialView() m_stackedWidget->setCurrentWidget(m_tutorialWidget); if (m_tutorialPlayer) { m_tutorialPlayer->play(); + m_loadingIndicator->start(); } } @@ -387,6 +388,7 @@ void AirPlayWindow::onClientConnectionChanged(bool connected) showStreamingView(); } else { m_loadingLabel->setText("Waiting for device connection..."); + m_videoLabel->clear(); showTutorialView(); } } diff --git a/src/appswidget.cpp b/src/appswidget.cpp index 28bfac8..b8664db 100644 --- a/src/appswidget.cpp +++ b/src/appswidget.cpp @@ -107,20 +107,14 @@ void AppsWidget::setupUI() mainLayout->addWidget(headerWidget); - static ZIcon searchIcon(":/resources/icons/MdiLightMagnify.png"); + m_searchIcon = ZIcon(":/resources/icons/MdiLightMagnify.png"); m_searchAction = m_searchEdit->addAction( - searchIcon.getThemedPixmap(QSize(16, 16), palette()), + m_searchIcon.getThemedPixmap(QSize(16, 16), palette()), QLineEdit::TrailingPosition); m_searchAction->setToolTip("Search"); connect(m_searchAction, &QAction::triggered, this, &AppsWidget::performSearch); - // Update search icon when theme changes - connect(qApp, &QApplication::paletteChanged, this, [this]() { - m_searchAction->setIcon( - searchIcon.getThemedPixmap(QSize(16, 16), palette())); - }); - headerLayout->addWidget(m_searchEdit); headerLayout->addStretch(); headerLayout->addWidget(m_statusLabel); diff --git a/src/appswidget.h b/src/appswidget.h index a16cbd0..5fc71a9 100644 --- a/src/appswidget.h +++ b/src/appswidget.h @@ -21,6 +21,7 @@ #define APPSWIDGET_H #include "appstoremanager.h" +#include "iDescriptor-ui.h" #include "qprocessindicator.h" #include #include @@ -136,6 +137,19 @@ private: QJsonArray m_goldSponsors; QJsonArray m_silverSponsors; QJsonArray m_bronzeSponsors; + ZIcon m_searchIcon; + +protected: + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::PaletteChange) { + if (m_searchAction && !m_searchIcon.isNull()) { + m_searchAction->setIcon( + m_searchIcon.getThemedPixmap(QSize(16, 16), palette())); + } + } + QWidget::changeEvent(event); + } }; #endif // APPSWIDGET_H diff --git a/src/batterywidget.cpp b/src/batterywidget.cpp index aae1e1e..15b2404 100644 --- a/src/batterywidget.cpp +++ b/src/batterywidget.cpp @@ -32,8 +32,14 @@ BatteryWidget::BatteryWidget(float value, bool isCharging, QWidget *parent) { setMinimumSize(30, 30); setMaximumSize(40, 40); +} - connect(qApp, &QApplication::paletteChanged, this, [this]() { update(); }); +void BatteryWidget::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::PaletteChange) { + update(); + } + QWidget::changeEvent(event); } void BatteryWidget::resizeEvent(QResizeEvent *) diff --git a/src/batterywidget.h b/src/batterywidget.h index 3f2cb22..03b24e4 100644 --- a/src/batterywidget.h +++ b/src/batterywidget.h @@ -35,6 +35,9 @@ public: void setValue(float newValue); float getValue() const; +protected: + void changeEvent(QEvent *event) override; + private: QRectF widgetFrame; QRectF mainBatteryFrame; diff --git a/src/exportprogressdialog.cpp b/src/exportprogressdialog.cpp index b740223..9c3903b 100644 --- a/src/exportprogressdialog.cpp +++ b/src/exportprogressdialog.cpp @@ -60,9 +60,9 @@ ExportProgressDialog::ExportProgressDialog(ExportManager *exportManager, connect(m_transferRateTimer, &QTimer::timeout, this, &ExportProgressDialog::updateTransferRate); - // Listen for palette changes - connect(qApp, &QApplication::paletteChanged, this, - &ExportProgressDialog::updateColors); + // FIXME:Listen for palette changes + // connect(qApp, &QApplication::paletteChanged, this, + // &ExportProgressDialog::updateColors); updateColors(); } diff --git a/src/iDescriptor-ui.h b/src/iDescriptor-ui.h index 7140264..7abef99 100644 --- a/src/iDescriptor-ui.h +++ b/src/iDescriptor-ui.h @@ -152,11 +152,6 @@ public: updateIconSize(); setCursor(Qt::PointingHandCursor); - - connect(qApp, &QApplication::paletteChanged, this, - [this] { update(); }); - connect(qApp, &QApplication::fontChanged, this, - [this] { updateIconSize(); }); } void setIcon(const ZIcon &icon) @@ -193,6 +188,16 @@ protected: m_icon.paint(&painter, iconRect, palette(), devicePixelRatioF()); } + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::ApplicationFontChange) { + updateIconSize(); + } else if (event->type() == QEvent::ApplicationPaletteChange) { + update(); + } + QAbstractButton::changeEvent(event); + } + private: void updateIconSize() { @@ -224,10 +229,6 @@ public: { setToolTip(tooltip); updateIconSize(); - connect(qApp, &QApplication::paletteChanged, this, - [this]() { update(); }); - connect(qApp, &QApplication::fontChanged, this, - [this]() { updateIconSize(); }); } void setIcon(const QIcon &icon) { @@ -261,6 +262,16 @@ protected: m_icon.paint(&painter, iconRect, palette(), devicePixelRatioF()); } + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::ApplicationFontChange) { + updateIconSize(); + } else if (event->type() == QEvent::ApplicationPaletteChange) { + update(); + } + QLabel::changeEvent(event); + } + private: void updateIconSize() { diff --git a/src/installedappswidget.cpp b/src/installedappswidget.cpp index 3786b4e..c4e1862 100644 --- a/src/installedappswidget.cpp +++ b/src/installedappswidget.cpp @@ -196,12 +196,6 @@ void InstalledAppsWidget::setupUI() // Start in loading state showLoadingState(); - - connect(qApp, &QApplication::paletteChanged, this, [this]() { - for (AppTabWidget *tab : m_appTabs) { - tab->updateStyles(); - } - }); } void InstalledAppsWidget::showLoadingState() diff --git a/src/installedappswidget.h b/src/installedappswidget.h index 1f41a83..8ad1afc 100644 --- a/src/installedappswidget.h +++ b/src/installedappswidget.h @@ -66,6 +66,13 @@ signals: protected: void mousePressEvent(QMouseEvent *event) override; + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::PaletteChange) { + updateStyles(); + } + QGroupBox::changeEvent(event); + }; private: void fetchAppIcon(); diff --git a/src/networkdeviceswidget.cpp b/src/networkdeviceswidget.cpp index 151c30b..5799dea 100644 --- a/src/networkdeviceswidget.cpp +++ b/src/networkdeviceswidget.cpp @@ -99,11 +99,6 @@ void NetworkDevicesWidget::setupUI() m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_scrollArea->setStyleSheet( "QScrollArea { background: transparent; border: none; }"); - /* FIXME: We need a better approach to theme awareness */ - connect(qApp, &QApplication::paletteChanged, this, [this]() { - m_scrollArea->setStyleSheet( - "QScrollArea { background: transparent; border: none; }"); - }); // Scroll content m_scrollContent = new QWidget(); diff --git a/src/networkdeviceswidget.h b/src/networkdeviceswidget.h index 62a70aa..5ff8628 100644 --- a/src/networkdeviceswidget.h +++ b/src/networkdeviceswidget.h @@ -63,6 +63,18 @@ private: #endif QList m_deviceCards; + +protected: + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::PaletteChange) { + if (m_scrollArea) { + m_scrollArea->setStyleSheet( + "QScrollArea { background: transparent; border: none; }"); + } + } + QWidget::changeEvent(event); + }; }; #endif // NETWORKDEVICESWIDGET_H \ No newline at end of file diff --git a/src/qprocessindicator.cpp b/src/qprocessindicator.cpp index 8eb8479..78ccdff 100644 --- a/src/qprocessindicator.cpp +++ b/src/qprocessindicator.cpp @@ -35,8 +35,6 @@ QProcessIndicator::QProcessIndicator(QWidget *parent) m_timer = new QTimer(); connect(m_timer, SIGNAL(timeout()), this, SLOT(onTimeout())); - connect(qApp, &QApplication::paletteChanged, this, - &QProcessIndicator::updateStyle); } void QProcessIndicator::updateStyle() { diff --git a/src/qprocessindicator.h b/src/qprocessindicator.h index cf8b2d6..49b20cb 100644 --- a/src/qprocessindicator.h +++ b/src/qprocessindicator.h @@ -77,6 +77,15 @@ private: qreal m_scale; QTimer *m_timer; + +protected: + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::PaletteChange) { + updateStyle(); + } + QWidget::changeEvent(event); + }; }; #endif // QPROCESSINDICATOR_H \ No newline at end of file diff --git a/src/zlineedit.cpp b/src/zlineedit.cpp index c311253..d90a47a 100644 --- a/src/zlineedit.cpp +++ b/src/zlineedit.cpp @@ -28,14 +28,7 @@ ZLineEdit::ZLineEdit(const QString &text, QWidget *parent) setupStyles(); } -void ZLineEdit::setupStyles() -{ - updateStyles(); - - // Connect to palette changes for dynamic theme updates - connect(qApp, &QApplication::paletteChanged, this, - &ZLineEdit::updateStyles); -} +void ZLineEdit::setupStyles() { updateStyles(); } void ZLineEdit::updateStyles() { diff --git a/src/zlineedit.h b/src/zlineedit.h index 026ba8f..41c9dea 100644 --- a/src/zlineedit.h +++ b/src/zlineedit.h @@ -35,4 +35,13 @@ private slots: private: void setupStyles(); + +protected: + void changeEvent(QEvent *event) override + { + if (event->type() == QEvent::PaletteChange) { + updateStyles(); + } + QLineEdit::changeEvent(event); + } }; \ No newline at end of file