QWindows11Style: Reduce textedit padding and align combobox texts
Horizontal padding for textedit controls is reduced from 8px to 4px. To align the QComboBox label with the list flyout, the combobox label got additional 4px padding. Fixes: QTBUG-130125 Change-Id: Ieb4a8c9dab7fbe594134261b738060acfe7fdcb5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit c8fa7408a0c15054a6a50c28c0c21845134a4a13) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
fae0899efe
commit
197c3e61fe
@ -1124,6 +1124,13 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
switch (element) {
|
||||
case QStyle::CE_ComboBoxLabel:
|
||||
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
|
||||
QStyleOptionComboBox newOption = *cb;
|
||||
newOption.rect.adjust(4,0,-4,0);
|
||||
QCommonStyle::drawControl(element, &newOption, painter,widget);
|
||||
}
|
||||
break;
|
||||
case QStyle::CE_TabBarTabShape:
|
||||
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) {
|
||||
QRectF tabRect = tab->rect.marginsRemoved(QMargins(2,2,0,0));
|
||||
@ -1781,7 +1788,7 @@ QRect QWindows11Style::subElementRect(QStyle::SubElement element, const QStyleOp
|
||||
QRect ret;
|
||||
switch (element) {
|
||||
case QStyle::SE_LineEditContents:
|
||||
ret = option->rect.adjusted(8,0,-8,0);
|
||||
ret = option->rect.adjusted(4,0,-4,0);
|
||||
break;
|
||||
case QStyle::SE_ItemViewItemText:
|
||||
if (const auto *item = qstyleoption_cast<const QStyleOptionViewItem *>(option)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user