mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 13:17:51 -06:00
Move View mode button and LayerView panel to top right
CURA-4212
This commit is contained in:
parent
b0916e4b67
commit
dd62367937
3 changed files with 36 additions and 38 deletions
|
@ -33,7 +33,7 @@ Item
|
|||
|
||||
UM.PointingRectangle {
|
||||
id: layerViewMenu
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
|
|
@ -319,24 +319,6 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: view_panel
|
||||
|
||||
property bool hugBottom: parent.height < viewModeButton.y + viewModeButton.height + height + UM.Theme.getSize("default_margin").height
|
||||
|
||||
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.left: viewModeButton.left;
|
||||
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;
|
||||
|
||||
source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : "";
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: openFileButton;
|
||||
|
@ -393,25 +375,6 @@ UM.MainWindow
|
|||
monitoringPrint: base.showPrintMonitor
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: viewModeButton
|
||||
|
||||
anchors
|
||||
{
|
||||
top: toolbar.bottom;
|
||||
topMargin: UM.Theme.getSize("window_margin").height;
|
||||
left: parent.left;
|
||||
}
|
||||
text: catalog.i18nc("@action:button","View Mode");
|
||||
iconSource: UM.Theme.getIcon("viewmode");
|
||||
|
||||
style: UM.Theme.styles.tool_button;
|
||||
tooltip: "";
|
||||
enabled: !PrintInformation.preSliced
|
||||
menu: ViewMenu { }
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: viewportOverlay
|
||||
|
|
|
@ -196,4 +196,39 @@ Rectangle
|
|||
|
||||
menu: PrinterMenu { }
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: viewModeButton
|
||||
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
text: catalog.i18nc("@action:button", "View Mode")
|
||||
iconSource: UM.Theme.getIcon("viewmode")
|
||||
|
||||
style: UM.Theme.styles.tool_button
|
||||
tooltip: "";
|
||||
enabled: !PrintInformation.preSliced
|
||||
menu: ViewMenu { }
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: view_panel
|
||||
|
||||
anchors.top: viewModeButton.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.right: viewModeButton.right
|
||||
|
||||
property var buttonTarget: Qt.point(viewModeButton.x + viewModeButton.width / 2, viewModeButton.y + viewModeButton.height / 2)
|
||||
|
||||
height: childrenRect.height;
|
||||
|
||||
source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue