From 1344f0d1b97689ea31b41c944f4ed3fcb9a72006 Mon Sep 17 00:00:00 2001 From: Jari Tenhunen Date: Mon, 18 Aug 2014 21:02:20 +0300 Subject: Mac Style: Fix QLineEdit frame in 10.10 Also removes some dead code. Backport of 83f06da1c6bffff61af78cbe75a0691d53742b53 from qt5/qtbase Change-Id: I7e088ca8b52bc3e2da25e29ab570469eab6f97bf Reviewed-by: Gabriel de Dietrich --- src/gui/styles/qmacstyle_mac.mm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 5f60649..65f3ba9 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3024,16 +3024,14 @@ 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 = 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 = 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) -- cgit v0.12