[GTK3] Scrollbars now have proper states
Needs ReviewPublic

Authored by cblack on Sep 20 2019, 10:44 PM.

Details

Reviewers
ngraham
Group Reviewers
Breeze
Summary

Scrollbars now use the proper colours for active and inactive windows.

Test Plan

Scrollbars before:

Scrollbars after:

Diff Detail

Repository
R98 Breeze for Gtk
Branch
fix-scrollbar-states (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16857
Build 16875: arc lint + arc unit
cblack created this revision.Sep 20 2019, 10:44 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 20 2019, 10:44 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
cblack requested review of this revision.Sep 20 2019, 10:44 PM
ngraham requested changes to this revision.Sep 20 2019, 11:34 PM
ngraham added a subscriber: ngraham.

Hmm, I don't think this is the right fix. Now active scrollbars look much too dark compared to the QWidgets version (at least with a breeze-not-dark color scheme):

Furthermore, sliders' backgrounds are also now too dark:

This revision now requires changes to proceed.Sep 20 2019, 11:34 PM
ndavis added a subscriber: ndavis.Sep 21 2019, 12:25 AM
ndavis added inline comments.
src/gtk3/widgets/_scrollbar.scss
120–121

This needs to be 0.3 to match the Breeze QStyle

ndavis added a comment.EditedSep 21 2019, 12:28 AM

Actually, not sure if this code works how I think it works. 0.2 should actually be less dark than 0.3 if I understand it correctly.

This is the code in the Breeze QStyle:

const auto grooveColor( _helper->alphaColor( palette.color( QPalette::WindowText ), 0.3 ) );

Here's how alphaColor() works:

QColor Helper::alphaColor( QColor color, qreal alpha ) const
{
    if( alpha >= 0 && alpha < 1.0 )
    { color.setAlphaF( alpha*color.alphaF() ); }
    return color;
}

The alpha of the original color is multiplied with the alpha value from the alpha parameter.

For example, 0.30 * 1.00 = 0.30 and 0.30 * 0.80 = 0.24

cblack updated this revision to Diff 66569.Sep 21 2019, 12:58 AM

Fix alpha values

ndavis added a comment.EditedSep 21 2019, 1:09 AM

The slider backgrounds are too bright on Breeze Dark

I think the alpha levels need to be swapped.

cblack updated this revision to Diff 66572.Sep 21 2019, 1:16 AM

Swap out colors

Nothing changed

cblack updated this revision to Diff 66573.Sep 21 2019, 1:25 AM

Fix sliders

Now with Breeze Light, the scrollbar handle is back to being dark when the window is inactive. :)

ndavis added a comment.EditedSep 21 2019, 1:34 AM

Sliders look fixed, but the scrollbar still isn't right. The scrollbar should have the same groove color as the sliders.

const auto color( _helper->alphaColor( palette.color( QPalette::WindowText ), 0.3 * (animated ? opacity : 1) ) );

If animated, use animation opacity, which results in the element fading in, usually on hover (ignore this if it's not applicable or not practical)
Else, opacity is 30%