Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2019-01-31 19:13:32 +0300
committerJaime van Kessel <nallath@gmail.com>2019-01-31 19:13:32 +0300
commite6f722b29c66f46ed4d82ec9bb9cdaf8b5e60dfc (patch)
treeedf1995cc57af8004827dd98f5e3f0662374b7be /resources/qml/ActionPanel
parent1a037bdb829605609f3b47082aff7311bde95e12 (diff)
Move additional component loader into ActionPanelWidget
Diffstat (limited to 'resources/qml/ActionPanel')
-rw-r--r--resources/qml/ActionPanel/ActionPanelWidget.qml92
1 files changed, 66 insertions, 26 deletions
diff --git a/resources/qml/ActionPanel/ActionPanelWidget.qml b/resources/qml/ActionPanel/ActionPanelWidget.qml
index 1d9ee95548..1f68fe90ed 100644
--- a/resources/qml/ActionPanel/ActionPanelWidget.qml
+++ b/resources/qml/ActionPanel/ActionPanelWidget.qml
@@ -12,45 +12,85 @@ import Cura 1.0 as Cura
// This element hold all the elements needed for the user to trigger the slicing process, and later
// to get information about the printing times, material consumption and the output process (such as
// saving to a file, printing over network, ...
-Rectangle
+Item
{
- id: actionPanelWidget
+ id: base
+ width: childrenRect.width
+ height: childrenRect.height
- width: UM.Theme.getSize("action_panel_widget").width
- height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height
+ Rectangle
+ {
+ id: actionPanelWidget
+
+ width: UM.Theme.getSize("action_panel_widget").width
+ height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height
+ anchors. right: parent.right
+ color: UM.Theme.getColor("main_background")
+ border.width: UM.Theme.getSize("default_lining").width
+ border.color: UM.Theme.getColor("lining")
+ radius: UM.Theme.getSize("default_radius").width
+ z: 10
- color: UM.Theme.getColor("main_background")
- border.width: UM.Theme.getSize("default_lining").width
- border.color: UM.Theme.getColor("lining")
- radius: UM.Theme.getSize("default_radius").width
- z: 10
+ property bool outputAvailable: UM.Backend.state == UM.Backend.Done || UM.Backend.state == UM.Backend.Disabled
+
+ Loader
+ {
+ id: loader
+ anchors
+ {
+ top: parent.top
+ topMargin: UM.Theme.getSize("thick_margin").height
+ left: parent.left
+ leftMargin: UM.Theme.getSize("thick_margin").width
+ right: parent.right
+ rightMargin: UM.Theme.getSize("thick_margin").width
+ }
+ sourceComponent: actionPanelWidget.outputAvailable ? outputProcessWidget : sliceProcessWidget
+ }
+
+ Component
+ {
+ id: sliceProcessWidget
+ SliceProcessWidget { }
+ }
- property bool outputAvailable: UM.Backend.state == UM.Backend.Done || UM.Backend.state == UM.Backend.Disabled
+ Component
+ {
+ id: outputProcessWidget
+ OutputProcessWidget { }
+ }
+ }
- Loader
+ Item
{
- id: loader
- anchors
+ id: additionalComponents
+ width: childrenRect.width
+ anchors.right: actionPanelWidget.left
+ anchors.rightMargin: UM.Theme.getSize("default_margin").width
+ anchors.bottom: actionPanelWidget.bottom
+ anchors.bottomMargin: UM.Theme.getSize("thick_margin").height * 2
+ visible: actionPanelWidget.visible
+ Row
{
- top: parent.top
- topMargin: UM.Theme.getSize("thick_margin").height
- left: parent.left
- leftMargin: UM.Theme.getSize("thick_margin").width
- right: parent.right
- rightMargin: UM.Theme.getSize("thick_margin").width
+ id: additionalComponentsRow
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: UM.Theme.getSize("default_margin").width
}
- sourceComponent: outputAvailable ? outputProcessWidget : sliceProcessWidget
}
- Component
+ Component.onCompleted: base.addAdditionalComponents()
+
+ Connections
{
- id: sliceProcessWidget
- SliceProcessWidget { }
+ target: CuraApplication
+ onAdditionalComponentsChanged: base.addAdditionalComponents()
}
- Component
+ function addAdditionalComponents()
{
- id: outputProcessWidget
- OutputProcessWidget { }
+ for (var component in CuraApplication.additionalComponents["saveButton"])
+ {
+ CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow
+ }
}
} \ No newline at end of file