mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
Add a reusable mechanism for plugins to add controls to designated areas in the GUI
contributes to CURA-271
This commit is contained in:
parent
ac4b6c092f
commit
336dd406b1
2 changed files with 44 additions and 4 deletions
|
@ -84,6 +84,27 @@ Rectangle {
|
|||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.left: parent.left
|
||||
|
||||
Row {
|
||||
id: additionalComponentsRow
|
||||
anchors.top: parent.top
|
||||
anchors.right: saveToButton.visible ? saveToButton.left : parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Printer
|
||||
onAdditionalComponentsChanged:
|
||||
{
|
||||
if(areaId == "saveButton") {
|
||||
for (var component in Printer.additionalComponents["saveButton"]) {
|
||||
Printer.additionalComponents["saveButton"][component].parent = additionalComponentsRow
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: saveToButton
|
||||
|
||||
|
@ -102,8 +123,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
style: ButtonStyle {
|
||||
background:
|
||||
Rectangle
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
||||
|
@ -126,7 +146,7 @@ Rectangle {
|
|||
text: control.text;
|
||||
}
|
||||
}
|
||||
label: Item { }
|
||||
label: Item { }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue