From 2f965cc05338625cfbd4326d2bfb5978e9d3e3db Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Wed, 3 Jan 2018 14:18:40 +0100 Subject: [PATCH] CURA-4525 switch locations of build plates and objects list --- resources/qml/ObjectsList.qml | 128 +++++++++++++++++----------------- 1 file changed, 65 insertions(+), 63 deletions(-) diff --git a/resources/qml/ObjectsList.qml b/resources/qml/ObjectsList.qml index 761ff6d3f5..a924959581 100644 --- a/resources/qml/ObjectsList.qml +++ b/resources/qml/ObjectsList.qml @@ -62,6 +62,70 @@ Rectangle } } + Component { + id: buildPlateDelegate + Rectangle + { + height: childrenRect.height + color: Cura.BuildPlateModel.getItem(index).buildPlateNumber == Cura.BuildPlateModel.activeBuildPlate ? palette.highlight : index % 2 ? palette.base : palette.alternateBase + width: parent.width + Label + { + id: buildPlateNameLabel + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + width: parent.width - 2 * UM.Theme.getSize("default_margin").width - 30 + text: Cura.BuildPlateModel.getItem(index) ? Cura.BuildPlateModel.getItem(index).name : ""; + color: Cura.BuildPlateModel.activeBuildPlate == index ? palette.highlightedText : palette.text + elide: Text.ElideRight + } + + MouseArea + { + anchors.fill: parent; + onClicked: + { + Cura.BuildPlateModel.setActiveBuildPlate(index); + } + } + } + } + + ScrollView + { + id: buildPlateSelection + frameVisible: true + height: UM.Theme.getSize("build_plate_selection_size").height + width: parent.width - 2 * UM.Theme.getSize("default_margin").height + style: UM.Theme.styles.scrollview + + anchors + { + top: collapseButton.bottom; + topMargin: UM.Theme.getSize("default_margin").height; + left: parent.left; + leftMargin: UM.Theme.getSize("default_margin").height; + //bottom: objectsList.top; + bottomMargin: UM.Theme.getSize("default_margin").height; + } + + Rectangle + { + parent: viewport + anchors.fill: parent + color: palette.light + } + + ListView + { + id: buildPlateListView + model: Cura.BuildPlateModel + width: parent.width + delegate: buildPlateDelegate + } + } + + Component { id: objectDelegate Rectangle @@ -113,7 +177,7 @@ Rectangle anchors { - top: collapseButton.bottom; + top: buildPlateSelection.bottom; topMargin: UM.Theme.getSize("default_margin").height; left: parent.left; leftMargin: UM.Theme.getSize("default_margin").height; @@ -154,69 +218,7 @@ Rectangle topMargin: UM.Theme.getSize("default_margin").height; bottomMargin: UM.Theme.getSize("default_margin").height; leftMargin: UM.Theme.getSize("default_margin").height; - bottom: buildPlateSelection.top; - } - } - - Component { - id: buildPlateDelegate - Rectangle - { - height: childrenRect.height - color: Cura.BuildPlateModel.getItem(index).buildPlateNumber == Cura.BuildPlateModel.activeBuildPlate ? palette.highlight : index % 2 ? palette.base : palette.alternateBase - width: parent.width - Label - { - id: buildPlateNameLabel - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - width: parent.width - 2 * UM.Theme.getSize("default_margin").width - 30 - text: Cura.BuildPlateModel.getItem(index) ? Cura.BuildPlateModel.getItem(index).name : ""; - color: Cura.BuildPlateModel.activeBuildPlate == index ? palette.highlightedText : palette.text - elide: Text.ElideRight - } - - MouseArea - { - anchors.fill: parent; - onClicked: - { - Cura.BuildPlateModel.setActiveBuildPlate(index); - } - } - } - } - - ScrollView - { - id: buildPlateSelection - frameVisible: true - height: UM.Theme.getSize("build_plate_selection_size").height - width: parent.width - 2 * UM.Theme.getSize("default_margin").height - style: UM.Theme.styles.scrollview - - anchors - { - topMargin: UM.Theme.getSize("default_margin").height; - left: parent.left; - leftMargin: UM.Theme.getSize("default_margin").height; bottom: arrangeAllBuildPlatesButton.top; - bottomMargin: UM.Theme.getSize("default_margin").height; - } - - Rectangle - { - parent: viewport - anchors.fill: parent - color: palette.light - } - - ListView - { - id: buildPlateListView - model: Cura.BuildPlateModel - width: parent.width - delegate: buildPlateDelegate } }