Add feature to enable rounded line edit on mac
This will not currently be exposed in the widget API but we can make use of it for qt quick components. Change-Id: I08300a3bcd58e68df633fe9b36a988eb6176ef9c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
e9b6eb7795
commit
48f3128a7d
|
|
@ -3118,7 +3118,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
|
|||
fdi.state = tds;
|
||||
SInt32 frame_size;
|
||||
if (pe == PE_FrameLineEdit) {
|
||||
fdi.kind = kHIThemeFrameTextFieldSquare;
|
||||
fdi.kind = frame->features & QStyleOptionFrame::Rounded ? kHIThemeFrameTextFieldRound :
|
||||
kHIThemeFrameTextFieldSquare;
|
||||
GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
|
||||
if ((frame->state & State_ReadOnly) || !(frame->state & State_Enabled))
|
||||
fdi.state = kThemeStateInactive;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,8 @@ public:
|
|||
int midLineWidth;
|
||||
enum FrameFeature {
|
||||
None = 0x00,
|
||||
Flat = 0x01
|
||||
Flat = 0x01,
|
||||
Rounded = 0x02
|
||||
};
|
||||
Q_DECLARE_FLAGS(FrameFeatures, FrameFeature)
|
||||
FrameFeatures features;
|
||||
|
|
|
|||
|
|
@ -120,8 +120,7 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
|
|||
if (hasEditFocus())
|
||||
option->state |= QStyle::State_HasEditFocus;
|
||||
#endif
|
||||
if (QStyleOptionFrameV2 *optionV2 = qstyleoption_cast<QStyleOptionFrameV2 *>(option))
|
||||
optionV2->features = QStyleOptionFrameV2::None;
|
||||
option->features = QStyleOptionFrame::None;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
Loading…
Reference in New Issue