Closed Bug 1504787 Opened 6 years ago Closed 3 years ago

Explore using theme scrollbars on Linux for Light/Dark theme

Categories

(DevTools :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jdescottes, Unassigned)

References

Details

Attachments

(2 files)

Follow up to Bug 1471163. We have customized DevTools scrollbar colors using `scrollbar-color`. However on Linux this means that we no longer keep the native scrollbars (see Bug 1464723 for impl. of the property in Linux). Since DevTools are only interested in having a light and dark scrollbar, and GTK themes can define both light and dark scrollbars, maybe there is a way we can use native scrollbars on Linux.
Depends on: 1471163
It would be great if you can manage to have native dark scrollbar implemented with GTK widget. Once we have that, I think we would be able to implement scrollbar-color: light | dark values in a sensible way.
Was going to file this as a regression. See the attached image, where the correct scrollbar is seen next to the content area, and incorrect scrollbars seen within dev tools.
Keywords: regression
See Also: → 1147847
This bug is not tracking a regression. You may flag Bug 1504941 instead.
Attached video floating scrollbar.webm
Quick note here - I added a link to this bug to bug 1147847 because while bug 1471163 intended to get rid of fake floating scrollbars in Linux, GTK3 supports "real" floating scrollbars that solve the problem of dark mode scrollbars pretty neatly. The native GTK3 scrollbar in Adwaita at least are "floating" and look very much like the fake floating scrollbars in the old dev tools - meaning that there is no scroll bar background (the only colored element is the scroll handle), which ends up looking pretty garish (guessing this is the reason that macOS and GNOME have moved away from this). Additionally, the scrollbar disappears and reappears based on actions in the document. See the attached screencast for how it works -- it is similar in some ways to the stable dev tools scrollbar in dark mode.
> GTK3 supports "real" floating scrollbars that solve the problem of dark mode scrollbars pretty neatly. Given the amount of blog and forum posts I've read from Linux users who want to get rid of floating scrollbars, and how attempts to have floating scrollbars by default seem to have been rolled back in Gnome, we probably don't want to force that.
Maybe depends on bug 1492040, unless we can implement this in JS.
> Given the amount of blog and forum posts I've read from Linux users who want to get rid of floating scrollbars, and how attempts to have floating scrollbars by default seem to have been rolled back in Gnome, we probably don't want to force that. Agreed that you likely don't want to force it, but it would be nice to support it, especially since they are presumably supported in macOS. export GTK_OVERLAY_SCROLLING=0 controls this preference for users who don't want the overlay scrollbars, fwiw.
We've had a few users point out that they like the new scrollbars because they use KDE and the new scrollbars fit better there. When we explore using system scrollbars with their dark/light variants, we should check what we're doing on KDE and if "native linux scrollbars" means GTK scrollbars there (if yes, we should probably keep the non-native design on KDE).

I just noticed, this is fixed after toggling layout.css.scrollbar-color.enabled to false (restart required).

IIRC we negotiate a site color scheme according to the detected system color scheme and the site’s <meta name="color-scheme">.

Is it possible to ask GTK to give us a light or dark scrollbar on a per-widget basis? Then we can just get the one that matches the negotiated one and reasonable people should be happy:

  1. I configured my system to use X mode
  2. The site says it supports X mode (maybe among others)
  3. I get X scrollbars

or

  1. The site says it supports X mode only (where X=light if the site doesn’t have that meta tag)
  2. I get X scrollbars

The current behavior certainly seems wrong with what: I configured my system to use dark mode, a site says it supports it and I get light scrollbars.
If we can only tell GTK we want light or dark mode everywhere, that makes sense, otherwise we should improve this.

We should do this now. They're non-native but...

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: