summaryrefslogtreecommitdiffstats
path: root/src/gui/platform/unix/qgenericunixthemes.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ColorScheme: clean up code to prepare adding a setterVolker Hilsheimer2024-04-231-1/+1
| | | | | | | | | | | | | | | | | | | The current QStyleHintsPrivate::setColorScheme is called when the system theme changes, handling the change and informing the application. It is not a setter. When we add a public setter, that setter will have to go through the QPlatformTheme to request an override for the application. That will then result in a call back to the QStyleHints to update the theme with the effective color scheme (or ignore the request for the override, on some platforms). Rename it (and similar misleading APIs in platform plugins) to updateColorScheme, and adjust outdated comments in some of the platform plugins. Task-number: QTBUG-124490 Change-Id: I6a852211254993df86acf2e2d42cf345e7401f4f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* QGenericUnixTheme: Rename ColorTheme enum value to ColorSchemeAxel Spoerl2023-12-291-3/+3
| | | | | | | | | | | | ColorScheme is used in Qt as a name for dark/light desktop mode properties. The enum value was named incorrectly. => Fix it. Pick-to: 6.7 6.6 6.5 Change-Id: I2aa72f81e36c0997127dd6de0e23d4773509ba40 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* QGenericUnixThemesDBusListener: Remove stray qDebug()Axel Spoerl2023-07-181-1/+0
| | | | | | | | Remove a stray qDebug() statement, that was forgotten in the source. Pick-to: 6.6 6.5 Change-Id: I5c413b4356f05570474fa2a0d6ad661785c818b0 Reviewed-by: Liang Qi <liang.qi@qt.io>
* QtGui: code tidies: use the 4-arg connect overloadGiuseppe D'Angelo2023-06-281-2/+2
| | | | | | | | The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Change-Id: I99aa3575a7f901ac52f451f9ef51aa903640d097 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make Gnome theme react to color theme changes without GTKAxel Spoerl2023-05-221-0/+3
| | | | | | | | | | | | Qt doesn't react to color theme changes on systems running Gnome without GTK. This patch adds support for such in QGnomeTheme, following https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/ Pick-to: 6.5 Change-Id: I1f6252d4f394b810b9e4aebe00f2715c8fec3b56 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QGenericUnixThemes: Make DBus listener configurableAxel Spoerl2023-05-211-50/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | The DBus locations and signals QGenericUnixThemesDBusListener has listened to, were hard coded. While these hard codings were in line with the signals emitted by the Linux systems officially supported by Qt, this approach has made it impossible for Qt to react to (color) theme changes when they are announced by other DBus signals. This patch replaces hard coded signals with a QFlatMap member. The member is populated with the DBus locations/signals currently supported. If the environment variable QT_QPA_DBUS_SIGNALS_SAVE contains a valid file name, the default configuration is stored in a JSON file. If the environment variable QT_QPA_DBUS_SIGNALS contains a valid file name, the default configuration is replaced with its content. While the patch doesn't change existing behavior, it adds the possibility to customize alternative DBus signals to listen to. Task-number: QTBUG-103093 Pick-to: 6.5 Change-Id: I37e085c74bf53eed5cda7ec0dd7105562df0ed21 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Revert "D-Bus system tray: properly check whether StatusNotifierHost available"Ilya Fedin2023-04-051-1/+1
| | | | | | | | | | | | | | | | | This reverts commit 23e9b57e3d261f66168a8a28ccb8e5c886b4841f. The original commit was made based on a KDE workaround for libdbusmenu-qt crash, but Qt is not using libdbusmenu-qt, Qt is not watching for StatusNotifierHost registration and Qt is not capable to switch backends on the fly leading to tray support being not detected on Plasma Wayland sessions and falling back to the poor legacy protocol on X11. Task-number: QTBUG-94871 Pick-to: 6.5 Change-Id: Ic3e4a9c2d6db00299ed1f2b14043c4b675fb8ccc Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Rename Qt::Appearance to Qt::ColorSchemeTor Arne Vestbø2023-02-131-24/+24
| | | | | | | | | | | | Based on discussions in the 6.5 API review, where we concluded that 'appearance' is too general. Instead, we follow the CSS standard and use the term 'color scheme'. Pick-to: 6.5 Change-Id: I8ceaf4138ecadff5ccd962480e8e5beb39b556ec Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Jonas Kvinge <jonas@jkvinge.net> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add QPlatformTheme::MouseCursorTheme and MouseCursorSizeLiang Qi2022-11-181-0/+26
| | | | | | | | | | | | | | | | | | | | Also implement in QGenericUnixTheme/QKdeTheme/QGnomeTheme/QGtk3Theme. On Wayland, there is wl_cursor_theme_load() and etc in wayland-cursor.h. On X11/xcb, cursor theme and size are common, either in XCURSOR_THEME and XCURSOR_SIZE envs, or in gsettings for gtk/gnome world. On Windows, cursor theme is part of theme file, see SetWindowTheme in https://learn.microsoft.com/en-gb/windows/win32/api/uxtheme/nf-uxtheme-setwindowtheme . For system settings, for example on Windows 10, Mouse Settings, Additional mouse options, Pointers Tab, Scheme. On macOS, it looks like cursor theme is deprecated. Change-Id: I5821377d966c281fb8330da1f5baa7f0ddf86a9f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Implement appearance detection generic unix themesAxel Spoerl2022-09-211-11/+133
| | | | | | | | | Detect appearance and reimplement QPlatformTheme::appearance() in KDE and Gnome themes. Task-number: QTBUG-106381 Change-Id: Id65ea1e47696fbfb87db5ed194300d652e0bbe66 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QKdeTheme aware of runtime theme changesAxel Spoerl2022-08-301-5/+148
| | | | | | | | | | | | | | | | | | | When the KDE theme gets changed programatically or by the user in KDE settings, Qt applications were not notified during run time. The KDE theme was read during startup only, when the QApplication's palette was constructed. This patch implements a DBus connection to the SettingChanged signal. QKdeTheme is notified about KDE theme changes, which trigger an application palette reconstruction and all subsequent QEvents. The implementation reacts to changes the in KDE settings "widgetStyle" and "ColorTheme". The application palette is updated only if the underlying settings change results in a palette modification. Fixes: QTBUG-103093 Pick-to: 6.4 6.3 6.2 Change-Id: If0ec0f0ba515ef3dcf9924283d3a818ac7d24a7b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move PreselectFirstFileInDirectory theme hint from QGtk3Theme to QGnomeThemeIlya Fedin2022-08-221-0/+2
| | | | | | | | It doesn't use any gtk API, so can live in QGnomeTheme Pick-to: 6.4 Change-Id: Iff0391de6f01a03981f6e45b04fe9824fd2becfc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtGui: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-281-15/+15
| | | | | | Task-number: QTBUG-98434 Change-Id: I98c27030c783f968cbf38dc966ce486dc366b302 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-281-11/+13
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-131-2/+2
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QGnomeTheme: remove unneeded Q_DNoah Davis2022-02-171-1/+0
| | | | | | Change-Id: I3fcb1de9487bfdfab16bae5603fed09ef72e01ba Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* QGnomeTheme: Allow Space, Return, Enter and Select to press buttonsNoah Davis2022-02-161-0/+4
| | | | | | | | | | GTK buttons can be pressed with Space, Return and Enter, so this should be considered native behavior for GTK based desktop environments. Qt::Key_Select is also included here because QAbstractButton has been pressable with Qt::Key_Select for a long time. Change-Id: I2c279ad05d1a10e5968a18996b8b40a83d2251fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Revert "Add Deepin to the list of GTK based desktop environments"Tang Haixiang2021-09-091-2/+1
| | | | | | | | | | | | | | | | | This reverts commit 39f0633f0b00444443e43599aab219a56f6cae2d. The Deepin desktop environment is developed based on Qt, but some applications use dialog boxes of GTK, and some applications use dialog boxes of Qt. This doesn't look good. The initial commit was trying to unify this by always using GTK dialogs. But this turned out to not look good, so instead the plan is that all application dialogs can be based on Qt. Reverting the original commit as a result, as it is no longer applicable. Pick-to: 6.2 Change-Id: I2824b7b2f292f3896c9f94ccce6979f77d66578b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add Deepin to the list of GTK based desktop environmentsTang Haixiang2021-09-091-1/+2
| | | | | | | | | Deepin prefers the GTK3 theme implementation with native dialogs etc. Pick-to: 6.2 6.2.0 Change-Id: I54cea9d17c0d7f5e466c700adce5aa68f0cf5564 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove QtDBus includesDavid Skoland2021-01-121-18/+20
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Pick-to: 6.0 Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QStyle: return 'Fusion' instead of 'fusion'Richard Moe Gustavsen2020-09-121-2/+2
| | | | | | | | | | | | This change should have no impact on Widgets, since style names there are case-insensitive. But for QtQuick controls the style names are case sensitive. So in order to use the style hint from the platform theme for controls, we need to return the name with an uppercase "F". Change-Id: I360f43f174938202b0ef2cdfcde6daf39c9f39bb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-311-9/+9
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Move UNIX themes into QtGuiFriedemann Kleint2020-06-221-0/+884
Task-number: QTBUG-83255 Change-Id: I9e3aecd8e172b60121f472c840eaf2a5538af438 Reviewed-by: Liang Qi <liang.qi@qt.io>