mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 19:25:58 +08:00
Tweak 2.4 sidebar changes
* Make extruder-tabs more clear on badly calibrated displays * Make infill selection same width as other "Recommended" controls * Move printer selection to the top bar * Add animation to support extruder selection combobox
This commit is contained in:
parent
7694b8f128
commit
e642b4ebe9
@ -8,6 +8,7 @@ import QtQuick.Layouts 1.1
|
|||||||
|
|
||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
import "Menus"
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
@ -85,12 +86,60 @@ Rectangle
|
|||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width;
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
ToolButton
|
||||||
|
{
|
||||||
|
id: machineSelection
|
||||||
|
text: Cura.MachineManager.activeMachineName
|
||||||
|
|
||||||
|
height: UM.Theme.getSize("setting_control").height
|
||||||
|
tooltip: Cura.MachineManager.activeMachineName
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
style: ButtonStyle {
|
||||||
|
background: Rectangle {
|
||||||
|
color: UM.Theme.getColor("sidebar_header_bar")
|
||||||
|
|
||||||
|
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_reversed")
|
||||||
|
source: UM.Theme.getIcon("arrow_bottom")
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
id: sidebarComboBoxLabel
|
||||||
|
color: UM.Theme.getColor("text_reversed")
|
||||||
|
text: control.text;
|
||||||
|
elide: Text.ElideRight;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||||
|
anchors.right: downArrow.left;
|
||||||
|
anchors.rightMargin: control.rightMargin;
|
||||||
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
font: UM.Theme.getFont("large")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
label: Label{}
|
||||||
|
}
|
||||||
|
|
||||||
|
width: parent.width - (showSettings.width + showMonitor.width + 2 * UM.Theme.getSize("default_margin").width)
|
||||||
|
|
||||||
|
menu: PrinterMenu { }
|
||||||
|
}
|
||||||
|
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: showSettings
|
id: showSettings
|
||||||
width: (parent.width - UM.Theme.getSize("default_margin").width) / 2
|
width: height
|
||||||
height: UM.Theme.getSize("sidebar_header").height
|
height: UM.Theme.getSize("sidebar_header").height
|
||||||
onClicked: monitoringPrint = false
|
onClicked: monitoringPrint = false
|
||||||
iconSource: UM.Theme.getIcon("tab_settings");
|
iconSource: UM.Theme.getIcon("tab_settings");
|
||||||
@ -100,10 +149,11 @@ Rectangle
|
|||||||
|
|
||||||
style: UM.Theme.styles.sidebar_header_tab
|
style: UM.Theme.styles.sidebar_header_tab
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: showMonitor
|
id: showMonitor
|
||||||
width: (parent.width - UM.Theme.getSize("default_margin").width) / 2
|
width: height
|
||||||
height: UM.Theme.getSize("sidebar_header").height
|
height: UM.Theme.getSize("sidebar_header").height
|
||||||
onClicked: monitoringPrint = true
|
onClicked: monitoringPrint = true
|
||||||
iconSource: {
|
iconSource: {
|
||||||
@ -151,7 +201,6 @@ Rectangle
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
anchors.top: sidebarHeaderBar.bottom
|
anchors.top: sidebarHeaderBar.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
|
|
||||||
onShowTooltip: base.showTooltip(item, location, text)
|
onShowTooltip: base.showTooltip(item, location, text)
|
||||||
onHideTooltip: base.hideTooltip()
|
onHideTooltip: base.hideTooltip()
|
||||||
@ -160,10 +209,11 @@ Rectangle
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: headerSeparator
|
id: headerSeparator
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: UM.Theme.getSize("sidebar_lining").height
|
visible: !monitoringPrint
|
||||||
|
height: visible ? UM.Theme.getSize("sidebar_lining").height : 0
|
||||||
color: UM.Theme.getColor("sidebar_lining")
|
color: UM.Theme.getColor("sidebar_lining")
|
||||||
anchors.top: header.bottom
|
anchors.top: header.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentModeIndexChanged:
|
onCurrentModeIndexChanged:
|
||||||
|
@ -21,46 +21,6 @@ Column
|
|||||||
signal showTooltip(Item item, point location, string text)
|
signal showTooltip(Item item, point location, string text)
|
||||||
signal hideTooltip()
|
signal hideTooltip()
|
||||||
|
|
||||||
Row
|
|
||||||
{
|
|
||||||
id: machineSelectionRow
|
|
||||||
height: UM.Theme.getSize("sidebar_setup").height
|
|
||||||
|
|
||||||
anchors
|
|
||||||
{
|
|
||||||
left: parent.left
|
|
||||||
leftMargin: UM.Theme.getSize("default_margin").width
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: UM.Theme.getSize("default_margin").width
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
id: machineSelectionLabel
|
|
||||||
text: catalog.i18nc("@label:listbox", "Printer:");
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
font: UM.Theme.getFont("default");
|
|
||||||
color: UM.Theme.getColor("text");
|
|
||||||
|
|
||||||
width: parent.width * 0.45 - UM.Theme.getSize("default_margin").width
|
|
||||||
}
|
|
||||||
|
|
||||||
ToolButton
|
|
||||||
{
|
|
||||||
id: machineSelection
|
|
||||||
text: Cura.MachineManager.activeMachineName;
|
|
||||||
|
|
||||||
height: UM.Theme.getSize("setting_control").height
|
|
||||||
tooltip: Cura.MachineManager.activeMachineName
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
style: UM.Theme.styles.sidebar_header_button
|
|
||||||
|
|
||||||
width: parent.width * 0.55 + UM.Theme.getSize("default_margin").width
|
|
||||||
|
|
||||||
menu: PrinterMenu { }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
id: extruderSelectionRow
|
id: extruderSelectionRow
|
||||||
@ -86,6 +46,7 @@ Column
|
|||||||
property var index: 0
|
property var index: 0
|
||||||
|
|
||||||
height: UM.Theme.getSize("sidebar_header_mode_tabs").height
|
height: UM.Theme.getSize("sidebar_header_mode_tabs").height
|
||||||
|
width: parent.width
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
||||||
anchors
|
anchors
|
||||||
@ -141,6 +102,17 @@ Column
|
|||||||
control.hovered ? UM.Theme.getColor("tab_hovered") : UM.Theme.getColor("tab_unchecked")
|
control.hovered ? UM.Theme.getColor("tab_hovered") : UM.Theme.getColor("tab_unchecked")
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
|
|
||||||
|
Rectangle
|
||||||
|
{
|
||||||
|
id: highlight
|
||||||
|
visible: control.checked
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
height: UM.Theme.getSize("sidebar_header_highlight").height
|
||||||
|
color: UM.Theme.getColor("sidebar_header_bar")
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
id: swatch
|
id: swatch
|
||||||
@ -179,6 +151,14 @@ Column
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
id: variantRowSpacer
|
||||||
|
height: UM.Theme.getSize("default_margin").height / 4
|
||||||
|
width: height
|
||||||
|
visible: !extruderSelectionRow.visible
|
||||||
|
}
|
||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
id: variantRow
|
id: variantRow
|
||||||
|
@ -30,7 +30,7 @@ Item
|
|||||||
id: infillCellLeft
|
id: infillCellLeft
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
width: base.width / 100 * 35 - UM.Theme.getSize("default_margin").width
|
width: base.width * .45 - UM.Theme.getSize("default_margin").width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
Label
|
Label
|
||||||
@ -52,7 +52,7 @@ Item
|
|||||||
id: infillCellRight
|
id: infillCellRight
|
||||||
|
|
||||||
height: childrenRect.height;
|
height: childrenRect.height;
|
||||||
width: base.width / 100 * 65
|
width: base.width * .55
|
||||||
spacing: UM.Theme.getSize("default_margin").width
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
anchors.left: infillCellLeft.right
|
anchors.left: infillCellLeft.right
|
||||||
@ -231,7 +231,7 @@ Item
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: enableSupportCheckBox.verticalCenter
|
anchors.verticalCenter: enableSupportCheckBox.verticalCenter
|
||||||
width: parent.width / 100 * 45 - 3 * UM.Theme.getSize("default_margin").width
|
width: parent.width * .45 - 3 * UM.Theme.getSize("default_margin").width
|
||||||
text: catalog.i18nc("@label", "Enable Support");
|
text: catalog.i18nc("@label", "Enable Support");
|
||||||
font: UM.Theme.getFont("default");
|
font: UM.Theme.getFont("default");
|
||||||
color: UM.Theme.getColor("text");
|
color: UM.Theme.getColor("text");
|
||||||
@ -279,7 +279,7 @@ Item
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: supportExtruderCombobox.verticalCenter
|
anchors.verticalCenter: supportExtruderCombobox.verticalCenter
|
||||||
width: parent.width / 100 * 45 - 3 * UM.Theme.getSize("default_margin").width
|
width: parent.width * .45 - 3 * UM.Theme.getSize("default_margin").width
|
||||||
text: catalog.i18nc("@label", "Support Extruder");
|
text: catalog.i18nc("@label", "Support Extruder");
|
||||||
font: UM.Theme.getFont("default");
|
font: UM.Theme.getFont("default");
|
||||||
color: UM.Theme.getColor("text");
|
color: UM.Theme.getColor("text");
|
||||||
@ -319,7 +319,7 @@ Item
|
|||||||
}
|
}
|
||||||
anchors.left: supportExtruderLabel.right
|
anchors.left: supportExtruderLabel.right
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
width: parent.width / 100 * 55
|
width: parent.width * .55
|
||||||
height:
|
height:
|
||||||
{
|
{
|
||||||
if ((supportEnabled.properties.value == "True") && (machineExtruderCount.properties.value > 1))
|
if ((supportEnabled.properties.value == "True") && (machineExtruderCount.properties.value > 1))
|
||||||
@ -332,6 +332,7 @@ Item
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Behavior on height { NumberAnimation { duration: 100 } }
|
||||||
|
|
||||||
style: UM.Theme.styles.combobox_color
|
style: UM.Theme.styles.combobox_color
|
||||||
enabled: base.settingsEnabled
|
enabled: base.settingsEnabled
|
||||||
@ -377,7 +378,7 @@ Item
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: adhesionCheckBox.verticalCenter
|
anchors.verticalCenter: adhesionCheckBox.verticalCenter
|
||||||
width: parent.width / 100 * 45 - 3 * UM.Theme.getSize("default_margin").width
|
width: parent.width * .45 - 3 * UM.Theme.getSize("default_margin").width
|
||||||
text: catalog.i18nc("@label", "Build Plate Adhesion");
|
text: catalog.i18nc("@label", "Build Plate Adhesion");
|
||||||
font: UM.Theme.getFont("default");
|
font: UM.Theme.getFont("default");
|
||||||
color: UM.Theme.getColor("text");
|
color: UM.Theme.getColor("text");
|
||||||
|
@ -205,7 +205,7 @@
|
|||||||
|
|
||||||
"sidebar": [35.0, 10.0],
|
"sidebar": [35.0, 10.0],
|
||||||
"sidebar_header": [0.0, 4.0],
|
"sidebar_header": [0.0, 4.0],
|
||||||
"sidebar_header_highlight": [0.5, 0.5],
|
"sidebar_header_highlight": [0.25, 0.25],
|
||||||
"sidebar_header_mode_toggle": [0.0, 2.0],
|
"sidebar_header_mode_toggle": [0.0, 2.0],
|
||||||
"sidebar_header_mode_tabs": [0.0, 3.0],
|
"sidebar_header_mode_tabs": [0.0, 3.0],
|
||||||
"sidebar_lining": [0.5, 0.5],
|
"sidebar_lining": [0.5, 0.5],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user