Hello community, here is the log from the commit of package lxqt-qtplugin for openSUSE:Factory checked in at 2020-06-02 14:37:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lxqt-qtplugin (Old) and /work/SRC/openSUSE:Factory/.lxqt-qtplugin.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lxqt-qtplugin" Tue Jun 2 14:37:26 2020 rev:13 rq:810524 version:0.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/lxqt-qtplugin/lxqt-qtplugin.changes 2020-05-04 18:38:14.736770526 +0200 +++ /work/SRC/openSUSE:Factory/.lxqt-qtplugin.new.3606/lxqt-qtplugin.changes 2020-06-02 14:38:13.783443740 +0200 @@ -1,0 +2,7 @@ +Mon Jun 1 05:54:21 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 0.15.1: + * Fixed Fusion's window color with Qt 5.15. + * Made the window color configurable. + +------------------------------------------------------------------- Old: ---- lxqt-qtplugin-0.15.0.tar.xz lxqt-qtplugin-0.15.0.tar.xz.asc New: ---- lxqt-qtplugin-0.15.1.tar.xz lxqt-qtplugin-0.15.1.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lxqt-qtplugin.spec ++++++ --- /var/tmp/diff_new_pack.P71QRO/_old 2020-06-02 14:38:14.591446295 +0200 +++ /var/tmp/diff_new_pack.P71QRO/_new 2020-06-02 14:38:14.595446307 +0200 @@ -1,7 +1,7 @@ # # spec file for package lxqt-qtplugin # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: lxqt-qtplugin -Version: 0.15.0 +Version: 0.15.1 Release: 0 Summary: LXQt platform integration plugin for Qt 5 License: LGPL-2.1-or-later @@ -38,8 +38,8 @@ BuildRequires: pkgconfig(Qt5X11Extras) BuildRequires: pkgconfig(Qt5XdgIconLoader) BuildRequires: pkgconfig(dbusmenu-qt5) -BuildRequires: pkgconfig(lxqt) >= %{version} BuildRequires: pkgconfig(libfm-qt) >= %{version} +BuildRequires: pkgconfig(lxqt) >= %{version} %if 0%{?fedora_version} %requires_eq qt5-qtbase-gui %else ++++++ lxqt-qtplugin-0.15.0.tar.xz -> lxqt-qtplugin-0.15.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.15.0/CHANGELOG new/lxqt-qtplugin-0.15.1/CHANGELOG --- old/lxqt-qtplugin-0.15.0/CHANGELOG 2020-04-23 20:15:57.000000000 +0200 +++ new/lxqt-qtplugin-0.15.1/CHANGELOG 2020-05-31 14:56:21.000000000 +0200 @@ -1,3 +1,8 @@ +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. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.15.0/src/lxqtplatformtheme.cpp new/lxqt-qtplugin-0.15.1/src/lxqtplatformtheme.cpp --- old/lxqt-qtplugin-0.15.0/src/lxqtplatformtheme.cpp 2020-04-23 20:15:57.000000000 +0200 +++ new/lxqt-qtplugin-0.15.1/src/lxqtplatformtheme.cpp 2020-05-31 14:56:21.000000000 +0200 @@ -57,6 +57,7 @@ LXQtPlatformTheme::LXQtPlatformTheme(): iconFollowColorScheme_(true) , 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_; } @@ -119,6 +122,20 @@ // widget style style_ = settings.value(QLatin1String("style"), QLatin1String("fusion")).toString(); + // window color + // NOTE: Later, we might add more colors but, for now, only the window + // (= button) color is set, with Fusion's window color as the fallback. + QColor oldWinColor = winColor_; + winColor_.setNamedColor(settings.value(QLatin1String("window_color"), QLatin1String("#efefef")).toString()); + if(!winColor_.isValid()) + winColor_.setNamedColor(QStringLiteral("#efefef")); + if(oldWinColor != winColor_) + { + if(LXQtPalette_) + delete LXQtPalette_; + LXQtPalette_ = new QPalette(winColor_); + } + // SystemFont fontStr_ = settings.value(QLatin1String("font")).toString(); if(!fontStr_.isEmpty()) { @@ -167,17 +184,22 @@ // update the settings and repaint the UI. We need to do it ourselves // through dirty hacks and private Qt internal APIs. QString oldStyle = style_; + QColor oldWinColor = winColor_; QString oldIconTheme = iconTheme_; QString oldFont = fontStr_; QString oldFixedFont = fixedFontStr_; loadSettings(); // reload the config file - if(style_ != oldStyle) // the widget style is changed + if(style_ != oldStyle || winColor_ != oldWinColor) // the widget style or window color is changed { // ask Qt5 to apply the new style - if (qobject_cast<QApplication *>(QCoreApplication::instance())) + if(qobject_cast<QApplication *>(QCoreApplication::instance())) + { QApplication::setStyle(style_); + if(LXQtPalette_) + QApplication::setPalette(*LXQtPalette_); // Qt 5.15 needs this and it's safe otherwise + } } if(iconTheme_ != oldIconTheme) { // the icon theme is changed @@ -212,6 +234,10 @@ // Qt5 added a QEvent::ThemeChange event. QEvent event(QEvent::ThemeChange); QApplication::sendEvent(widget, &event); + // Also, set the palette because it may not be updated for some widgets. + // WARNING: The app palette should be used, not LXQtPalette_, because + // some widget styles have their own palettes. + widget->setPalette(QApplication::palette()); } } @@ -258,7 +284,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 +386,7 @@ { return new XdgIconLoaderEngine(iconName); } - + // Helper to return the icon theme paths from XDG. QStringList LXQtPlatformTheme::xdgIconThemePaths() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxqt-qtplugin-0.15.0/src/lxqtplatformtheme.h new/lxqt-qtplugin-0.15.1/src/lxqtplatformtheme.h --- old/lxqt-qtplugin-0.15.0/src/lxqtplatformtheme.h 2020-04-23 20:15:57.000000000 +0200 +++ new/lxqt-qtplugin-0.15.1/src/lxqtplatformtheme.h 2020-05-31 14:56:21.000000000 +0200 @@ -97,6 +97,7 @@ // other Qt settings // widget QString style_; + QColor winColor_; QString fontStr_; QFont font_; QString fixedFontStr_; @@ -109,6 +110,8 @@ QFileSystemWatcher *settingsWatcher_; QString settingsFile_; + QPalette *LXQtPalette_; + QStringList xdgIconThemePaths() const; };
