Mac Style: Fix QLineEdit frame in 10.10
Also removes some dead code. Change-Id: Id590bd56641918a163f8bad251e3e0e750adfc6f Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
50cf698b76
commit
83f06da1c6
@ -3186,17 +3186,15 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
|
|||||||
fdi.version = qt_mac_hitheme_version;
|
fdi.version = qt_mac_hitheme_version;
|
||||||
fdi.state = tds;
|
fdi.state = tds;
|
||||||
SInt32 frame_size;
|
SInt32 frame_size;
|
||||||
if (pe == PE_FrameLineEdit) {
|
fdi.kind = frame->features & QStyleOptionFrame::Rounded ? kHIThemeFrameTextFieldRound :
|
||||||
fdi.kind = frame->features & QStyleOptionFrame::Rounded ? kHIThemeFrameTextFieldRound :
|
kHIThemeFrameTextFieldSquare;
|
||||||
kHIThemeFrameTextFieldSquare;
|
GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
|
||||||
GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
|
if ((frame->state & State_ReadOnly) || !(frame->state & State_Enabled))
|
||||||
if ((frame->state & State_ReadOnly) || !(frame->state & State_Enabled))
|
fdi.state = kThemeStateInactive;
|
||||||
fdi.state = kThemeStateInactive;
|
else if (fdi.state == kThemeStatePressed)
|
||||||
} else {
|
// This pressed state doesn't make sense for a line edit frame.
|
||||||
baseColor = QColor(150, 150, 150); //hardcoded since no query function --Sam
|
// And Yosemite agrees with us. Otherwise it starts showing yellow pixels.
|
||||||
fdi.kind = kHIThemeFrameListBox;
|
fdi.state = kThemeStateActive;
|
||||||
GetThemeMetric(kThemeMetricListBoxFrameOutset, &frame_size);
|
|
||||||
}
|
|
||||||
fdi.isFocused = (frame->state & State_HasFocus);
|
fdi.isFocused = (frame->state & State_HasFocus);
|
||||||
int lw = frame->lineWidth;
|
int lw = frame->lineWidth;
|
||||||
if (lw <= 0)
|
if (lw <= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user