diff -Nru lxqt-qtplugin-0.14.0/CHANGELOG lxqt-qtplugin-0.16.0/CHANGELOG --- lxqt-qtplugin-0.14.0/CHANGELOG 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/CHANGELOG 2020-10-30 13:42:33.000000000 +0000 @@ -1,16 +1,38 @@ +lxqt-qtplugin-0.16.0 / 2020-11-01 +================================= + * Do not reset widget palettes on changing style. + * Support more palette colors for better customization. + +lxqt-qtplugin-0.15.1 / 2020-05-31 +================================= + * Fixed Fusion's window color with Qt 5.15. + * Made the window color configurable. + +lxqt-qtplugin-0.15.0 / 2020-04-22 +================================= + * Bumped version to 0.15.0. + * Made libfm-qt a dependency and loaded versioned libfm-qt (for versioned ".so" handling). + * C++11 code updates. + * Use return braced init list. + * Removed (duplicated) string casts definitions. + * Removed deprecated QImage method "byteCount()" and used "sizeInBytes()" instead. + * Fixed "#include" for libdbusmenu-qt. + * Added support for flatpak to StatusNotifierItem. + * Added Category property to StatusNotifierItem to fix working on some DEs. + * Added support for working without context menu to StatusNotifierItem. lxqt-qtplugin-0.14.0 / 2019-01-25 ================================= * Bumped version to 0.14.0 - * Dynamically load libfm-qt on demand to create + * Dynamically load libfm-qt on demand to create the file dialog helper. - * Don't use automatic string conversions + * Don't use automatic string conversions * Improved cmake scripting - Set cmake_minimum_required to 3.1.0 - Removed locale compile definitons - - Removed the superfluous libfm-qt dependency - + - Removed the superfluous libfm-qt dependency + lxqt-qtplugin-0.13.0 / 2018-05-21 ================================= diff -Nru lxqt-qtplugin-0.14.0/CMakeLists.txt lxqt-qtplugin-0.16.0/CMakeLists.txt --- lxqt-qtplugin-0.14.0/CMakeLists.txt 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/CMakeLists.txt 2020-10-30 13:42:33.000000000 +0000 @@ -13,9 +13,10 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Minimum Versions -set(LXQTBT_MINIMUM_VERSION "0.6.0") -set(QT_MINIMUM_VERSION "5.7.1") -set(QTXDG_MINIMUM_VERSION "3.3.0") +set(LXQTBT_MINIMUM_VERSION "0.8.0") +set(QT_MINIMUM_VERSION "5.12.0") +set(QTXDG_MINIMUM_VERSION "3.6.0") +set(FMQT_MINIMUM_VERSION "0.16.0") find_package(Qt5DBus ${QT_MINIMUM_VERSION} REQUIRED) find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED) @@ -23,6 +24,18 @@ find_package(Qt5XdgIconLoader ${QTXDG_MINIMUM_VERSION} REQUIRED) find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) find_package(dbusmenu-qt5 REQUIRED) +find_package(fm-qt ${FMQT_MINIMUM_VERSION} REQUIRED) + +get_target_property(LIB_FM_QT_CONFIGURATIONS fm-qt IMPORTED_CONFIGURATIONS) +if (LIB_FM_QT_CONFIGURATIONS) + # Extract the .soname from the first configuration found. + # We don't use configuration mapping. Any config serves the purpose + list(GET LIB_FM_QT_CONFIGURATIONS 0 LIB_FM_QT_FIRST_CONFIGURATION) + get_target_property(LIB_FM_QT_SONAME fm-qt IMPORTED_SONAME_${LIB_FM_QT_FIRST_CONFIGURATION}) +else() + message(ERROR "libfm-qt, but no configuration found. Check your libfm-qt installation.") +endif() +mark_as_advanced(LIB_FM_QT_SONAME) # Patch Version 0 diff -Nru lxqt-qtplugin-0.14.0/debian/changelog lxqt-qtplugin-0.16.0/debian/changelog --- lxqt-qtplugin-0.14.0/debian/changelog 2020-04-10 19:03:32.000000000 +0000 +++ lxqt-qtplugin-0.16.0/debian/changelog 2021-01-10 23:03:45.000000000 +0000 @@ -1,44 +1,28 @@ -lxqt-qtplugin (0.14.0-3ubuntu4) focal; urgency=medium +lxqt-qtplugin (0.16.0-0~ppa1) focal; urgency=medium - * No-change rebuild against qtbase-abi-5-12-8. + * Sync with Debian. - -- Rik Mills Fri, 10 Apr 2020 20:03:32 +0100 + -- Julien Lavergne Mon, 11 Jan 2021 00:03:45 +0100 -lxqt-qtplugin (0.14.0-3ubuntu3) focal; urgency=medium +lxqt-qtplugin (0.16.0-1) unstable; urgency=medium - * No-change rebuild against qtbase-abi-5-12-5. + [ Alf Gaida ] + * Switched to gbp + * Bumped Standards-Version to 4.4.0, no changes needed + * Removed no longer needed patches, applied upstream - -- Rik Mills Sun, 27 Oct 2019 06:30:03 +0000 + [ Andrew Lee (李健秋) ] + * New upstream release. (Closes: #977329) -lxqt-qtplugin (0.14.0-3ubuntu2) eoan; urgency=medium - - * No-change rebuild against qtbase-abi-5-12-4. - - -- Dmitry Shachnev Sat, 13 Jul 2019 17:11:05 +0300 - -lxqt-qtplugin (0.14.0-3ubuntu1) eoan; urgency=medium - - * Merge from Debian Sid. Remaining changes: - - Explicitly depend on libqt5xdg-dev. - - Bump the ABI package to libfm-qt6. - - Remove unneeded ~s from versions. - - -- Simon Quigley Fri, 03 May 2019 08:45:05 -0500 + -- Andrew Lee (李健秋) Thu, 07 Jan 2021 17:53:47 +0800 lxqt-qtplugin (0.14.0-3) unstable; urgency=medium * Try to load the versioned libfm-qt.so.6 instead of libfm-qt.so - (Closes: #927905) + (Closes: #927905) -- Alf Gaida Wed, 24 Apr 2019 23:05:04 +0200 -lxqt-qtplugin (0.14.0-0ubuntu3) disco; urgency=medium - - * Rebuild against qtbase-abi-5-12-2. - * Explicity build depend on libqt5xdg-dev. - - -- Rik Mills Sun, 31 Mar 2019 10:34:46 +0100 - lxqt-qtplugin (0.14.0-2) unstable; urgency=medium * Added missed direct dependency libqt5xdgiconloader-dev, the new @@ -47,12 +31,6 @@ -- Alf Gaida Wed, 13 Mar 2019 17:59:00 +0100 -lxqt-qtplugin (0.14.0-0ubuntu2) disco; urgency=medium - - * Recommend libfm-qt6 instead. - - -- Simon Quigley Sun, 27 Jan 2019 21:01:22 -0600 - lxqt-qtplugin (0.14.0-1) unstable; urgency=medium * Cherry-picking upstream release 0.14.0. @@ -66,36 +44,6 @@ -- Alf Gaida Sun, 27 Jan 2019 18:08:59 +0100 -lxqt-qtplugin (0.14.0-0ubuntu1) disco; urgency=medium - - * New upstream release. - - Bump build dependencies. - - Remove reverse-applicable patches. - * Bump Standards-version to 4.3.0, no changes needed. - * Bump debhelper compat to 12, no changes needed. - - -- Simon Quigley Sat, 26 Jan 2019 00:44:38 -0600 - -lxqt-qtplugin (0.13.0-0ubuntu4) cosmic; urgency=medium - - * Bump Standards-version to 4.1.5, no changes needed. - * Lubuntuify the package. - * Dynamically load libfm-qt on runtime instead of on build time. - - -- Simon Quigley Mon, 30 Jul 2018 19:34:33 -0500 - -lxqt-qtplugin (0.13.0-0ubuntu3) cosmic; urgency=medium - - * No-change rebuild against qtbase-abi-5-11-0. - - -- Simon Quigley Wed, 18 Jul 2018 03:18:15 -0500 - -lxqt-qtplugin (0.13.0-0ubuntu2) cosmic; urgency=medium - - * No-change rebuild against libfm-qt. - - -- Simon Quigley Sat, 14 Jul 2018 01:34:06 -0500 - lxqt-qtplugin (0.13.0-2) unstable; urgency=medium * Switched to unstable @@ -114,15 +62,6 @@ -- Alf Gaida Sat, 26 May 2018 01:13:13 +0200 -lxqt-qtplugin (0.13.0-0ubuntu1) cosmic; urgency=medium - - * New upstream release. - * Update build dependencies. - * Bump Standards-version to 4.1.4, no changes needed. - * Remove patches applied upstream. - - -- Simon Quigley Wed, 23 May 2018 22:40:20 -0500 - lxqt-qtplugin (0.12.0-7) unstable; urgency=medium * Relax debhelper minimum version to >= 11~ @@ -132,17 +71,6 @@ -- Alf Gaida Sat, 28 Apr 2018 16:10:41 +0200 -lxqt-qtplugin (0.12.0-6ubuntu1) bionic; urgency=medium - - * Merge from Debian Sid. Remaining changes: - - Cherry-pick an upstream commit because the upstream release cycle is too - slow: - + Remember the view mode. - * remember-view-mode.patch - * Upstream commit dfa18ac. - - -- Simon Quigley Sun, 18 Feb 2018 22:48:24 -0600 - lxqt-qtplugin (0.12.0-6) unstable; urgency=medium * Backported lxqtplatformtheme-follow-color-scheme.patch @@ -162,16 +90,6 @@ -- Alf Gaida Mon, 12 Feb 2018 19:52:16 +0100 -lxqt-qtplugin (0.12.0-4ubuntu1) bionic; urgency=medium - - * Cherry-pick an upstream commit because the upstream release cycle is too - slow: - - Remember the view mode. - + remember-view-mode.patch - + Upstream commit dfa18ac. - - -- Simon Quigley Mon, 05 Feb 2018 21:33:02 -0600 - lxqt-qtplugin (0.12.0-4) unstable; urgency=medium * Bumped Standards to 4.1.2, no changes needed diff -Nru lxqt-qtplugin-0.14.0/debian/control lxqt-qtplugin-0.16.0/debian/control --- lxqt-qtplugin-0.14.0/debian/control 2019-05-03 13:44:28.000000000 +0000 +++ lxqt-qtplugin-0.16.0/debian/control 2021-01-10 23:01:11.000000000 +0000 @@ -1,33 +1,33 @@ Source: lxqt-qtplugin -Maintainer: Lubuntu Developers -XSBC-Original-Maintainer: LXQt Packaging Team -Uploaders: Simon Quigley +Maintainer: LXQt Packaging Team +Uploaders: Alf Gaida , + Andrew Lee (李健秋) , + ChangZhuo Chen (陳昌倬) , + Yukiharu YABUKI Section: x11 Priority: optional Build-Depends: debhelper-compat (= 12), libdbusmenu-qt5-dev, + libfm-qt-dev (>= 0.16.0~), libkf5windowsystem-dev, libqt5svg5-dev, - libqt5xdg-dev, libqt5x11extras5-dev, - libqt5xdgiconloader-dev (>= 3.3.1), + libqt5xdgiconloader-dev (>= 3.3.1~), libx11-dev, - lxqt-build-tools (>= 0.6.0), + lxqt-build-tools (>= 0.8.0~), qtbase5-private-dev -Standards-Version: 4.3.0 -Vcs-Browser: https://phab.lubuntu.me/source/lxqt-qtplugin/ -Vcs-Git: https://phab.lubuntu.me/source/lxqt-qtplugin.git -XS-Debian-Vcs-Browser: https://salsa.debian.org/lxqt-team/lxqt-qtplugin -XS-Debian-Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-qtplugin -Homepage: https://github.com/lxde/lxqt-qtplugin +Standards-Version: 4.4.0 +Vcs-Browser: https://salsa.debian.org/lxqt-team/lxqt-qtplugin +Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-qtplugin.git +Homepage: https://github.com/lxqt/lxqt-qtplugin Package: lxqt-qtplugin Architecture: any Multi-Arch: same Depends: ${misc:Depends}, - ${shlibs:Depends} -Recommends: libfm-qt6 (>= 0.14.0), - lxqt-session, + ${shlibs:Depends}, + libfm-qt8 +Recommends: lxqt-session, lxqt-config Suggests: lxqt | lxqt-core Description: LXQt system integration plugin for Qt diff -Nru lxqt-qtplugin-0.14.0/debian/gbp.conf lxqt-qtplugin-0.16.0/debian/gbp.conf --- lxqt-qtplugin-0.14.0/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ lxqt-qtplugin-0.16.0/debian/gbp.conf 2021-01-10 23:01:11.000000000 +0000 @@ -0,0 +1,6 @@ +[DEFAULT] +debian-branch = debian/sid +upstream-branch = upstream/latest +pristine-tar = True +compression = xz + diff -Nru lxqt-qtplugin-0.14.0/debian/patches/load-versioned-libfm-qt.patch lxqt-qtplugin-0.16.0/debian/patches/load-versioned-libfm-qt.patch --- lxqt-qtplugin-0.14.0/debian/patches/load-versioned-libfm-qt.patch 2019-05-03 13:44:28.000000000 +0000 +++ lxqt-qtplugin-0.16.0/debian/patches/load-versioned-libfm-qt.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Description: Load the versioned library - Loading libfm-qt.so would not be wise, it would introduce a dependency - to libfm-qt-dev. So hard patching to libfm-qt.so.6 will be fine for - Buster - we will find a better solution upstream for the next release. -Author: Alf Gaida - ---- -Bug-Debian: https://bugs.debian.org/927905 - ---- lxqt-qtplugin-0.14.0.orig/src/lxqtplatformtheme.cpp -+++ lxqt-qtplugin-0.14.0/src/lxqtplatformtheme.cpp -@@ -239,7 +239,7 @@ QPlatformDialogHelper *LXQtPlatformTheme - // The createFileDialogHelper() method is dynamically loaded from libfm-qt on demand - if(createFileDialogHelper == nullptr) { - // try to dynamically load libfm-qt.so -- QLibrary libfmQtLibrary{QLatin1String("libfm-qt")}; -+ QLibrary libfmQtLibrary{QLatin1String("libfm-qt.so.6")}; - libfmQtLibrary.load(); - if(!libfmQtLibrary.isLoaded()) { - return nullptr; diff -Nru lxqt-qtplugin-0.14.0/debian/patches/series lxqt-qtplugin-0.16.0/debian/patches/series --- lxqt-qtplugin-0.14.0/debian/patches/series 2019-05-03 13:44:28.000000000 +0000 +++ lxqt-qtplugin-0.16.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -load-versioned-libfm-qt.patch diff -Nru lxqt-qtplugin-0.14.0/debian/upstream/metadata lxqt-qtplugin-0.16.0/debian/upstream/metadata --- lxqt-qtplugin-0.14.0/debian/upstream/metadata 2019-05-03 13:44:28.000000000 +0000 +++ lxqt-qtplugin-0.16.0/debian/upstream/metadata 2021-01-10 23:01:11.000000000 +0000 @@ -4,3 +4,4 @@ Changelog: https://github.com/lxqt/lxqt-qtplugin/blob/master/CHANGELOG Repository: https://github.com/lxqt/lxqt-qtplugin Repository-Browser: https://github.com/lxqt/lxqt-qtplugin + diff -Nru lxqt-qtplugin-0.14.0/src/CMakeLists.txt lxqt-qtplugin-0.16.0/src/CMakeLists.txt --- lxqt-qtplugin-0.14.0/src/CMakeLists.txt 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/src/CMakeLists.txt 2020-10-30 13:42:33.000000000 +0000 @@ -29,11 +29,7 @@ target_compile_definitions(qtlxqt PRIVATE "QT_NO_FOREACH" - "QT_USE_QSTRINGBUILDER" - "QT_NO_CAST_FROM_ASCII" - "QT_NO_CAST_TO_ASCII" - "QT_NO_URL_CAST_FROM_STRING" - "QT_NO_CAST_FROM_BYTEARRAY" + "LIB_FM_QT_SONAME=\"${LIB_FM_QT_SONAME}\"" ) target_link_libraries(qtlxqt diff -Nru lxqt-qtplugin-0.14.0/src/lxqtplatformtheme.cpp lxqt-qtplugin-0.16.0/src/lxqtplatformtheme.cpp --- lxqt-qtplugin-0.14.0/src/lxqtplatformtheme.cpp 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/src/lxqtplatformtheme.cpp 2020-10-30 13:42:33.000000000 +0000 @@ -56,7 +56,8 @@ LXQtPlatformTheme::LXQtPlatformTheme(): iconFollowColorScheme_(true) - , settingsWatcher_(NULL) + , settingsWatcher_(nullptr) + , LXQtPalette_(nullptr) { loadSettings(); // Note: When the plugin is loaded, it seems that the app is not yet running and @@ -75,6 +76,8 @@ } LXQtPlatformTheme::~LXQtPlatformTheme() { + if(LXQtPalette_) + delete LXQtPalette_; if(settingsWatcher_) delete settingsWatcher_; } @@ -113,6 +116,109 @@ // single click activation singleClickActivate_ = settings.value(QLatin1String("single_click_activate")).toBool(); + // palette + settings.beginGroup(QLatin1String("Palette")); + paletteChanged_ = false; + + QColor color = winColor_; + winColor_.setNamedColor(settings.value(QLatin1String("window_color"), QLatin1String("#efefef")).toString()); + if(!winColor_.isValid()) + winColor_.setNamedColor(QStringLiteral("#efefef")); + paletteChanged_ = color != winColor_; + + color = baseColor_; + baseColor_.setNamedColor(settings.value(QLatin1String("base_color")).toString()); + if (!paletteChanged_) + paletteChanged_ = baseColor_.isValid() && color != baseColor_; + + color = highlightColor_; + highlightColor_.setNamedColor(settings.value(QLatin1String("highlight_color")).toString()); + if (!paletteChanged_) + paletteChanged_ = highlightColor_.isValid() && color != highlightColor_; + + color = winTextColor_; + winTextColor_.setNamedColor(settings.value(QLatin1String("window_text_color")).toString()); + if (!paletteChanged_) + paletteChanged_ = winTextColor_.isValid() && color != winTextColor_; + + color = textColor_; + textColor_.setNamedColor(settings.value(QLatin1String("text_color")).toString()); + if (!paletteChanged_) + paletteChanged_ = textColor_.isValid() && color != textColor_; + + color = highlightedTextColor_; + highlightedTextColor_.setNamedColor(settings.value(QLatin1String("highlighted_text_color")).toString()); + if (!paletteChanged_) + paletteChanged_ = color != highlightedTextColor_.isValid() && color != highlightedTextColor_; + + color = linkColor_; + linkColor_.setNamedColor(settings.value(QLatin1String("link_color")).toString()); + if (!paletteChanged_) + paletteChanged_ = linkColor_.isValid() && color != linkColor_; + + color = linkVisitedColor_; + linkVisitedColor_.setNamedColor(settings.value(QLatin1String("link_visited_color")).toString()); + if (!paletteChanged_) + paletteChanged_ = linkVisitedColor_.isValid() && color != linkVisitedColor_; + + if(paletteChanged_) + { + if(LXQtPalette_) + delete LXQtPalette_; + // This sets all colors appropriately but valid custom colors are set below. + // If a custom color is not valid, Qt's calculated color will be used. + LXQtPalette_ = new QPalette(winColor_); + + if (baseColor_.isValid()) + { + LXQtPalette_->setColor(QPalette::Base, baseColor_); + // See Qt -> qpalette.cpp -> qt_fusionPalette() + LXQtPalette_->setColor(QPalette::Disabled, QPalette::Base, winColor_); + } + if (highlightColor_.isValid()) + { + LXQtPalette_->setColor(QPalette::Highlight, highlightColor_); + int gray = qGray(highlightColor_.rgb()); + color = QColor(gray, gray, gray); + LXQtPalette_->setColor(QPalette::Disabled, QPalette::Highlight, color); + } + else + { + // Qt's default highlight color and that of Fusion may be different. This is a workaround: + LXQtPalette_->setColor(QPalette::Highlight, QColor(60, 140, 230)); + if (highlightedTextColor_.isValid()) + LXQtPalette_->setColor(QPalette::HighlightedText, QColor(255, 255, 255)); + } + if (winTextColor_.isValid()) + { + LXQtPalette_->setColor(QPalette::WindowText, winTextColor_); + LXQtPalette_->setColor(QPalette::ButtonText, winTextColor_); + color = winTextColor_; + color.setAlpha(130); + LXQtPalette_->setColor(QPalette::Disabled, QPalette::WindowText, color); + LXQtPalette_->setColor(QPalette::Disabled, QPalette::ButtonText, color); + } + if (textColor_.isValid()) + { + LXQtPalette_->setColor(QPalette::Text, textColor_); + color = textColor_; + color.setAlpha(130); + LXQtPalette_->setColor(QPalette::Disabled, QPalette::Text, color); + } + if (highlightedTextColor_.isValid()) + { + LXQtPalette_->setColor(QPalette::HighlightedText, highlightedTextColor_); + color = highlightedTextColor_; + color.setAlpha(130); + LXQtPalette_->setColor(QPalette::Disabled, QPalette::HighlightedText, color); + } + if (linkColor_.isValid()) + LXQtPalette_->setColor(QPalette::Link, linkColor_); + if (linkVisitedColor_.isValid()) + LXQtPalette_->setColor(QPalette::LinkVisited, linkVisitedColor_); + } + settings.endGroup(); + // load Qt settings settings.beginGroup(QLatin1String("Qt")); @@ -173,11 +279,20 @@ loadSettings(); // reload the config file - if(style_ != oldStyle) // the widget style is changed + if(style_ != oldStyle || paletteChanged_) // the widget style or palette is changed { // ask Qt5 to apply the new style - if (qobject_cast(QCoreApplication::instance())) + if(auto app = qobject_cast(QCoreApplication::instance())) + { QApplication::setStyle(style_); + // Qt 5.15 needs this and it's safe otherwise + if(LXQtPalette_) + { + QApplication::setPalette(*LXQtPalette_); + // the app should be polished because the style may have an internal palette + QApplication::style()->polish(app); + } + } } if(iconTheme_ != oldIconTheme) { // the icon theme is changed @@ -238,8 +353,8 @@ // The createFileDialogHelper() method is dynamically loaded from libfm-qt on demand if(createFileDialogHelper == nullptr) { - // try to dynamically load libfm-qt.so - QLibrary libfmQtLibrary{QLatin1String("libfm-qt")}; + // try to dynamically load versioned libfm-qt.so + QLibrary libfmQtLibrary{QLatin1String(LIB_FM_QT_SONAME)}; libfmQtLibrary.load(); if(!libfmQtLibrary.isLoaded()) { return nullptr; @@ -258,7 +373,11 @@ return nullptr; } -const QPalette *LXQtPlatformTheme::palette(Palette /*type*/) const { +const QPalette *LXQtPlatformTheme::palette(Palette type) const { + if(type == QPlatformTheme::SystemPalette) { + if(LXQtPalette_) + return LXQtPalette_; + } return nullptr; } @@ -356,7 +475,7 @@ { return new XdgIconLoaderEngine(iconName); } - + // Helper to return the icon theme paths from XDG. QStringList LXQtPlatformTheme::xdgIconThemePaths() const { diff -Nru lxqt-qtplugin-0.14.0/src/lxqtplatformtheme.h lxqt-qtplugin-0.16.0/src/lxqtplatformtheme.h --- lxqt-qtplugin-0.14.0/src/lxqtplatformtheme.h 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/src/lxqtplatformtheme.h 2020-10-30 13:42:33.000000000 +0000 @@ -41,22 +41,22 @@ Q_OBJECT public: LXQtPlatformTheme(); - ~LXQtPlatformTheme(); + ~LXQtPlatformTheme() override; // virtual QPlatformMenuItem* createPlatformMenuItem() const; // virtual QPlatformMenu* createPlatformMenu() const; // virtual QPlatformMenuBar* createPlatformMenuBar() const; - virtual bool usePlatformNativeDialog(DialogType type) const; - virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const; + bool usePlatformNativeDialog(DialogType type) const override; + QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override; - virtual const QPalette *palette(Palette type = SystemPalette) const; + const QPalette *palette(Palette type = SystemPalette) const override; - virtual const QFont *font(Font type = SystemFont) const; + const QFont *font(Font type = SystemFont) const override; - virtual QVariant themeHint(ThemeHint hint) const; + QVariant themeHint(ThemeHint hint) const override; - QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const + QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override { auto trayIcon = new LXQtSystemTrayIcon; if (trayIcon->isSystemTrayAvailable()) @@ -72,7 +72,7 @@ // virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, // QPlatformTheme::IconOptions iconOptions = 0) const; - virtual QIconEngine *createIconEngine(const QString &iconName) const; + QIconEngine *createIconEngine(const QString &iconName) const override; // virtual QList keyBindings(QKeySequence::StandardKey key) const; @@ -97,6 +97,10 @@ // other Qt settings // widget QString style_; + QColor winColor_, baseColor_, highlightColor_, + winTextColor_, textColor_, highlightedTextColor_, + linkColor_, linkVisitedColor_; + bool paletteChanged_; QString fontStr_; QFont font_; QString fixedFontStr_; @@ -109,6 +113,8 @@ QFileSystemWatcher *settingsWatcher_; QString settingsFile_; + QPalette *LXQtPalette_; + QStringList xdgIconThemePaths() const; }; diff -Nru lxqt-qtplugin-0.14.0/src/lxqtsystemtrayicon.cpp lxqt-qtplugin-0.16.0/src/lxqtsystemtrayicon.cpp --- lxqt-qtplugin-0.14.0/src/lxqtsystemtrayicon.cpp 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/src/lxqtsystemtrayicon.cpp 2020-10-30 13:42:33.000000000 +0000 @@ -355,7 +355,7 @@ QRect LXQtSystemTrayIcon::geometry() const { // StatusNotifierItem doesn't provide the geometry - return QRect(); + return {}; } void LXQtSystemTrayIcon::showMessage(const QString &title, const QString &msg, diff -Nru lxqt-qtplugin-0.14.0/src/main.cpp lxqt-qtplugin-0.16.0/src/main.cpp --- lxqt-qtplugin-0.14.0/src/main.cpp 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/src/main.cpp 2020-10-30 13:42:33.000000000 +0000 @@ -36,13 +36,13 @@ Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1" FILE "lxqtplatformtheme.json") public: - QPlatformTheme *create(const QString &key, const QStringList ¶ms); + QPlatformTheme *create(const QString &key, const QStringList ¶ms) override; }; QPlatformTheme *LXQtPlatformThemePlugin::create(const QString &key, const QStringList &/*params*/) { if (!key.compare(QLatin1String("lxqt"), Qt::CaseInsensitive)) return new LXQtPlatformTheme(); - return NULL; + return nullptr; } QT_END_NAMESPACE diff -Nru lxqt-qtplugin-0.14.0/src/statusnotifieritem/statusnotifieritem.cpp lxqt-qtplugin-0.16.0/src/statusnotifieritem/statusnotifieritem.cpp --- lxqt-qtplugin-0.14.0/src/statusnotifieritem/statusnotifieritem.cpp 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/src/statusnotifieritem/statusnotifieritem.cpp 2020-10-30 13:42:33.000000000 +0000 @@ -29,7 +29,8 @@ #include "statusnotifieritemadaptor.h" #include #include -#include +#include +#include int StatusNotifierItem::mServiceCounter = 0; @@ -39,10 +40,12 @@ mService(QString::fromLatin1("org.freedesktop.StatusNotifierItem-%1-%2") .arg(QCoreApplication::applicationPid()) .arg(++mServiceCounter)), - mId(id), + mId(std::move(id)), mTitle(QLatin1String("Test")), mStatus(QLatin1String("Active")), + mCategory(QLatin1String("ApplicationStatus")), mMenu(nullptr), + mMenuPath(QLatin1String("/NO_DBUSMENU")), mMenuExporter(nullptr), mSessionBus(QDBusConnection::connectToBus(QDBusConnection::SessionBus, mService)) { @@ -52,7 +55,6 @@ // register service - mSessionBus.registerService(mService); mSessionBus.registerObject(QLatin1String("/StatusNotifierItem"), this); registerToHost(); @@ -69,7 +71,6 @@ StatusNotifierItem::~StatusNotifierItem() { mSessionBus.unregisterObject(QLatin1String("/StatusNotifierItem")); - mSessionBus.unregisterService(mService); QDBusConnection::disconnectFromBus(mService); } @@ -79,7 +80,7 @@ QLatin1String("/StatusNotifierWatcher"), QLatin1String("org.kde.StatusNotifierWatcher"), mSessionBus); - interface.asyncCall(QLatin1String("RegisterStatusNotifierItem"), mService); + interface.asyncCall(QLatin1String("RegisterStatusNotifierItem"), mSessionBus.baseService()); } void StatusNotifierItem::onServiceOwnerChanged(const QString& service, const QString& oldOwner, @@ -95,6 +96,7 @@ void StatusNotifierItem::onMenuDestroyed() { mMenu = nullptr; + setMenuPath(QLatin1String("/NO_DBUSMENU")); mMenuExporter = nullptr; //mMenu is a QObject parent of the mMenuExporter } @@ -116,6 +118,14 @@ Q_EMIT mAdaptor->NewStatus(mStatus); } +void StatusNotifierItem::setCategory(const QString &category) +{ + if (mCategory == category) + return; + + mCategory = category; +} + void StatusNotifierItem::setMenuPath(const QString& path) { mMenuPath.setPath(path); @@ -230,7 +240,11 @@ } mMenu = menu; - setMenuPath(QLatin1String("/MenuBar")); + if (nullptr != mMenu) + setMenuPath(QLatin1String("/MenuBar")); + else + setMenuPath(QLatin1String("/NO_DBUSMENU")); + //Note: we need to destroy menu exporter before creating new one -> to free the DBus object path for new menu delete mMenuExporter; if (nullptr != mMenu) @@ -302,7 +316,12 @@ if (image.format() != QImage::Format_ARGB32) image = image.convertToFormat(QImage::Format_ARGB32); - pix.bytes = QByteArray((char *) image.bits(), image.byteCount()); + pix.bytes = QByteArray((char *) image.bits(), +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) + image.byteCount()); +#else + image.sizeInBytes()); +#endif // swap to network byte order if we are little endian if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) diff -Nru lxqt-qtplugin-0.14.0/src/statusnotifieritem/statusnotifieritem.h lxqt-qtplugin-0.16.0/src/statusnotifieritem/statusnotifieritem.h --- lxqt-qtplugin-0.14.0/src/statusnotifieritem/statusnotifieritem.h 2019-01-24 22:04:03.000000000 +0000 +++ lxqt-qtplugin-0.16.0/src/statusnotifieritem/statusnotifieritem.h 2020-10-30 13:42:33.000000000 +0000 @@ -43,6 +43,7 @@ { Q_OBJECT + Q_PROPERTY(QString Category READ category) Q_PROPERTY(QString Title READ title) Q_PROPERTY(QString Id READ id) Q_PROPERTY(QString Status READ status) @@ -61,7 +62,7 @@ public: StatusNotifierItem(QString id, QObject *parent = nullptr); - ~StatusNotifierItem(); + ~StatusNotifierItem() override; QString id() const { return mId; } @@ -74,6 +75,10 @@ { return mStatus; } void setStatus(const QString &status); + QString category() const + { return mCategory; } + void setCategory(const QString &category); + QDBusObjectPath menu() const { return mMenuPath; } void setMenuPath(const QString &path); @@ -162,6 +167,7 @@ QString mId; QString mTitle; QString mStatus; + QString mCategory; // icons QString mIconName, mOverlayIconName, mAttentionIconName;