Please support a real dark mode in GNOME
Currently, the only thing that goes dark is the window decoration with the window title. But not the app content itself. It would be really good for my eyes if there was also a Dangerzone interface in dark mode. And it also looks more consistent in a desktop that as a whole also works in dark mode.
Dangerzone 0.8.1 Using Fedora Workstation 41
Hi @sudwhiwdh! Sorry for taking a while to respond, but we were busy with releasing Dangezone 0.9.0.
To your question, Dangerzone should support dark mode actually: https://github.com/freedomofpress/dangerzone/pull/550. If you run dangerzone from the CLI, it should report whether dark mode is detected or not. Can you paste the output here?
@apyrgio I understand that very well. Thank you for working on 0.9.0!
Here is my CLI output:
user@fedora:~$ dangerzone [DEBUG] Inferred system color scheme as OSColorMode.LIGHT [DEBUG] Setting up Dangerzone updater [DEBUG] Consulting updater settings before checking for updates [DEBUG] Checking platform type [DEBUG] Running on Linux, disabling updates [DEBUG] Will not check for updates, based on updater settings
Hm, that's interesting. From the logs, we can see that Dangerzone detects that you're running with a light color scheme. I've installed Fedora 41 locally though, and I can reproduce your issue. Was dark mode working for you in previous Dangerzone versions?
Will debug a bit more to find the root cause...
Was dark mode working for you in previous Dangerzone versions?
Thanks for checking! No, as far as I remember, I've never had a dark mode in Dangerzone.
I still haven't figured out why we don't detect correctly the system's dark mode. Our code for doing so
https://github.com/freedomofpress/dangerzone/blob/83be5fb151b0c30bad47f173f875b6ce1c20e0bd/dangerzone/gui/init.py#L99-L105
is the same as the one in the most recent Qt blog about dark mode:
static bool shouldApplyDarkFrame()
{
// ...
const QPalette defaultPalette;
return defaultPalette.color(QPalette::WindowText).lightness()
> defaultPalette.color(QPalette::Window).lightness();
}
In any case, until we have a fix for this, I have successfully experimented with two different ways to force Dangerzone use a dark theme:
Method 1 - Force dark theme for legacy GTK apps
Install some extra Gnome themes with:
sudo dnf install gnome-themes-extra
Then, install Gnome Tweaks, open it, go to Appearance -> Styles -> Legacy Applications and choose Adwaita-dark.
[!NOTE] This change affects all legacy GTK apps, and not just Dangerzone.
Method 2 - Force dark theme specifically for Dangerzone
Open a terminal, and start Dangerzone with:
GTK_THEME=Adwaita:dark dangerzone
I don't like much any of these options, so I'll revisit this issue once I have some more time, and solve it properly. In the meantime, if anyone else more experienced in GTK app development has any idea, feel free to share it here.
so I'll revisit this issue once I have some more time, and solve it properly.
Thank you!