Skip to content

Commit

Permalink
QWindows11Style: Adjust position of MDI subwindow icon
Browse files Browse the repository at this point in the history
The y position for the MDI subwindow icon was not calculated correctly
so the icon was not painted vertically centered.

Pick-to: 6.9 6.8
Task-number: QTBUG-130673
Change-Id: I5f9023820a4e4b4288017869ac4088fe2669ce50
Reviewed-by: Wladimir Leuschner <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
chehrlic committed Dec 20, 2024
1 parent 2c85e5d commit 6e29a94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/styles/modernwindows/qwindows11style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1935,8 +1935,9 @@ QRect QWindows11Style::subControlRect(ComplexControl control, const QStyleOption
break;
case SC_TitleBarSysMenu:
if (titlebar->titleBarFlags & Qt::WindowSystemMenuHint) {
ret.setRect(titlebar->rect.left() + controlWidthMargin + indent, titlebar->rect.top() + iconSize/2,
iconSize, iconSize);
const auto yOfs = titlebar->rect.top() + (titlebar->rect.height() - iconSize) / 2;
ret.setRect(titlebar->rect.left() + controlWidthMargin + indent, yOfs, iconSize,
iconSize);
}
break;
default:
Expand Down

0 comments on commit 6e29a94

Please sign in to comment.