diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2022-10-13 14:07:13 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2022-10-27 17:14:51 +0200 |
commit | a43845b75a3eaed9cb0a323a9694c34a601286fb (patch) | |
tree | b2cb2a9e388bce6533a0f9cfd596b4ccb569370a /src/plugins/styles/mac/qmacstyle_mac.mm | |
parent | 433d7116709d9c34bcef997d83101d102f99048a (diff) |
QMacStyle: paint PE_PanelScrollArea differently
To make it look more natural (without outline and with proper colors).
Otherwise this thing looks bad in both Aqua and Dark themes -
can be seen if scrollbars always shown (this option is set in "General"
settings).
Tried so far:
- not to draw this element at all - gives a visible hole in the corner
- ask the horizontal bar to render its knob track a bit longer (resetting
a clip properly) - gives a weird side-effect when scrolling in Dark
mode + unfortunately outline of a track is still visible (it overlaps
the vertical bar's track).
Alas, good old hardcoded colors/alpha values as a last resort.
PE_Frame had -1,-1 adjustment, making a frame line visible in the
corner below scrollbars, giving another strange effect.
Fixes: QTBUG-106927
Change-Id: Ie0367c3bd6f40b3fa4ca6afac09f27e446fc007d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index d56b38a0d6..a1af6a709d 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3298,7 +3298,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai case PE_Frame: { QPen oldPen = p->pen(); p->setPen(opt->palette.base().color().darker(140)); - p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); + p->drawRect(opt->rect); p->setPen(opt->palette.base().color().darker(180)); p->drawLine(opt->rect.topLeft(), opt->rect.topRight()); p->setPen(oldPen); @@ -3382,11 +3382,11 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai } break; case PE_PanelScrollAreaCorner: { - const QBrush brush(opt->palette.brush(QPalette::Base)); - p->fillRect(opt->rect, brush); - p->setPen(QPen(QColor(217, 217, 217))); - p->drawLine(opt->rect.topLeft(), opt->rect.topRight()); - p->drawLine(opt->rect.topLeft(), opt->rect.bottomLeft()); + QBrush brush(opt->palette.brush(isDarkMode() ? QPalette::WindowText : QPalette::Base)); + auto color(brush.color()); + color.setAlphaF(isDarkMode() ? 0.059 : 0.76); + brush.setColor(color); + p->fillRect(opt->rect, color); } break; case PE_FrameStatusBarItem: break; |