Skip to content

Style context menus as light or dark depending on the base theme - #9551

Open
absidue wants to merge 2 commits into
FreeTubeApp:developmentfrom
absidue:override-theme-source
Open

Style context menus as light or dark depending on the base theme#9551
absidue wants to merge 2 commits into
FreeTubeApp:developmentfrom
absidue:override-theme-source

Conversation

@absidue

@absidue absidue commented Aug 1, 2026

Copy link
Copy Markdown
Member

Pull Request Type

  • Feature Implementation

Description

Currently the context menus in FreeTube follow the system level dark/light mode, which means you can get dark menus with a light theme selected in FreeTube or get flashbanged by white menus when you have a dark theme set in FreeTube. With this pull request FreeTube overrides Electron's themeSource setting to "dark", "light" or "system" as appropriate. It also affects the dev tools and has some operating system specific effects such as changing the title bar and/or app menu colours, so most parts of the Electron UI should match as well as operating system level UI that Electron is able to override.

Screenshots

Black theme

black theme with dark context menu

Solarized Light theme

solarized light them with light context menu

Testing

Test various themes in FreeTube and check that the context menu and devtools theming matches, additionally confirm that it correctly switched back to the operating system theme when the system theme is selected in FreeTube.

Desktop

  • OS: Windows
  • OS Version: 11

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 1, 2026
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 1, 2026 22:05
Comment thread src/constants.js Outdated
@Shadorc

Shadorc commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

On Linux Fedora, KDE Plasma, Wayland, it works for the dev tools but not for the context menus
image

@absidue

absidue commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

@Shadorc Is that just after launch or does it also happen if you change the base theme while FreeTube is running?

Potentially related upstream items:

@Shadorc

Shadorc commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@absidue It does not work while FreeTube is running and after launch. I'm never able to get the context menus with a light theme (my OS theme is dark, it's probabbly using this no matter what).

Edit: I confirm that the context menus theme can only be changed by changing my OS theme, FreeTube's base theme has no impact.

@absidue

absidue commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

If you press Alt to show the app menu does that at least match?

The fact that the devtools get updated means it is at least overriding the prefers-color-scheme CSS media query.

@Shadorc

Shadorc commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

It does not work with Alt (not in real time nor after a restart)
image

@absidue

absidue commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

In that case it seems like it is an Electron or Chromium bug to me (if you could create a standalone repro in Electron Fiddle and report it in the Electron repo that would be great). As it seems to work fine on Windows and macOS, as long as this pull request doesn't make it any worse than before on Linux, it would still be good to see this merged (it should hopefully start working on Linux automatically once it is fixed upstream).

@Shadorc

Shadorc commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

I agree!
I will try to reproduce with Electron Fiddle.
This MR can be merge as is for me, it does not change the linux experience

Edit: Reproduced with Electron Fiddle, upstream bug confirmed to be electron/electron#28887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants