Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect dark GTK theme changes at runtime to adjust background/highlight colors automatically #150

Closed
izidormatusov opened this issue Jun 29, 2015 · 10 comments · Fixed by #439
Assignees
Labels
enhancement low-hanging-fruit "Easy picks" suitable for new contributors to tackle priority:medium reproducible-in-git Issues that affect the current dev version

Comments

@izidormatusov
Copy link
Contributor

As described in this blogpost, it would be really nice to have a support for black Gtk theme. (GEdit has the black theme as well).

@izidormatusov izidormatusov added enhancement priority:medium low-hanging-fruit "Easy picks" suitable for new contributors to tackle labels Jun 29, 2015
@izidormatusov izidormatusov added this to the 0.4 milestone Jun 29, 2015
@jakubbrindza jakubbrindza self-assigned this Jul 10, 2015
akash0675 added a commit to akash0675/gtg that referenced this issue Dec 11, 2015
akash0675 added a commit to akash0675/gtg that referenced this issue Jan 11, 2016
This was referenced Jan 11, 2016
@nekohayo nekohayo removed this from the 0.4 "Work of love" milestone Dec 12, 2019
@diegogangl
Copy link
Contributor

This might not hang as low as we thought. Neither tree views nor text view tags can be styled with CSS.

@nekohayo
Copy link
Member

I'm not 110% sure how it works these days anymore because somewhere in recent years GTK changed from having the notion of a theme's "dark variant" property/switch to having entirely separate dark themes (Adwaita and Adwaita-dark).

What does it look like when you use the Adwaita-dark theme (that you can set in gnome-tweak-tool)? At least in 0.3.x (which is GTK2) it looks 100% fine, both in the main window (treeviews) and the task editor windows, so I assumed it would also work that way in the GTK3 version?

@nekohayo nekohayo added the needinfo We need more info to solve the issue, or we can't fix it. label Feb 21, 2020
@nekohayo nekohayo changed the title Add support for black Gtk theme Add support for Adwaita-dark GTK theme Feb 21, 2020
@diegogangl
Copy link
Contributor

Hmm you are right, I actually tested it and it's that big of a problem. The only things that look bad are the tasks with colored backgrounds and task titles. The first can be fixed by forcing a darker type color, the second can be fixed in the #235 branch

@nekohayo nekohayo changed the title Add support for Adwaita-dark GTK theme Detect dark GTK themes and adjust background/highlight colors automatically Apr 3, 2020
@nekohayo nekohayo added reproducible-in-git Issues that affect the current dev version and removed needinfo We need more info to solve the issue, or we can't fix it. labels Apr 3, 2020
@nekohayo
Copy link
Member

nekohayo commented Apr 3, 2020

Tested out the current git version on Ubuntu 20.04 (Ubuntu being my benchmark for "will downstream break our UI" ;) with both the Yaru dark theme and Adwaita dark, and GTG works "fine".

  • WORKING: Yellow tag text highlights inside the tag editor look fine, in the case of the highlights the text is black-on-yellow anyway. No problem there.
  • MOSTLY WORKING: Task row colors in the main window, when the "Color the task rows based on the tag's assigned color" setting is turned on in the preferences, are already darkened when launching with a dark theme.
    • The case where it fails is if the user/system changes the theme while GTG is already running (which is something I do, I have a script that switches the system to the dark theme at nighttime). "Ideally" GTG should be able to connect to some sort of signal to be notified when the GTK theme changes at runtime, and adjust its colors accordingly? (presumably, if it can toggle the row colors on/off at runtime when you enable/disable the setting, it's probably just a matter of calling a toggle on+off of that thing once, if we want to be hacky about it)
  • NOT WORKING: The only other case where it fails is the "urgency_color" plugin, since it has colors set in its configuration/properties dialog... ideally that plugin should have a fix to automatically compensate too.

Shouldn't be too hard to fix the "MOSTLY WORKING" and "NOT WORKING" issues mentioned above if someone is interested in playing with the code to have it support theme changes detection.

@nekohayo nekohayo changed the title Detect dark GTK themes and adjust background/highlight colors automatically Detect dark GTK theme changes at runtime to adjust background/highlight colors automatically Apr 3, 2020
@esijg
Copy link

esijg commented Jul 11, 2020

I also make gnome change theme during the evenings/night. I noticed this problem with background color on colored tasks being off. (latest flatpak version)
darkthemeplustagcolors

@Xanaxus
Copy link

Xanaxus commented Aug 30, 2020

hey so I just installed the application via popos app store as a flatpack but I haven't come across the option to change to dark theme is there a plugin for it?

diegogangl added a commit that referenced this issue Sep 11, 2020
diegogangl added a commit that referenced this issue Sep 11, 2020
diegogangl added a commit that referenced this issue Sep 11, 2020
diegogangl added a commit that referenced this issue Sep 11, 2020
@diegogangl
Copy link
Contributor

@Xanaxus @johannesgunnar Hey guys, sorry for not responding. Master has a dark mode toggle now that sets up (almost) everything correctly. It's still missing some color changes in the text editor, that will have to wait until the taskview branch lands.

@nekohayo
Copy link
Member

Interesting, though I have to ask, why would it have a dark mode switch/setting, vs just autodetecting system theme changes?

@diegogangl
Copy link
Contributor

We need to have a switch somewhere so we can change colors that aren't affected by CSS. We could remove the switch from the GUI, but AFAIK Gnome doesn't have a way to set a global dark mode yet. You can change the theme using Tweaks but I don't think that's detectable via Gtk.

@nekohayo
Copy link
Member

nekohayo commented Apr 2, 2021

Spiritual successor: issue #608

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement low-hanging-fruit "Easy picks" suitable for new contributors to tackle priority:medium reproducible-in-git Issues that affect the current dev version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants