Skip to content

Commit 3b8539e

Browse files
committed
Hide application logo if there is no room for it
1 parent a1e96e1 commit 3b8539e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

resources/qml/SidebarStageMenu.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Item
1616

1717
property var messageStack
1818
property var stagesListContainer
19+
property var applicationLogo
1920

2021
property bool is40
2122
property bool isLE44
@@ -83,6 +84,10 @@ Item
8384
stagesListContainer.anchors.left = stagesListContainer.parent.left
8485
stagesListContainer.anchors.leftMargin = Math.floor((base.width - printSetupSelector.width - stagesListContainer.width) / 2)
8586

87+
// hide application logo if there is no room for it
88+
applicationLogo = mainWindowHeader.children[0] // declared as property above
89+
applicationLogo.visible = stagesListContainer.anchors.leftMargin > applicationLogo.width + 2 * UM.Theme.getSize("default_margin").width
90+
8691
// compensate viewport for full-height sidebar
8792
base.viewportRect = Qt.rect(0, 0, (base.width - sidebarWidth) / base.width, 1.0)
8893

@@ -140,6 +145,9 @@ Item
140145

141146
// adjust stages menu position for sidebar
142147
stagesListContainer.anchors.leftMargin = Math.floor((base.width - printSetupSelector.width - stagesListContainer.width) / 2)
148+
149+
// hide application logo if there is no room for it
150+
applicationLogo.visible = stagesListContainer.anchors.leftMargin > applicationLogo.width + 2 * UM.Theme.getSize("default_margin").width
143151
}
144152
}
145153

0 commit comments

Comments
 (0)