-
Notifications
You must be signed in to change notification settings - Fork 15
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
Custom CSS is not working well outside of default Elementary OS gtk theme #66
Comments
Or alternative solution, in the settings, instead of "Dark theme" switch to have "Custom theme" dropdown with choices:
|
This is something which I don't think I will be able to solve for everybody. Right now I only check theme compatibility with the elementary theme and Adwaita as I can't hope to make it look native for every theme. What I can do is to allow the user to load a custom theme. Which may be possible once support for plugins is implemented. |
would you consider using ".destructive" class or something else inside GTK? custom theme would solve it, but let's be realistic, who will writing such theme to match every possible gtk theme? (and every gtk theme which could be generated by oomox :-) ) given what after switching theme in gtk settings user will need to update application settings i recommend considering some solution which not involving any hardcoded colors |
The list I'm using is basically a more powerful version of https://blog.gtk.org/2017/06/01/drag-and-drop-in-lists-revisited/. Here one of the main developers of Gtk+ also uses hardcoded colors in the same way. The main problem is that I need to make the rows that are being dragged opaque as else only the text, checkbox and the drag handle are visible of this row. (assuming the row is not selected.)
I can't find any information on a ".destructive" class. The closest I can find is ".destructive-action".
I'm open to suggestions on how to improve this situation. |
also, to explain more clear the scale of the problem i'll give example screenshots: without custom CSS:
after hearing in news report on TV about some crime you also go outside to repeat it? i don't want to go too much into the topic but in gnome team there are some people who lobbying dropping themes support and leaving Adwaita hardcoded (part of their motivation actually was "what for app devs it could be hard working with dynamic themes while on other platforms like Mac or Windows they can assume some default appearance", but that's simply BS since both mac and windows allowing you to customize theme colors (in windows you need first to choose High Contrast theme to get color options).
yes, i meant it
why you need hardcoding colors for adjusting opacity/visibility of some elements?
my main suggestion was to leave an option in settings not to override theme at all. |
What I meant to say is: I've searched for a way to to this in a general way, and couldn't find any. I haven't been able to find any apps which do this in a better way (most apps do not have a need to set colors. Those that do generally aren't affected as badly as this app.). When finally the main devs of Gtk+ also handle these kind of situations in the same way I concluded that no nice way to handle this exists. Yes, I'm looking at code from the same people who insist that Adwaita is the only theme in existance. However, these people are also responsible for theme and styling support. Meaning that it isn't very likely that they have added some functionality to do this in a better way.
The background of a row normally has no color information associated with it (exception: selected rows), rendering it transparent. This usually isn't a problem as rows are rendered on top of widgets that have a background color. When a row is being dragged it means that only the widgets contained in a row show up. This means that we need to add a background layer to the row to fix this. Unfortunately we cannot take the background of the widget placed below the row (the listbox widget, grid, or the window). Nor can we change the opacity of the background layer as it has no color information associated with it (even then no functionality exist to make something more opaque), multiplying zero with something will always be zero. The situation in Windows is significantly different BTW as much less people use custom themes there and you are limited in how much you can change the colors as far as I know. |
you can solve it by another trick, not involving hardcoding colors (the only limitation what user will have to restart the app when changing gtk theme or app should explicitly handle theme change event if it's even possible in gtk). here's the trick:
in highcontrast theme you don't have as many limitations, it's simillar to classic theme customizing interface as it was in win 9x/2000 |
The
How does the application look if you use the css code below?
(Replace colors.css/colors-dark.css or use gtk-inspector) |
sorry, i meant
it looks fine except for the headerbar (CSD) area |
also regarding variable names, official position of gtk devs: "since they're not documented, assume the ones from Adwaita theme should be available" (since your target platform is Elementary -- i guess you need to choose such theme vars which presented in both Adwaita and default Elementary theme) |
Great! In that case I will try to read and use the colors from the theme and fall back to predefined colors in case that isn't possible. The area that includes the switcher buttons and menu is something that will change in a next version, it will no longer have the same background color as the task list. |
anyway with your latest proposed change it looks sane enough :-) |
cb48678 adds an option to select different themes (currently just elementary and a theme using the proposed color changes). |
brilliant! |
Great! Not having to use the same stylesheet for all themes also allowed me to improve how the app looks on elementary OS, so everybody gains something. |
When i first discovered the issue i suggested to fix it at the level of packaging:
https://aur.archlinux.org/packages/go-for-it/
however i was thinking that mb it could be better to do on the level of the app, detect if running inside Elementary and load custom CSS file only in that case
The text was updated successfully, but these errors were encountered: