Align sizes of prepare and preview menus

For some reason, the prepare menu is still one pixel too small. I think it's got to do with that one being a layout rather than a normal row.

Contributes to issue CURA-8202.
This commit is contained in:
Ghostkeeper 2021-07-07 10:27:53 +02:00
parent 92293e7008
commit 8e5485330f
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
2 changed files with 7 additions and 11 deletions

View file

@ -23,16 +23,14 @@ Item
{ {
left: parent.left left: parent.left
right: parent.right right: parent.right
leftMargin: UM.Theme.getSize("wide_margin").width leftMargin: UM.Theme.getSize("wide_margin").width * 2
rightMargin: UM.Theme.getSize("wide_margin").width rightMargin: UM.Theme.getSize("wide_margin").width * 2
} }
// Item to ensure that all of the buttons are nicely centered. // Item to ensure that all of the buttons are nicely centered.
Item Item
{ {
anchors.horizontalCenter: parent.horizontalCenter anchors.fill: parent
width: parent.width - 2 * UM.Theme.getSize("wide_margin").width
height: parent.height
RowLayout RowLayout
{ {

View file

@ -24,17 +24,15 @@ Item
{ {
left: parent.left left: parent.left
right: parent.right right: parent.right
leftMargin: UM.Theme.getSize("wide_margin").width leftMargin: UM.Theme.getSize("wide_margin").width * 2
rightMargin: UM.Theme.getSize("wide_margin").width rightMargin: UM.Theme.getSize("wide_margin").width * 2
} }
Row Row
{ {
id: stageMenuRow id: stageMenuRow
anchors.horizontalCenter: parent.horizontalCenter anchors.fill: parent
width: parent.width - 2 * UM.Theme.getSize("wide_margin").width
height: parent.height
// This is a trick to make sure that the borders of the two adjacent buttons' borders overlap. Otherwise // This is a trick to make sure that the borders of the two adjacent buttons' borders overlap. Otherwise
// there will be double border (one from each button) // there will be double border (one from each button)
spacing: -UM.Theme.getSize("default_lining").width spacing: -UM.Theme.getSize("default_lining").width
@ -52,7 +50,7 @@ Item
{ {
id: viewPanel id: viewPanel
height: parent.height height: parent.height
width: source != "" ? (previewMenu.width - viewsSelector.width - printSetupSelectorItem.width) : 0 width: source != "" ? (parent.width - viewsSelector.width - printSetupSelectorItem.width) : 0
source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : "" source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : ""
} }