mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 06:15:54 +08:00
Use a PointingRectangle for the LayerView pane
This commit is contained in:
parent
29e152582f
commit
48efcdf6e4
@ -11,6 +11,7 @@ import Cura 1.0 as Cura
|
|||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
id: base
|
||||||
width: {
|
width: {
|
||||||
if (UM.LayerView.compatibilityMode) {
|
if (UM.LayerView.compatibilityMode) {
|
||||||
return UM.Theme.getSize("layerview_menu_size_compatibility").width;
|
return UM.Theme.getSize("layerview_menu_size_compatibility").width;
|
||||||
@ -25,8 +26,12 @@ Item
|
|||||||
return UM.Theme.getSize("layerview_menu_size").height + UM.LayerView.extruderCount * (UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("layerview_row_spacing").height)
|
return UM.Theme.getSize("layerview_menu_size").height + UM.LayerView.extruderCount * (UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("layerview_row_spacing").height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
property var buttonTarget: {
|
||||||
|
var force_binding = parent.y; // ensure this gets reevaluated when the panel moves
|
||||||
|
return base.mapFromItem(parent.parent, parent.buttonTarget.x, parent.buttonTarget.y);
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
UM.PointingRectangle {
|
||||||
id: layerViewMenu
|
id: layerViewMenu
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@ -35,6 +40,9 @@ Item
|
|||||||
z: slider.z - 1
|
z: slider.z - 1
|
||||||
color: UM.Theme.getColor("tool_panel_background")
|
color: UM.Theme.getColor("tool_panel_background")
|
||||||
|
|
||||||
|
target: parent.buttonTarget
|
||||||
|
arrowSize: UM.Theme.getSize("default_arrow").width
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: view_settings
|
id: view_settings
|
||||||
|
|
||||||
|
@ -308,11 +308,13 @@ UM.MainWindow
|
|||||||
|
|
||||||
property bool hugBottom: parent.height < viewModeButton.y + viewModeButton.height + height + UM.Theme.getSize("default_margin").height
|
property bool hugBottom: parent.height < viewModeButton.y + viewModeButton.height + height + UM.Theme.getSize("default_margin").height
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom // panel is always anchored to the bottom only, because dynamically switching between bottom and top results in stretching the height
|
||||||
anchors.bottomMargin: hugBottom ? 0 : parent.height - (viewModeButton.y + viewModeButton.height + height + UM.Theme.getSize("default_margin").height)
|
anchors.bottomMargin: hugBottom ? 0 : parent.height - (viewModeButton.y + viewModeButton.height + height + UM.Theme.getSize("default_margin").height)
|
||||||
anchors.left: viewModeButton.left;
|
anchors.left: viewModeButton.left;
|
||||||
anchors.leftMargin: hugBottom ? viewModeButton.width + UM.Theme.getSize("default_margin").width : 0
|
anchors.leftMargin: hugBottom ? viewModeButton.width + UM.Theme.getSize("default_margin").width : 0
|
||||||
|
|
||||||
|
property var buttonTarget: Qt.point(viewModeButton.x + viewModeButton.width / 2, viewModeButton.y + viewModeButton.height / 2)
|
||||||
|
|
||||||
height: childrenRect.height;
|
height: childrenRect.height;
|
||||||
|
|
||||||
source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : "";
|
source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user