Zeal: Dark Theme

Created on 12 Jan 2016  Â·  34Comments  Â·  Source: zealdocs/zeal

Provide a dark mode similarly to Dash.

Related to #268

resolutiodone scopui scopuwebview typfeature

Most helpful comment

This is the CSS Dash uses for dark mode:

iframe {
    -webkit-filter: invert()
}
html {
    -webkit-filter: invert() contrast(80%) brightness(120%) contrast(85%);
}
html img[src*=\"jpg\"], html img[src*=\"jpeg\"], html img[src*=\"jpg\"], html img[src*=\"jpeg\"] { 
    -webkit-filter: brightness(100%) contrast(100%); 
}

Adding a hue-rotate makes it a lot nicer as it preserves the colors, but it causes performance issues on OS X so I don't use it.

html { 
    -webkit-filter: invert() hue-rotate(180deg) contrast(80%) brightness(120%) contrast(85%); 
}

All 34 comments

:+1:

:+1:

:+1:

:+1:

Yes please !

:+1:

@Kapeli How's Dash implementing this? Is there a class I should add to some element, or everything is overridden by an external CSS? Thanks!

This is the CSS Dash uses for dark mode:

iframe {
    -webkit-filter: invert()
}
html {
    -webkit-filter: invert() contrast(80%) brightness(120%) contrast(85%);
}
html img[src*=\"jpg\"], html img[src*=\"jpeg\"], html img[src*=\"jpg\"], html img[src*=\"jpeg\"] { 
    -webkit-filter: brightness(100%) contrast(100%); 
}

Adding a hue-rotate makes it a lot nicer as it preserves the colors, but it causes performance issues on OS X so I don't use it.

html { 
    -webkit-filter: invert() hue-rotate(180deg) contrast(80%) brightness(120%) contrast(85%); 
}

:thumbsup:

@trollixx
Thanks, buddy!

Nice! Really looking forward to get 0.4.0 coming.

I can't seem to get dark_mode to work in ~/.conf/Zeal/Zeal.conf
I am setting the css file included in this issue thread. Still no difference.

I run Archlinux running the version 0,3,1 from the community repos.

@areckx 0.3.1 doesn't have this feature. Either get zeal-git from the AUR, or wait for 0.4.0 which I am trying to release right at this moment...

@trollixx great!

I've just flagged the ArchLinux community package as out of date. Hopping for an update soon :)

That would certainly explain it!

Just arrived in Arch repos, though, just main content area (not widgets) gets dark using the dark mode checkbox :(. Would a custom CSS do anything in that regard? Or is there an option?

The app should follow your system theme. Alternatively it's possible to use a custom QSS file via -stylesheet argument.

@trollixx sadly it didn't follow it, I use all dark and zeal is the one that's failing to catch that. I'll check that option thanks!

Unless you're on KDE (or other Qt-based DE), most likely Qt just doesn't follow your GTK theme. Check out this wiki page.

Ah OK, I'm on Gnome.

The wiki page can be a bit confuse to follow, so I'll describe what I've opted to do on ArchLinux/Gnome3 (both GTK3 and GTK2 are installed) for reference:

  • pacman -S breeze-gtk
  • pacman -S qt5-styleplugins
  • export QT_QPA_PLATFORMTHEME=gtk2 saved both on .zprofile (zsh) and .xprofile.

I'm now using Breeze-Dark as my GTK+ theme, it looks good, and it supports Qt applications as well. I have Global Dark Theme enabled on Tweak Tool. With this Zeal starts with dark widget theme, and I can set the dark theme for the main pane on Zeal menu settings.

@oblitum, if you don't care about other users on your system, you can just put that definition on /etc/environment.

For those of us unfortunately stuck using Windows are there any options for changing the widget theme?

image

Only main window is dark , can we make a full dark theme ? At least left sidebar looks too shining in dark mode.

@eromoe See my answer above. You can find some dark styles on the Internet (for example, QDarkStyleSheet). Zeal tries to look as native as possible, implementing support for built-in look and feel is possible, but it's also quite easy to by just using Qt Style and Qt Style Sheets. So, for now I don't think it's a high priority task. Feel free to create a separate ticket for that.

To illustrate how it's for me on ArchLinux/Gnome:

Documentation on style sheets for the Qt library is focused on application code. Considering how much time was spent on finding the proper information I've posted an explicit example here to save everyone else's time:

zeal.exe -stylesheet=qdarkstylesheet.qss

Modify your application link with this option and save it. Done.

Note:
qdarkstylesheet.qss is https://raw.githubusercontent.com/ColinDuquesnoy/QDarkStyleSheet/master/qdarkstyle/style.qss

And it doesn't look good on windows:
image

image

lost checkbox
image

Hi, following @jeroldhaas 's suggestion does make the theme dark but unfortunately slows down the UI to the point that it's unusable.

Most icons are missing, others are styled badly (default black-on-white). This is probably due to missing resources.

I tried to fix this by putting the icons in the same path and modifying the qss file's paths to point to them, but no luck -- icons are still missing, and the interface is still unusably slow. Any ideas?

As a follow-up, it's still not as fast as the vanilla docs, but selecting a custom CSS with simple color inversion instead of the "dark mode" option is a lot faster:

body {
    -webkit-filter: invert();
    filter: invert();
}

This seems to indicate that the problem is just that webkit's implementation of CSS filters is slow (at least on my Windows 10 machine).

Of course, this is for the main docs display; I still couldn't get Zeal's UI to show up as dark without graphical glitches and slowness.

As you know in Linux OS (Have dual boot Win/Linux) when we set Zeal to dark most of UI elements are fine cause our OS elements and UI/GUI and theme are dark too
But for windows we have different case

Menu - List and generally Main window of Zeal still white even dark option is On
For custom CSS, I tried it but have glitches and Not good looking UI elements such as Checkbox ☑ - Text input - scroll bar and some other

As referenced to pull request post, still we have this issue but have good source for dark QT

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for a related request.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trollixx picture trollixx  Â·  8Comments

lebies picture lebies  Â·  8Comments

diosney picture diosney  Â·  4Comments

cccaballero picture cccaballero  Â·  7Comments

rugk picture rugk  Â·  8Comments