summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qmacstyle_mac.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-01 10:03:53 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-01 16:25:19 +0200
commita09a8d509a69ed16d8afbe15296b8332cacd6c66 (patch)
tree28645b437fd0390d903f753a44ba79626eecb8ac /src/widgets/styles/qmacstyle_mac.mm
parent4b28152da64f7f23a1bbb810d8cdb7626a5f0b8e (diff)
parent83f06da1c6bffff61af78cbe75a0691d53742b53 (diff)
Merge remote-tracking branch 'origin/5.3' into dev
Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
Diffstat (limited to 'src/widgets/styles/qmacstyle_mac.mm')
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index da6422ffec..f03a7796d9 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -3186,17 +3186,15 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
fdi.version = qt_mac_hitheme_version;
fdi.state = tds;
SInt32 frame_size;
- if (pe == PE_FrameLineEdit) {
- fdi.kind = frame->features & QStyleOptionFrame::Rounded ? kHIThemeFrameTextFieldRound :
- kHIThemeFrameTextFieldSquare;
- GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
- if ((frame->state & State_ReadOnly) || !(frame->state & State_Enabled))
- fdi.state = kThemeStateInactive;
- } else {
- baseColor = QColor(150, 150, 150); //hardcoded since no query function --Sam
- fdi.kind = kHIThemeFrameListBox;
- GetThemeMetric(kThemeMetricListBoxFrameOutset, &frame_size);
- }
+ fdi.kind = frame->features & QStyleOptionFrame::Rounded ? kHIThemeFrameTextFieldRound :
+ kHIThemeFrameTextFieldSquare;
+ GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
+ if ((frame->state & State_ReadOnly) || !(frame->state & State_Enabled))
+ fdi.state = kThemeStateInactive;
+ else if (fdi.state == kThemeStatePressed)
+ // This pressed state doesn't make sense for a line edit frame.
+ // And Yosemite agrees with us. Otherwise it starts showing yellow pixels.
+ fdi.state = kThemeStateActive;
fdi.isFocused = (frame->state & State_HasFocus);
int lw = frame->lineWidth;
if (lw <= 0)
@@ -5134,7 +5132,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
[scroller initWithFrame:NSMakeRect(0, 0, slider->rect.width(), slider->rect.height())];
// mac os behaviour: as soon as one color channel is >= 128,
// the bg is considered bright, scroller is dark
- const QColor bgColor = opt->palette.color(QPalette::Base);
+ const QColor bgColor = QStyleHelper::backgroundColor(opt->palette, widget);
const bool isDarkBg = bgColor.red() < 128 && bgColor.green() < 128 &&
bgColor.blue() < 128;
if (isDarkBg)