dialect-app / dialect

A translation app for GNOME.
https://dialectapp.org/
GNU General Public License v3.0
597 stars 69 forks source link

Dark Mode does not work on some non-GNOME environments #203

Closed qpackard closed 7 months ago

qpackard commented 3 years ago

Rebooted, Preferences shows dark mode enabled but still not active. Don't know why.

Laptop Make & Model > Clevo: N141CU OS: Ubuntu 20.04.3 LTS x86_64 Kernel: 5.11.0-36-generic Shell: bash 5.0.17 DE: GNOME CPU: Intel i7-10510U (8) @ 4.900GHz [122.0°F] CPU Usage: 6% Disk (/): 14G / 457G (4%) GPU: Intel UHD Graphics GPU Driver: i915 Memory: 3362MiB / 15702MiB Resolution: 2560x1440 Packages: 1779 (dpkg), 5 (flatpak), 9 (snap)

mufeedali commented 3 years ago

Are you using the Flatpak? Can you send a screenshot?

enriquerene commented 3 years ago

I'm using Dialect 1.3.0 on Elementary OS 6 (built on Ubuntu 20.04.3 LTS) / Linux 5.11.0-37-generic I've installed via FlatHub Dialect page Install button.

Dialect - issue - dark mode not working

rafaelmardojai commented 3 years ago

Hmm, that entire theme seems broken.

mufeedali commented 3 years ago

@cassidyjames @danrabbit

Sorry, it might not be right of me to ping either of you for this, but this bug seems specific to elementary and I don't know anyone else to request help from :sweat_smile: . I tested it and it's present in any GNOME app with a Dark mode option. (GNOME Builder for example.) Is there a possible fix from our side?

rafaelmardojai commented 3 years ago

@fushinari You can also reproduce this with Fedora by simply activating high contrast (I had Dialect installed on host).

This seems to be a deeper issue. Probably related to a GTK theme not providing a dark variant on it?

mufeedali commented 3 years ago

I've noticed that too but in the case of elementary, it's the default experience. So it's probably not related? Or is it just because a stylesheet is being forced in both cases?

danirabbit commented 3 years ago

@fushinari for now, I would just hang tight. We're currently working with the GNOME community on a cross-desktop standard and this work should land in the settings portal soon!

If you really want to support the dark style on elementary OS right now, you can add a sandbox hole for accounts service and listen to key changes there. But, my guess is that we'll get support merged into our settings portal in the next month so it's probably not worth working around at this time

rafaelmardojai commented 3 years ago

If you really want to support the dark style on elementary OS right now, you can add a sandbox hole for accounts service and listen to key changes there.

True, but how you enable dark theme? Our manual switch enables gtk-application-prefer-dark-theme and isn't working. I guess we will need to dynamically change the GTK theme to elementary's dark variant or wherever granite apps do to use dark theme?

We're currently working with the GNOME community on a cross-desktop standard and this work should land in the settings portal soon!

Yeah, I would wait for that and just pass this as a normal GTK theming issue. I hope that when we switch to libadwaita this kind of things wouldn't happen.

Thanks for the advice!

mufeedali commented 3 years ago

@danrabbit

We're currently working with the GNOME community on a cross-desktop standard and this work should land in the settings portal soon!

Love all your work on that! Thank you!

Unfortunately, this issue might be unrelated. The issue here is that our application's in-app dark mode switch isn't working. It sets gtk-application-prefer-dark-theme to True but on elementary OS this seems to have no effect.

I've also tested with other GNOME apps and it seems to be broken in all of them.

For now, I've reported it here: https://github.com/elementary/flatpak-platform/issues/73 . I'm not sure it was the right project to report on but I did not see a more apt one, sorry if that creates more work for you. :sweat_smile:

I've also been following all the cool work on the new standard and I've already begun playing around with it, so it'll land as soon as libhandy gets a new release.

danirabbit commented 3 years ago

@fushinari ah okay. In that case, I think this is actually an issue with GTK. If the user's system stylesheet is set to elementary and it's falling back to Adwaita in your app, then I think the fallback ignores the dark style preference. I've heard of this before. You might be able to work around it by hard coding Adwaita when the dark style preference is true? (Or always)

Edit: I suppose another way would be if you intend to support the elementary stylesheet you could add it to your manifest so it's available in the container

mufeedali commented 3 years ago

@danrabbit thanks for all your help with this!

We've decided to not "fix" this on our side for now.

I tried adding the elementary stylesheet to the flatpak manifest. Like you guessed, the in-app dark mode worked. But some things like the preferences window was still broken to the point of being non-functional, so I decided to avoid going down that route.

Since it's a theming issue it'll hopefully be resolved with either libadwaita or the next version of libhandy.

mufeedali commented 2 years ago

Should be fixed in the next release.

Flashwalker commented 1 year ago

Hello, I found a workaround for this problem. In Flatseal permission management tool (https://flathub.org/apps/details/com.github.tchx84.Flatseal) give "All system files" permission for Dialect app.

not good idea

Flashwalker commented 1 year ago

This is the only Flatpak app in my system which doesn't respect themes. Neither system nor built-in dark themes. I made this for all Flatpak apps and it works, except Dialect:

sudo flatpak override --filesystem=xdg-data/themes
sudo flatpak override --env=GTK_THEME=Pop-dark
mufeedali commented 7 months ago

This should be fixed now with the dark theme API being widespread now.