forked from qt-creator/qt-creator
Fixes: Fix a styling issue with toolbuttons
Details: This ensures that the manhattan button arrow does not depend on the menubutton indicator size, which it should not.
This commit is contained in:
@@ -894,11 +894,12 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
||||
tool.rect = tool.rect.adjusted(2, 2, -2, -2);
|
||||
drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
|
||||
} else if (toolbutton->features & QStyleOptionToolButton::HasMenu) {
|
||||
int mbi = pixelMetric(PM_MenuButtonIndicator, toolbutton, widget);
|
||||
int arrowSize = 6;
|
||||
QRect ir = toolbutton->rect.adjusted(1, 1, -1, -1);
|
||||
QStyleOptionToolButton newBtn = *toolbutton;
|
||||
newBtn.palette = panelPalette(option->palette);
|
||||
newBtn.rect = QRect(ir.right() + 5 - mbi, ir.height() - mbi + 4, mbi - 6, mbi - 6);
|
||||
newBtn.rect = QRect(ir.right() - arrowSize - 1,
|
||||
ir.height() - arrowSize - 2, arrowSize, arrowSize);
|
||||
QWindowsStyle::drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user