Ubuntu 22.04.2 LTS
Gnome Version 42.5
GnomeTheme colorScheme is not initalised.
The value is set to Qt::ColorScheme::Unknown in the constructor, however, there is no initial read on this value before a GUI application is launch.
A dbus connection is set up for watching the "SettingChanged" but not an initial read of the gtk theme.
Apply the following patch to WidgetGallery example:
- Set Ubuntu to Dark-Mode via GUI.
- Build widget_gallery with Qt 6.5 with above patch
- Launch widget_gallery.
Widget_gallery will open in "light" mode with color-scheme set to Qt::ColorScheme::Unknown.
Opening "Appearance" in Ubuntu Settings will trigger "Setting Changed" and the widgets gallery will switch to Dark Mode.
Switching to "light-mode" in Ubuntu Settings will toggle the widgets gallery back.
But the initial system Settings for Dark Mode are ignored until the settings GUI is opened and "Appearance" is selected.
The colorScheme value in GnomeTheme is missing an initial value being checked, unlike in the "refresh" function in the KdeTheme constructor.