Move View mode button and LayerView panel to top right

CURA-4212
This commit is contained in:
Lipu Fei 2017-09-07 15:32:19 +02:00
parent b0916e4b67
commit dd62367937
3 changed files with 36 additions and 38 deletions

View file

@ -33,7 +33,7 @@ Item
UM.PointingRectangle { UM.PointingRectangle {
id: layerViewMenu id: layerViewMenu
anchors.left: parent.left anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
width: parent.width width: parent.width
height: parent.height height: parent.height

View file

@ -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 Button
{ {
id: openFileButton; id: openFileButton;
@ -393,25 +375,6 @@ UM.MainWindow
monitoringPrint: base.showPrintMonitor 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 Rectangle
{ {
id: viewportOverlay id: viewportOverlay

View file

@ -196,4 +196,39 @@ Rectangle
menu: PrinterMenu { } 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 : "";
}
} }