diff options
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 9 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 2 |
6 files changed, 15 insertions, 4 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 1e5830d216..f4a53c9dfe 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1350,6 +1350,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, QRect ir = btn->rect; QStyleOptionButton newBtn = *btn; newBtn.rect = QRect(ir.right() - mbi + 2, ir.height()/2 - mbi/2 + 3, mbi - 6, mbi - 6); + newBtn.rect = visualRect(btn->direction, br, newBtn.rect); proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); } } @@ -1378,7 +1379,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, int iconSpacing = 4;//### 4 is currently hardcoded in QPushButton::sizeHint() if (!button->text.isEmpty()) { int textWidth = button->fontMetrics.boundingRect(opt->rect, tf, button->text).width(); - labelWidth += (textWidth + iconSpacing); + labelWidth += (textWidth + iconSpacing * 2); } QRect iconRect = QRect(textRect.x() + (textRect.width() - labelWidth) / 2, @@ -2465,6 +2466,12 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = visualRect(opt->direction, opt->rect, r); } break; + case SE_PushButtonBevel: + { + r = opt->rect; + r = visualRect(opt->direction, opt->rect, r); + } + break; case SE_CheckBoxIndicator: { int h = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget); diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index c4bc52aa87..2b59e5736b 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -2416,7 +2416,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption QStyle::State oldState = static_cast<QStyle::State>(qvariant_cast<QStyle::State::Int>(styleObject->property("_q_stylestate"))); uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt(); - // a scrollbar is transient when the the scrollbar itself and + // a scrollbar is transient when the scrollbar itself and // its sibling are both inactive (ie. not pressed/hovered/moved) bool transient = !option->activeSubControls && !(option->state & State_On); diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 1110cc3323..4ac0a11a36 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1011,6 +1011,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SE_PushButtonFocusRect Area for the focus rect (usually larger than the contents rect). \value SE_PushButtonLayoutItem Area that counts for the parent layout. + \value SE_PushButtonBevel Area used for the bevel of the button. \value SE_CheckBoxIndicator Area for the state indicator (e.g., check mark). \value SE_CheckBoxContents Area for the label (text or pixmap). @@ -1119,6 +1120,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \header \li Sub Element \li QStyleOption Subclass \row \li \l SE_PushButtonContents \li \l QStyleOptionButton \row \li \l SE_PushButtonFocusRect \li \l QStyleOptionButton + \row \li \l SE_PushButtonBevel \li \l QStyleOptionButton \row \li \l SE_CheckBoxIndicator \li \l QStyleOptionButton \row \li \l SE_CheckBoxContents \li \l QStyleOptionButton \row \li \l SE_CheckBoxFocusRect \li \l QStyleOptionButton diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index b51bcbe8d6..f37604e0fa 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -355,6 +355,8 @@ public: SE_TabBarScrollRightButton, SE_TabBarTearIndicatorRight, + SE_PushButtonBevel, + // do not add any values below/greater than this SE_CustomBase = 0xf0000000 }; diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 5a2ca2f2e7..bf365585d4 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -1646,7 +1646,7 @@ QStyleOptionProgressBar::QStyleOptionProgressBar(int version) the default orentation is Qt::Horizontal \deprecated - Use the QStyle::State_Horizontal flag instead (in the the QStyleOption::state member). + Use the QStyle::State_Horizontal flag instead (in the QStyleOption::state member). \sa QProgressBar::orientation */ diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 105eba370a..8eb24d7557 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -2136,7 +2136,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp #if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { - QBrush editBrush = cmb->palette.brush(QPalette::Base); + QBrush editBrush = cmb->palette.brush(QPalette::Button); if ((cmb->subControls & SC_ComboBoxFrame)) { if (cmb->frame) { QPalette shadePal = opt->palette; |