piroor / treestyletab

Tree Style Tab, Show tabs like a tree.
http://piro.sakura.ne.jp/xul/treestyletab/
Other
3.46k stars 278 forks source link

"Apply Browser Theme" not applying dark colors #2314

Closed mruhlin closed 4 years ago

mruhlin commented 5 years ago

Short description

Firefox ships with light and dark themes by default, and a "default" theme that can switch between them based on the user's OS-level dark mode settings (for mac OS at least, I'm not sure what other OSes support this).

Setting Tree Style Tab to "apply browser theme" doesn't seem to inherit any theme settings from those default themes though. It works fine with third party themes, but should work with the built in ones too (especially since Firefox does a good job of toggling when the OS toggles)

Steps to reproduce

  1. Set mac OS for dark mode
  2. Start Firefox with clean profile.
  3. Install TST.
  4. Go to TST preferences
  5. Select "plain light" theme
  6. make sure "Apply Browser Theme" is checked

Expected result

tabs should have dark background and light text

Actual result

tabs have light background and dark text

Environment

31j commented 5 years ago

Issue is reproduceable on Windows 10 Pro, Firefox: 68 Beta 10, Tree Style Tab: 3.1.1, With the Vertigo theme, Tabs should have dark background and light text however tabs have light background with dark text instead.

Sorry that I don't have any information for even a "temp" fix, best of luck with the issue!

sbr61 commented 5 years ago

GUI customization that can be done by addons seems to be rather limited in Firefox. This is the reason why people created ShadowFox.

What it does:

Fortunately, ShadowFox does have support for TST. For me, the tab tree is completely dark with light text.

Actually, the text on discarded tabs was not light enough for my eyes. I fixed this by adding the following CSS to userContent_customization.css:


/*! Alters the webextension Tree Style Tab */
@-moz-document url-prefix("moz-extension://treestyletab@piro.sakura.ne.jp/") {
  .tab.discarded {
    opacity: .70 !important
  }
  .tab.discarded .label {
    color: var(--in-content-page-color) !important
  }
}

After adding this, re-execute ShadowFox to get the CSS copied over to userContent.css with the correct replacement for the URL prefix.

piroor commented 5 years ago

Firefox doesn't notify color information to addons, if it is inherited from the platform. You need to choose "Dark", "Light", or other third party theme. Otherwise, Firefox Color addon helps you to choose colors manually. TST can apply theme colors on these cases.

piroor commented 5 years ago

Related bugs on Firefox:

TiZ-HugLife commented 5 years ago

Now that Firefox 68 is out, this option is broken for anyone who updates to it. It seems like it might be related to OS theming being blocked on webpages, which I guess TST technically is at the end of the day. I noticed that parts of pages that used to be dark due to my GTK theme weren't dark anymore.

FichteFoll commented 5 years ago

I can confirm this. I was using this option with the Arc-Dark theme and after updating to 68 my TST is bright. I guess the workaround is to downgrade until this is fixed in upstream?

Edit: Well, guess that didn't work out too well because FF doesn't want to reuse a profile that has been used with a higher version once.

TiZ-HugLife commented 5 years ago

I went to /r/FirefoxCSS about this, and apparently there is a new about:config option: widget.content.allow-gtk-dark-theme Set that to true then restart.

jayywolff commented 5 years ago

I went to /r/FirefoxCSS about this, and apparently there is a new about:config option: widget.content.allow-gtk-dark-theme Set that to true then restart.

image

mruhlin commented 5 years ago

Hey thanks for the info. I just got back around to looking at this, and I don't see a widget.content.allow-gtk-dark-theme anywhere in about:config. (using firefox version 68.0, which they say is the latest. Did they give us a fix and then take it away?

edit: I guess GTK is a linux thing, so maybe that option just isn't a thing for mac users.

irvinm commented 4 years ago

@mruhlin can you try again with the recent build?

mruhlin commented 4 years ago

Looks better! But.... on the latest build, it matches whichever theme the system has when firefox starts. If I toggle while firefox is running, FF automatically switches themes, but TST stays the same. Not sure if that counts as a separate issue or not.

  1. Set mac os to dark mode
  2. Launch Firefox
  3. Note that TST is dark
  4. Set mac OS to light mode
  5. TST should be light but is still dark.
  6. Close and reopen firefox
  7. TST is now light
  8. Switch OS back to dark mode
  9. TST still light
irvinm commented 4 years ago

I just tried your exact sequence and in my case (Windows) the theme changes without having to restart Firefox. I will leave it to @piroor how he wants to handle that.

mruhlin commented 4 years ago

I've been clicking "remind me tomorrow" for a few months now about an osx update. Let me just double check if that changes anything...

mruhlin commented 4 years ago

Yeah no luck, works the same on latest mac os (10.15.1)

irvinm commented 4 years ago

Thanks for trying. Glad it at least works after restarting Firefox.

TiZ-HugLife commented 4 years ago

There was a short time when it was broken on Linux, but the 4 days ago update fixed it.

piroor commented 4 years ago

TST tries to mix some colors when the sidebar is loaded, to apply pale highlighted colors and other variations to hover/active tabs. Sorry that the latest released version of TST doesn't have any code to re-calculate colors when the system color scheme is changed dynamically and you need to close/reopen the sidebar to apply new colors completely for now.

Thus I've added a code to re-calculate colors dynamically at the commit 1832fb0. I hope it should fix the "some colors are remained with old color scheme" problem.

irvinm commented 4 years ago

@mruhlin does this work better for you with the latest version? If so, can you close this item?

irvinm commented 4 years ago

@piroor I am guessing we can close this.