summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qmacstyle_mac.mm
diff options
context:
space:
mode:
authorJari Tenhunen <jari.tenhunen@iki.fi>2014-08-18 18:02:20 (GMT)
committerJari Tenhunen <jari.tenhunen@iki.fi>2014-08-19 13:25:43 (GMT)
commit1344f0d1b97689ea31b41c944f4ed3fcb9a72006 (patch)
tree15b3ddfb8eaffc5ec528d4c8b459693baeb51e1e /src/gui/styles/qmacstyle_mac.mm
parentc830cfab4f9b264c26c0111fe923562b82f72fed (diff)
downloadQt-1344f0d1b97689ea31b41c944f4ed3fcb9a72006.zip
Qt-1344f0d1b97689ea31b41c944f4ed3fcb9a72006.tar.gz
Qt-1344f0d1b97689ea31b41c944f4ed3fcb9a72006.tar.bz2
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 <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/gui/styles/qmacstyle_mac.mm')
-rw-r--r--src/gui/styles/qmacstyle_mac.mm18
1 files 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)