mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Add sidebar_collapse to the saved preferences, typos, move back machine selection to the top bar
CURA-4234
This commit is contained in:
parent
00529f37d9
commit
6968c089db
5 changed files with 72 additions and 73 deletions
|
@ -384,6 +384,8 @@ class CuraApplication(QtApplication):
|
|||
|
||||
self._plugin_registry.addSupportedPluginExtension("curaplugin", "Cura Plugin")
|
||||
|
||||
preferences.addPreference("general/sidebar_collapse", False)
|
||||
|
||||
def _onEngineCreated(self):
|
||||
self._engine.addImageProvider("camera", CameraImageProvider.CameraImageProvider())
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@ Item
|
|||
Action
|
||||
{
|
||||
id: expandSidebarAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:view","Expand/Collapse sidebar");
|
||||
text: catalog.i18nc("@action:inmenu menubar:view","Expand/Collapse Sidebar");
|
||||
shortcut: "Ctrl+E";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -401,12 +401,12 @@ UM.MainWindow
|
|||
collapsSidebarAnimation.start();
|
||||
}
|
||||
collapsed = !collapsed;
|
||||
UM.Preferences.setValue("general/sidebar_collaps", collapsed);
|
||||
UM.Preferences.setValue("general/sidebar_collapse", collapsed);
|
||||
}
|
||||
|
||||
anchors
|
||||
{
|
||||
top: topbar.top
|
||||
top: topbar.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
|
@ -419,7 +419,7 @@ UM.MainWindow
|
|||
target: sidebar
|
||||
properties: "x"
|
||||
to: base.width
|
||||
duration: 500
|
||||
duration: 100
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
|
@ -427,12 +427,12 @@ UM.MainWindow
|
|||
target: sidebar
|
||||
properties: "x"
|
||||
to: base.width - sidebar.width
|
||||
duration: 500
|
||||
duration: 100
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
var sidebarCollaps = UM.Preferences.getValue("general/sidebar_collaps")
|
||||
var sidebarCollaps = UM.Preferences.getValue("general/sidebar_collapse")
|
||||
|
||||
if (sidebarCollaps == true){
|
||||
sidebar.collapsed = true;
|
||||
|
|
|
@ -87,77 +87,10 @@ Rectangle
|
|||
}
|
||||
}
|
||||
|
||||
ToolButton
|
||||
{
|
||||
id: machineSelection
|
||||
text: Cura.MachineManager.activeMachineName
|
||||
|
||||
width: base.width
|
||||
height: UM.Theme.getSize("sidebar_header").height
|
||||
tooltip: Cura.MachineManager.activeMachineName
|
||||
|
||||
anchors.top: base.top
|
||||
//anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
color:
|
||||
{
|
||||
if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("sidebar_header_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("sidebar_header_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("sidebar_header_bar");
|
||||
}
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: downArrow
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: UM.Theme.getColor("text_emphasis")
|
||||
source: UM.Theme.getIcon("arrow_bottom")
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: sidebarComboBoxLabel
|
||||
color: UM.Theme.getColor("sidebar_header_text_active")
|
||||
text: control.text;
|
||||
elide: Text.ElideRight;
|
||||
anchors.left: parent.left;
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
|
||||
anchors.right: downArrow.left;
|
||||
anchors.rightMargin: control.rightMargin;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
font: UM.Theme.getFont("large")
|
||||
}
|
||||
}
|
||||
label: Label {}
|
||||
}
|
||||
|
||||
menu: PrinterMenu { }
|
||||
}
|
||||
|
||||
SidebarHeader {
|
||||
id: header
|
||||
width: parent.width
|
||||
visible: machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants
|
||||
anchors.top: machineSelection.bottom
|
||||
|
||||
onShowTooltip: base.showTooltip(item, location, text)
|
||||
onHideTooltip: base.hideTooltip()
|
||||
|
|
|
@ -76,6 +76,70 @@ Rectangle
|
|||
ExclusiveGroup { id: topbarMenuGroup }
|
||||
}
|
||||
|
||||
ToolButton
|
||||
{
|
||||
id: machineSelection
|
||||
text: Cura.MachineManager.activeMachineName
|
||||
|
||||
width: UM.Theme.getSize("sidebar").width
|
||||
height: UM.Theme.getSize("sidebar_header").height
|
||||
tooltip: Cura.MachineManager.activeMachineName
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
color:
|
||||
{
|
||||
if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("sidebar_header_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("sidebar_header_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("sidebar_header_bar");
|
||||
}
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: downArrow
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: UM.Theme.getColor("text_emphasis")
|
||||
source: UM.Theme.getIcon("arrow_bottom")
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: sidebarComboBoxLabel
|
||||
color: UM.Theme.getColor("sidebar_header_text_active")
|
||||
text: control.text;
|
||||
elide: Text.ElideRight;
|
||||
anchors.left: parent.left;
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
|
||||
anchors.right: downArrow.left;
|
||||
anchors.rightMargin: control.rightMargin;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
font: UM.Theme.getFont("large")
|
||||
}
|
||||
}
|
||||
label: Label {}
|
||||
}
|
||||
|
||||
menu: PrinterMenu { }
|
||||
}
|
||||
|
||||
// View orientation Item
|
||||
Row
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue