From b826a420265051cefd6483eb228e3716182b1380 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 21 Nov 2018 11:37:58 +0100 Subject: Add the RoundedRectangle as background to the ExpandableComponent This way the expandable components can have rounded corners only on one side, thus preventing the need to do add backgrounds to the rows that they are in. CURA-5785 --- plugins/PrepareStage/PrepareMenu.qml | 101 ++++++++++++++++------------------- 1 file changed, 45 insertions(+), 56 deletions(-) (limited to 'plugins/PrepareStage/PrepareMenu.qml') diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index ef01625a22..22f93aa5f2 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -24,77 +24,66 @@ Item Item { anchors.horizontalCenter: parent.horizontalCenter - width: openFileButtonBackground.width + itemRowBackground.width + width: openFileButtonBackground.width + itemRow.width + UM.Theme.getSize("default_margin").width height: parent.height - Rectangle + RowLayout { - id: itemRowBackground - radius: UM.Theme.getSize("default_radius").width + id: itemRow - color: UM.Theme.getColor("toolbar_background") + anchors.left: openFileButtonBackground.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width - width: itemRow.width + UM.Theme.getSize("default_margin").width + width: 0.9 * prepareMenu.width height: parent.height + spacing: 0 - anchors.left: openFileButtonBackground.right - anchors.leftMargin: UM.Theme.getSize("default_margin").width + Cura.MachineSelector + { + id: machineSelection + z: openFileButtonBackground.z - 1 //Ensure that the tooltip of the open file button stays above the item row. + headerCornerSide: 2 // Show corners on the left. + Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width + Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width + Layout.fillWidth: true + Layout.fillHeight: true + } - RowLayout + // Separator line + Rectangle { - id: itemRow + height: parent.height + width: UM.Theme.getSize("default_lining").width + color: UM.Theme.getColor("lining") + } - anchors.centerIn: parent + Cura.QuickConfigurationSelector + { + Layout.fillHeight: true + Layout.fillWidth: true + Layout.preferredWidth: itemRow.width - machineSelection.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width + } - width: 0.9 * prepareMenu.width + // Separator line + Rectangle + { height: parent.height - spacing: 0 - - Cura.MachineSelector - { - id: machineSelection - z: openFileButtonBackground.z - 1 //Ensure that the tooltip of the open file button stays above the item row. - Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width - Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width - Layout.fillWidth: true - Layout.fillHeight: true - } - - // Separator line - Rectangle - { - height: parent.height - width: UM.Theme.getSize("default_lining").width - color: UM.Theme.getColor("lining") - } - - Cura.QuickConfigurationSelector - { - Layout.fillHeight: true - Layout.fillWidth: true - Layout.preferredWidth: itemRow.width - machineSelection.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width - } - - // Separator line - Rectangle - { - height: parent.height - width: UM.Theme.getSize("default_lining").width - color: UM.Theme.getColor("lining") - } - - Item - { - id: printSetupSelectorItem - // This is a work around to prevent the printSetupSelector from having to be re-loaded every time - // a stage switch is done. - children: [printSetupSelector] - height: childrenRect.height - width: childrenRect.width - } + width: UM.Theme.getSize("default_lining").width + color: UM.Theme.getColor("lining") + } + + Item + { + id: printSetupSelectorItem + // This is a work around to prevent the printSetupSelector from having to be re-loaded every time + // a stage switch is done. + children: [printSetupSelector] + height: childrenRect.height + width: childrenRect.width } } + Rectangle { id: openFileButtonBackground -- cgit v1.2.3 From eef6ad662d816ac8266faaa391342accab36f07d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 21 Nov 2018 11:50:39 +0100 Subject: Added enum for the roundedCorner property This makes it a whole lot easier to read what is being set. CURA-5785 --- plugins/PrepareStage/PrepareMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/PrepareStage/PrepareMenu.qml') diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index 22f93aa5f2..bf2a0e1283 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -42,7 +42,7 @@ Item { id: machineSelection z: openFileButtonBackground.z - 1 //Ensure that the tooltip of the open file button stays above the item row. - headerCornerSide: 2 // Show corners on the left. + headerCornerSide: Cura.RoundedRectangle.Direction.Left Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width Layout.fillWidth: true -- cgit v1.2.3 From bd636e61a0577b8f5f7eac160fa0af05757240c6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 21 Nov 2018 13:17:36 +0100 Subject: Minor changes suggested in review CURA-5785 --- plugins/PrepareStage/PrepareMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/PrepareStage/PrepareMenu.qml') diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index bf2a0e1283..963908cea6 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -34,7 +34,7 @@ Item anchors.left: openFileButtonBackground.right anchors.leftMargin: UM.Theme.getSize("default_margin").width - width: 0.9 * prepareMenu.width + width: Math.round(0.9 * prepareMenu.width) height: parent.height spacing: 0 -- cgit v1.2.3