Make the stage menu in the preview using 85 percent of the total width in order to prevent the print setup panel to be in the middle

This commit is contained in:
Diego Prado Gesto 2018-12-11 15:19:40 +01:00
parent 742fc34e75
commit c804610fa6
3 changed files with 54 additions and 43 deletions

View File

@ -2,6 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.3 as UM import UM 1.3 as UM
@ -19,19 +20,28 @@ Item
name: "cura" name: "cura"
} }
// Item to ensure that all of the buttons are nicely centered.
Item
{
anchors.horizontalCenter: parent.horizontalCenter
width: stageMenuRow.width
height: parent.height
Row RowLayout
{ {
id: stageMenuRow id: stageMenuRow
anchors.centerIn: parent width: Math.round(0.85 * previewMenu.width)
height: parent.height height: parent.height
spacing: 0
Cura.ViewsSelector Cura.ViewsSelector
{ {
id: viewsSelector id: viewsSelector
height: parent.height
width: UM.Theme.getSize("views_selector").width
headerCornerSide: Cura.RoundedRectangle.Direction.Left headerCornerSide: Cura.RoundedRectangle.Direction.Left
Layout.minimumWidth: UM.Theme.getSize("views_selector").width
Layout.maximumWidth: UM.Theme.getSize("views_selector").width
Layout.fillWidth: true
Layout.fillHeight: true
} }
// Separator line // Separator line
@ -40,7 +50,7 @@ Item
height: parent.height height: parent.height
// If there is no viewPanel, we only need a single spacer, so hide this one. // If there is no viewPanel, we only need a single spacer, so hide this one.
visible: viewPanel.source != "" visible: viewPanel.source != ""
width: visible ? UM.Theme.getSize("default_lining").width : 0 width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("lining") color: UM.Theme.getColor("lining")
} }
@ -48,8 +58,9 @@ Item
Loader Loader
{ {
id: viewPanel id: viewPanel
height: parent.height Layout.fillHeight: true
width: childrenRect.width Layout.fillWidth: true
Layout.preferredWidth: stageMenuRow.width - viewsSelector.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width
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 : ""
} }
@ -71,4 +82,5 @@ Item
width: childrenRect.width width: childrenRect.width
} }
} }
}
} }

View File

@ -15,7 +15,6 @@ Cura.ExpandableComponent
{ {
id: base id: base
width: UM.Theme.getSize("layerview_menu_size").width
contentHeaderTitle: catalog.i18nc("@label", "Color scheme") contentHeaderTitle: catalog.i18nc("@label", "Color scheme")
Connections Connections

View File

@ -380,7 +380,7 @@
"machine_selector_widget_content": [25.0, 32.0], "machine_selector_widget_content": [25.0, 32.0],
"machine_selector_icon": [2.66, 2.66], "machine_selector_icon": [2.66, 2.66],
"views_selector": [16.0, 4.5], "views_selector": [23.0, 4.0],
"printer_type_label": [3.5, 1.5], "printer_type_label": [3.5, 1.5],
@ -450,7 +450,7 @@
"slider_handle": [1.5, 1.5], "slider_handle": [1.5, 1.5],
"slider_layerview_size": [1.0, 26.0], "slider_layerview_size": [1.0, 26.0],
"layerview_menu_size": [15, 20], "layerview_menu_size": [16.0, 4.0],
"layerview_legend_size": [1.0, 1.0], "layerview_legend_size": [1.0, 1.0],
"layerview_row": [11.0, 1.5], "layerview_row": [11.0, 1.5],
"layerview_row_spacing": [0.0, 0.5], "layerview_row_spacing": [0.0, 0.5],