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.

Task-number: QTBUG-130673
Change-Id: I5f9023820a4e4b4288017869ac4088fe2669ce50
Reviewed-by: Wladimir Leuschner <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
(cherry picked from commit 6e29a94)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 1319dcf)
  • Loading branch information
chehrlic authored and Qt Cherry-pick Bot committed Dec 20, 2024
1 parent 7e2b84b commit 7ce5b4f
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 @@ -1921,8 +1921,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 7ce5b4f

Please sign in to comment.