Skip to content

Commit

Permalink
fix(style): scroll bar border color on dark style
Browse files Browse the repository at this point in the history
Change-Id: I73690820d98fc845b42befdd3e80268803b81b14
  • Loading branch information
zccrs committed Mar 5, 2018
1 parent 83bdc59 commit 0b3472b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions dstyleplugin/brushschemes/ddark.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ ScrollBar:hover {

ScrollBar:pressed {
HandleBrush: rgba(96, 96, 96, 0.3);
HandleBorderBrush: rgba(255, 255, 255, 0.05);
}

ScrollBar:focus {
Expand Down
1 change: 1 addition & 0 deletions dstyleplugin/brushschemes/dsemidark.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ ScrollBar:hover {

ScrollBar:pressed {
HandleBrush: rgba(96, 96, 96, 0.3);
HandleBorderBrush: rgba(255, 255, 255, 0.05);
}

ScrollBar:focus {
Expand Down
7 changes: 2 additions & 5 deletions dstyleplugin/scrollbarhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ QRect Style::scrollbarSubControlRect(const QStyleOptionComplex *opt, QStyle::Sub
case SC_ScrollBarSlider:
if (scrollbar->orientation == Qt::Horizontal) {
if (mouseOver && enabled)
ret.setRect(sliderstart, 1, sliderlen, scrollBarRect.height() - 2);
ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height());
else
ret.setRect(sliderstart, scrollBarRect.height() / 4, sliderlen, scrollBarRect.height() / 2);
} else {
if (mouseOver && enabled)
ret.setRect(1, sliderstart, scrollBarRect.width() - 2, sliderlen);
ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen);
else
ret.setRect(scrollBarRect.width() / 4, sliderstart, scrollBarRect.width() / 2, sliderlen);
}
Expand Down Expand Up @@ -218,9 +218,6 @@ bool Style::drawScrollBarSliderControl(const QStyleOption *option, QPainter *pai

QRectF rect = option->rect;

if (option->state & QStyle::State_Sunken)
rect.adjust(0.5, 0.5, 0, 0);

const QBrush &background = m_palette->brush(PaletteExtended::ScrollBar_HandleBrush, option, 0, Qt::lightGray);
const QBrush &border = m_palette->brush(PaletteExtended::ScrollBar_HandleBorderBrush, option, 0, background);
PainterHelper::drawRoundedRect(painter, rect, 3, 3, Qt::AbsoluteSize, background, Metrics::Painter_PenWidth, border);
Expand Down

0 comments on commit 0b3472b

Please sign in to comment.