|
21 | 21 | property bool isLE44 |
22 | 22 | property bool isLE46 |
23 | 23 |
|
| 24 | + property bool sidebarVisible: UM.Preferences.getValue("view/settings_visible") |
| 25 | + property real sidebarWidth: sidebarVisible ? printSetupSelector.width : 0 |
| 26 | + |
24 | 27 | Component.onCompleted: |
25 | 28 | { |
26 | 29 | is40 = (CuraSDKVersion == "6.0.0") |
|
69 | 72 | } |
70 | 73 | messageStack.anchors.horizontalCenter = undefined |
71 | 74 | messageStack.anchors.left = messageStack.parent.left |
72 | | - messageStack.anchors.leftMargin = Math.floor((base.width - printSetupSelector.width) / 2) |
| 75 | + messageStack.anchors.leftMargin = Math.floor((base.width - sidebarWidth) / 2) |
73 | 76 |
|
74 | 77 | // adjust stages menu position for sidebar |
75 | 78 | stagesListContainer = mainWindowHeader.children[1] // declared as property above |
76 | 79 | stagesListContainer.anchors.horizontalCenter = undefined |
77 | 80 | stagesListContainer.anchors.left = stagesListContainer.parent.left |
78 | | - stagesListContainer.anchors.leftMargin = Math.floor((base.width - printSetupSelector.width - stagesListContainer.width) / 2) |
| 81 | + stagesListContainer.anchors.leftMargin = Math.floor((base.width - sidebarWidth - stagesListContainer.width) / 2) |
79 | 82 |
|
80 | 83 | // compensate viewport for full-height sidebar |
81 | | - base.viewportRect = Qt.rect(0, 0, (base.width - printSetupSelector.width) / base.width, 1.0) |
| 84 | + base.viewportRect = Qt.rect(0, 0, (base.width - sidebarWidth) / base.width, 1.0) |
82 | 85 |
|
83 | 86 | // make settingview take up available height |
84 | 87 | var printSetupContent = printSetupSelector.contentItem |
@@ -127,13 +130,26 @@ Item |
127 | 130 | onWidthChanged: |
128 | 131 | { |
129 | 132 | // compensate viewport for full-height sidebar |
130 | | - base.viewportRect = Qt.rect(0, 0, (base.width - printSetupSelector.width) / base.width, 1.0) |
| 133 | + base.viewportRect = Qt.rect(0, 0, (base.width - sidebarWidth) / base.width, 1.0) |
131 | 134 |
|
132 | 135 | // adjust message stack position for sidebar |
133 | | - messageStack.anchors.leftMargin = Math.floor((base.width - printSetupSelector.width) / 2) |
| 136 | + messageStack.anchors.leftMargin = Math.floor((base.width - sidebarWidth) / 2) |
134 | 137 |
|
135 | 138 | // adjust stages menu position for sidebar |
136 | | - stagesListContainer.anchors.leftMargin = Math.floor((base.width - printSetupSelector.width - stagesListContainer.width) / 2) |
| 139 | + stagesListContainer.anchors.leftMargin = Math.floor((base.width - sidebarWidth - stagesListContainer.width) / 2) |
| 140 | + } |
| 141 | + } |
| 142 | + |
| 143 | + Connections |
| 144 | + { |
| 145 | + target: UM.Preferences |
| 146 | + onPreferenceChanged: |
| 147 | + { |
| 148 | + if (preference == "view/settings_visible") |
| 149 | + { |
| 150 | + sidebarVisible = UM.Preferences.getValue("view/settings_visible") |
| 151 | + base.onWidthChanged(base.width) |
| 152 | + } |
137 | 153 | } |
138 | 154 | } |
139 | 155 |
|
@@ -171,15 +187,30 @@ Item |
171 | 187 | y: Math.floor(UM.Theme.getSize("stage_menu").height / 2) |
172 | 188 | } |
173 | 189 |
|
| 190 | + PrintSetupSummary |
| 191 | + { |
| 192 | + id: printSetupSummary |
| 193 | + visible: !sidebarVisible |
| 194 | + |
| 195 | + width: printSetupSelector.width |
| 196 | + |
| 197 | + anchors |
| 198 | + { |
| 199 | + top: parent.top |
| 200 | + right: bottomRight.right |
| 201 | + } |
| 202 | + } |
| 203 | + |
174 | 204 | SidebarContents |
175 | 205 | { |
176 | 206 | id: printSetupSidebar |
| 207 | + visible: sidebarVisible |
177 | 208 |
|
178 | 209 | anchors |
179 | 210 | { |
180 | 211 | top: parent.top |
181 | 212 | bottom: actionRow.top |
182 | | - bottomMargin: UM.Theme.getSize("thin_margin").height |
| 213 | + bottomMargin: actionRow.height == 0 ? 0 : UM.Theme.getSize("thin_margin").height |
183 | 214 | right: bottomRight.right |
184 | 215 | } |
185 | 216 | } |
|
0 commit comments