Skip to content

Commit b2dfd98

Browse files
committed
Fix macos window layout
1 parent 9062dfa commit b2dfd98

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/libs/3rdparty/svscraft

src/libs/application/uishell/src/qml/HomeWindow.qml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Window {
3030

3131
readonly property CommandPalette commandPalette: commandPalettePopup
3232
readonly property InputPalette inputPalette: inputPalettePopup
33+
readonly property double popupTopMarginHint: (titleBarArea.visible ? titleBarArea.height : 8)
3334

3435
readonly property InvisibleCentralWidget invisibleCentralWidget: InvisibleCentralWidget {
3536
visible: window.visible
@@ -81,15 +82,15 @@ Window {
8182
property double horizontalOffset: 0
8283
property double verticalOffset: 0
8384
x: (window.width - implicitWidth) / 2 + horizontalOffset
84-
y: titleBarArea.height + verticalOffset
85+
y: popupTopMarginHint + verticalOffset
8586
emptyText: qsTr("Empty")
8687
}
8788
InputPalette {
8889
id: inputPalettePopup
8990
property double horizontalOffset: 0
9091
property double verticalOffset: 0
9192
x: (window.width - implicitWidth) / 2 + horizontalOffset
92-
y: titleBarArea.height + verticalOffset
93+
y: popupTopMarginHint + verticalOffset
9394
}
9495

9596

@@ -127,6 +128,7 @@ Window {
127128
}
128129
MenuBar {
129130
id: menuBar
131+
parent: window.isMacOS ? window.contentItem : titleBarArea
130132
anchors.left: parent.left
131133
anchors.top: parent.top
132134
anchors.topMargin: activeFocus || menus.some(menu => menu.visible) || children.some(item => item.activeFocus) ? 0 : -height
@@ -320,8 +322,7 @@ Window {
320322
anchors.fill: parent
321323
Item {
322324
Layout.fillWidth: true
323-
height: titleBarArea.height - recentFilesLayout.spacing
324-
visible: titleBarArea.visible
325+
implicitHeight: titleBarArea.visible ? titleBarArea.height - recentFilesLayout.spacing : 0
325326
}
326327
StackLayout {
327328
id: recentFilesStack

src/libs/application/uishell/src/qml/ProjectWindow.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Window {
4040
readonly property DockingView bottomDockingView: bottomDock
4141
readonly property CommandPalette commandPalette: commandPalettePopup
4242
readonly property InputPalette inputPalette: inputPalettePopup
43-
readonly property double popupTopMarginHint: titleBar.height + toolBar.height + 4
43+
readonly property double popupTopMarginHint: mainPane.y + 2
4444

4545
property bool notificationEnablesAnimation: false
4646

@@ -89,15 +89,15 @@ Window {
8989
property double horizontalOffset: 0
9090
property double verticalOffset: 0
9191
x: (window.width - implicitWidth) / 2 + horizontalOffset
92-
y: titleBar.height + toolBar.height + 4 + verticalOffset
92+
y: popupTopMarginHint + verticalOffset
9393
emptyText: qsTr("Empty")
9494
}
9595
InputPalette {
9696
id: inputPalettePopup
9797
property double horizontalOffset: 0
9898
property double verticalOffset: 0
9999
x: (window.width - implicitWidth) / 2 + horizontalOffset
100-
y: titleBar.height + toolBar.height + 4 + verticalOffset
100+
y: popupTopMarginHint + verticalOffset
101101
}
102102
Rectangle {
103103
anchors.fill: parent

0 commit comments

Comments
 (0)