mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Use PointingRectangle for toolpanel flyouts
This commit is contained in:
parent
4d29fccb0b
commit
2fa29de4b9
3 changed files with 25 additions and 10 deletions
|
@ -13,7 +13,7 @@ Item {
|
|||
|
||||
width: buttons.width;
|
||||
height: buttons.height
|
||||
//property int activeY
|
||||
property int activeY
|
||||
|
||||
ColumnLayout {
|
||||
id: buttons;
|
||||
|
@ -43,22 +43,25 @@ Item {
|
|||
anchors.fill: parent;
|
||||
onClicked: {
|
||||
parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id);
|
||||
//base.activeY = parent.y
|
||||
base.activeY = parent.y
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: panelBackground;
|
||||
UM.PointingRectangle {
|
||||
id: panelBorder;
|
||||
|
||||
anchors.left: parent.right;
|
||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
||||
anchors.top: parent.top;
|
||||
//y: base.activeY
|
||||
anchors.top: base.top;
|
||||
anchors.topMargin: base.activeY
|
||||
z: buttons.z -1
|
||||
|
||||
target: Qt.point(parent.right, base.activeY + UM.Theme.sizes.button.height/2)
|
||||
arrowSize: UM.Theme.sizes.default_arrow.width
|
||||
|
||||
width: {
|
||||
if (panel.item && panel.width > 0){
|
||||
return Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width)
|
||||
|
@ -72,9 +75,20 @@ Item {
|
|||
opacity: panel.item ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
|
||||
color: UM.Theme.colors.tool_panel_background;
|
||||
border.width: UM.Theme.sizes.default_lining.width
|
||||
border.color: UM.Theme.colors.lining
|
||||
color: UM.Theme.colors.lining;
|
||||
//border.width: UM.Theme.sizes.default_lining.width
|
||||
//border.color: UM.Theme.colors.lining
|
||||
|
||||
UM.PointingRectangle {
|
||||
id: panelBackground;
|
||||
|
||||
color: UM.Theme.colors.tool_panel_background;
|
||||
anchors.fill: parent
|
||||
anchors.margins: UM.Theme.sizes.default_lining.width
|
||||
|
||||
target: Qt.point(-UM.Theme.sizes.default_margin.width, UM.Theme.sizes.button.height/2)
|
||||
arrowSize: parent.arrowSize
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: panel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue