mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:38:58 +08:00
Use PointingRectangle for toolpanel flyouts
This commit is contained in:
parent
4d29fccb0b
commit
2fa29de4b9
@ -13,7 +13,7 @@ Item {
|
|||||||
|
|
||||||
width: buttons.width;
|
width: buttons.width;
|
||||||
height: buttons.height
|
height: buttons.height
|
||||||
//property int activeY
|
property int activeY
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: buttons;
|
id: buttons;
|
||||||
@ -43,22 +43,25 @@ Item {
|
|||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id);
|
parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id);
|
||||||
//base.activeY = parent.y
|
base.activeY = parent.y
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
UM.PointingRectangle {
|
||||||
id: panelBackground;
|
id: panelBorder;
|
||||||
|
|
||||||
anchors.left: parent.right;
|
anchors.left: parent.right;
|
||||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
||||||
anchors.top: parent.top;
|
anchors.top: base.top;
|
||||||
//y: base.activeY
|
anchors.topMargin: base.activeY
|
||||||
z: buttons.z -1
|
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: {
|
width: {
|
||||||
if (panel.item && panel.width > 0){
|
if (panel.item && panel.width > 0){
|
||||||
return Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width)
|
return Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width)
|
||||||
@ -72,9 +75,20 @@ Item {
|
|||||||
opacity: panel.item ? 1 : 0
|
opacity: panel.item ? 1 : 0
|
||||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||||
|
|
||||||
|
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;
|
color: UM.Theme.colors.tool_panel_background;
|
||||||
border.width: UM.Theme.sizes.default_lining.width
|
anchors.fill: parent
|
||||||
border.color: UM.Theme.colors.lining
|
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 {
|
Loader {
|
||||||
id: panel
|
id: panel
|
||||||
|
@ -165,6 +165,7 @@
|
|||||||
"window_margin": [1.0, 1.0],
|
"window_margin": [1.0, 1.0],
|
||||||
"default_margin": [1.0, 1.0],
|
"default_margin": [1.0, 1.0],
|
||||||
"default_lining": [0.08, 0.08],
|
"default_lining": [0.08, 0.08],
|
||||||
|
"default_arrow": [0.8, 0.8],
|
||||||
"logo": [9.5, 2.0],
|
"logo": [9.5, 2.0],
|
||||||
|
|
||||||
"sidebar": [30.0, 10.0],
|
"sidebar": [30.0, 10.0],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user