Update deprecated and unused YelpSettings code
This is a tracking issue for changes I want to make in yelp-settings
. The way we get colors from Gtk is deprecated and needs to be changed. There's also icon theme stuff in there that likely doesn't work with recent yelp-xsl changes.
-
Use gtk_style_context_lookup_color
to look uptheme_base_color
andtheme_text_color
for$color.bg
and$color.fg
, respectively. If the theme doesn't provide both these named colors, we fall back to black text on a white background and make no further attempt to theme any colors. -
Since we're looking up globally defined colors, we don't need a style context attached to a widget. Stop making fake off-screen widgets and just use gtk_style_context_new
instead. -
Probably drop the array of computed colors and just give yelp-settings
accessors forbg_color
andfg_color
. (Or call thembase_color
andtext_color
? Those are the names from Adwaita, which also providesbg_color
andfg_color
, which are different. Butyelp-xsl
usesbg
/fg
nomenclature for what Adwaita'sbase
/text
gives us.) -
Importantly, yelp-xsl
can compute every color it needs, but we might look into giving it a base color palette if that's something we can get from the theme. I didn't see anything in Adwaita at a glance, so maybe not. If we can get them, only set medium-tone base colors, but letyelp-xsl
continue to compute thebg
andfg
variants of the colors. -
But oh no! The search results rely on the colors to craft HTML with a format string. The format string is awful and never keeps up with yelp-xsl
updates. Put the search results thru XSLT. -
But oh no! The help list does the same thing. Put it thru XSLT too. -
But oh no! The "document not found" and "page not found" pages rely on the colors. These are special, near-static pages. Just craft some HTML that doesn't need the colors, maybe with a static image or something. It is not worth spinning up a transform for these. They don't need to look like content pages. -
I'm pretty sure we can remove everything related to icons in yelp-settings
. I think that is all for passing icon images into XSLT, which is not howyelp-xsl
works anymore. It's all inline, recolorable SVGs now. We could in theory hook into the XSLT to make these themeable with icon themes, but I honestly don't think anyone cares. (Note that there is also icon theme stuff for the icons in the search dropdown. Don't break that.) -
When letting yelp-xsl
do color computations with Adwaita-dark, I'm getting recursion depth warnings in calculating bg colors. We should address this.
All these changes are long overdue. I plan on making a branch called 41-settings-revamp
to work on them. Much of it is parallelizable, so if you have an itch, drop a line.
Edited by Shaun McCance