From 30b20b4aa56e6bda5cc0f7f6ae0ab7a4f2a2e905 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 19 Nov 2018 13:50:32 +0100 Subject: Add borders to expandable components This adds a lining to all of the drop-downs from the stage menus. Contributes to issue CURA-5876. --- resources/qml/ExpandableComponent.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 8ed6dc5674..0a80e020c9 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -17,6 +17,8 @@ Item property var popupItem property color popupBackgroundColor: UM.Theme.getColor("action_button") + property int popupBorderWidth: UM.Theme.getSize("default_lining").width + property color popupBorderColor: UM.Theme.getColor("lining") property color headerBackgroundColor: UM.Theme.getColor("action_button") property color headerHoverColor: UM.Theme.getColor("action_button_hovered") @@ -147,6 +149,8 @@ Item background: Rectangle { color: popupBackgroundColor + border.width: popupBorderWidth + border.color: popupBorderColor } } } -- cgit v1.2.3 From 7a210087ff0aa8c34ebe7438bc744136b3afab64 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 19 Nov 2018 14:35:34 +0100 Subject: Add header for configuration selector It currently always says 'Custom', but we will want to make that dynamic at some point. Contributes to issue CURA-5876. --- .../QuickConfigurationSelector.qml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml b/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml index 33610135fe..d84298ee2e 100644 --- a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml +++ b/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml @@ -12,6 +12,10 @@ import UM 1.2 as UM import Cura 1.0 as Cura +/** + * Menu that allows you to select the configuration of the current printer, such + * as the nozzle sizes and materials in each extruder. + */ Cura.ExpandableComponent { id: base @@ -99,10 +103,27 @@ Cura.ExpandableComponent width: base.width - 2 * UM.Theme.getSize("default_margin").width height: 200 + Label + { + id: customHeader + text: catalog.i18nc("@header", "Custom") + font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text") + + anchors + { + top: parent.top + left: parent.left + right: parent.right + } + } + TabBar { id: tabBar onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) + anchors.top: customHeader.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width height: 50 Repeater -- cgit v1.2.3 From 00a49fff26fac675207d30b6131f2d4869474197 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 19 Nov 2018 14:39:19 +0100 Subject: Rename QuickConfigurationSelector to ConfigurationMenu This is going to function as our main item for the configuration menu. It contains the part in the top bar and the glue item for the part in the popup. Contributes to issue CURA-5876. --- plugins/PrepareStage/PrepareMenu.qml | 2 +- .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 262 +++++++++++++++++++++ .../QuickConfigurationSelector.qml | 262 --------------------- 3 files changed, 263 insertions(+), 263 deletions(-) create mode 100644 resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml delete mode 100644 resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index ef01625a22..6b241e1da2 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -68,7 +68,7 @@ Item color: UM.Theme.getColor("lining") } - Cura.QuickConfigurationSelector + Cura.ConfigurationMenu { Layout.fillHeight: true Layout.fillWidth: true diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml new file mode 100644 index 0000000000..d84298ee2e --- /dev/null +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -0,0 +1,262 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Controls.Styles 1.4 +import QtQuick.Layouts 1.11 + +import QtQuick.Controls 1.1 as OldControls + +import UM 1.2 as UM +import Cura 1.0 as Cura + + +/** + * Menu that allows you to select the configuration of the current printer, such + * as the nozzle sizes and materials in each extruder. + */ +Cura.ExpandableComponent +{ + id: base + + Cura.ExtrudersModel + { + id: extrudersModel + } + + UM.I18nCatalog + { + id: catalog + name: "cura" + } + + iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") + headerItem: Item + { + // Horizontal list that shows the extruders + ListView + { + id: extrudersList + + orientation: ListView.Horizontal + anchors.fill: parent + model: extrudersModel + + delegate: Item + { + height: parent.height + width: Math.round(ListView.view.width / extrudersModel.rowCount()) + + // Extruder icon. Shows extruder index and has the same color as the active material. + Cura.ExtruderIcon + { + id: extruderIcon + materialColor: model.color + extruderEnabled: model.enabled + height: parent.height + width: height + } + + // Label for the brand of the material + Label + { + id: brandNameLabel + + text: model.material_brand + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + + anchors + { + left: extruderIcon.right + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + } + } + + // Label that shows the name of the material + Label + { + text: model.material + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + + anchors + { + left: extruderIcon.right + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + top: brandNameLabel.bottom + } + } + } + } + } + + popupItem: Item + { + width: base.width - 2 * UM.Theme.getSize("default_margin").width + height: 200 + + Label + { + id: customHeader + text: catalog.i18nc("@header", "Custom") + font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text") + + anchors + { + top: parent.top + left: parent.left + right: parent.right + } + } + + TabBar + { + id: tabBar + onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) + anchors.top: customHeader.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + width: parent.width + height: 50 + Repeater + { + model: extrudersModel + + delegate: TabButton + { + width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0 + height: parent.height + contentItem: Item + { + Cura.ExtruderIcon + { + anchors.horizontalCenter: parent.horizontalCenter + materialColor: model.color + extruderEnabled: model.enabled + width: parent.height + height: parent.height + } + } + } + } + } + + Item + { + id: tabControl + width: parent.width + anchors.top: tabBar.bottom + anchors.bottom: parent.bottom + property var model: extrudersModel.items[tabBar.currentIndex] + property real textWidth: Math.round(width * 0.3) + property real controlWidth: width - textWidth + Column + { + spacing: UM.Theme.getSize("default_margin").height + Row + { + height: UM.Theme.getSize("print_setup_item").height + + Label + { + text: catalog.i18nc("@label", "Enabled") + verticalAlignment: Text.AlignVCenter + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + height: parent.height + width: tabControl.textWidth + } + + OldControls.CheckBox + { + checked: tabControl.model != null ? Cura.MachineManager.getExtruder(tabControl.model.index).isEnabled: false + onClicked: Cura.MachineManager.setExtruderEnabled(tabControl.model.index, checked) + height: UM.Theme.getSize("setting_control").height + style: UM.Theme.styles.checkbox + } + } + + Row + { + height: UM.Theme.getSize("print_setup_item").height + Label + { + text: catalog.i18nc("@label", "Material") + verticalAlignment: Text.AlignVCenter + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + height: parent.height + width: tabControl.textWidth + } + + OldControls.ToolButton + { + id: materialSelection + + property var activeExtruder: Cura.MachineManager.activeStack + property var hasActiveExtruder: activeExtruder != null + property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : "" + property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true + property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported + + text: currentRootMaterialName + tooltip: currentRootMaterialName + visible: Cura.MachineManager.hasMaterials + + enabled: Cura.ExtruderManager.activeExtruderIndex > -1 + + height: UM.Theme.getSize("setting_control").height + width: tabControl.controlWidth + + style: UM.Theme.styles.sidebar_header_button + activeFocusOnPress: true + menu: Cura.MaterialMenu + { + extruderIndex: Cura.ExtruderManager.activeExtruderIndex + } + + } + } + + Row + { + height: UM.Theme.getSize("print_setup_item").height + + Label + { + text: Cura.MachineManager.activeDefinitionVariantsName + verticalAlignment: Text.AlignVCenter + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + height: parent.height + width: tabControl.textWidth + } + + OldControls.ToolButton + { + id: variantSelection + text: Cura.MachineManager.activeVariantName + tooltip: Cura.MachineManager.activeVariantName; + visible: Cura.MachineManager.hasVariants + + height: UM.Theme.getSize("setting_control").height + width: tabControl.controlWidth + style: UM.Theme.styles.sidebar_header_button + activeFocusOnPress: true; + + menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex } + } + } + } + + } + } +} diff --git a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml b/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml deleted file mode 100644 index d84298ee2e..0000000000 --- a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.7 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Layouts 1.11 - -import QtQuick.Controls 1.1 as OldControls - -import UM 1.2 as UM -import Cura 1.0 as Cura - - -/** - * Menu that allows you to select the configuration of the current printer, such - * as the nozzle sizes and materials in each extruder. - */ -Cura.ExpandableComponent -{ - id: base - - Cura.ExtrudersModel - { - id: extrudersModel - } - - UM.I18nCatalog - { - id: catalog - name: "cura" - } - - iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") - headerItem: Item - { - // Horizontal list that shows the extruders - ListView - { - id: extrudersList - - orientation: ListView.Horizontal - anchors.fill: parent - model: extrudersModel - - delegate: Item - { - height: parent.height - width: Math.round(ListView.view.width / extrudersModel.rowCount()) - - // Extruder icon. Shows extruder index and has the same color as the active material. - Cura.ExtruderIcon - { - id: extruderIcon - materialColor: model.color - extruderEnabled: model.enabled - height: parent.height - width: height - } - - // Label for the brand of the material - Label - { - id: brandNameLabel - - text: model.material_brand - elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - - anchors - { - left: extruderIcon.right - leftMargin: UM.Theme.getSize("default_margin").width - right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width - } - } - - // Label that shows the name of the material - Label - { - text: model.material - elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - - anchors - { - left: extruderIcon.right - leftMargin: UM.Theme.getSize("default_margin").width - right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width - top: brandNameLabel.bottom - } - } - } - } - } - - popupItem: Item - { - width: base.width - 2 * UM.Theme.getSize("default_margin").width - height: 200 - - Label - { - id: customHeader - text: catalog.i18nc("@header", "Custom") - font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text") - - anchors - { - top: parent.top - left: parent.left - right: parent.right - } - } - - TabBar - { - id: tabBar - onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) - anchors.top: customHeader.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - width: parent.width - height: 50 - Repeater - { - model: extrudersModel - - delegate: TabButton - { - width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0 - height: parent.height - contentItem: Item - { - Cura.ExtruderIcon - { - anchors.horizontalCenter: parent.horizontalCenter - materialColor: model.color - extruderEnabled: model.enabled - width: parent.height - height: parent.height - } - } - } - } - } - - Item - { - id: tabControl - width: parent.width - anchors.top: tabBar.bottom - anchors.bottom: parent.bottom - property var model: extrudersModel.items[tabBar.currentIndex] - property real textWidth: Math.round(width * 0.3) - property real controlWidth: width - textWidth - Column - { - spacing: UM.Theme.getSize("default_margin").height - Row - { - height: UM.Theme.getSize("print_setup_item").height - - Label - { - text: catalog.i18nc("@label", "Enabled") - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - height: parent.height - width: tabControl.textWidth - } - - OldControls.CheckBox - { - checked: tabControl.model != null ? Cura.MachineManager.getExtruder(tabControl.model.index).isEnabled: false - onClicked: Cura.MachineManager.setExtruderEnabled(tabControl.model.index, checked) - height: UM.Theme.getSize("setting_control").height - style: UM.Theme.styles.checkbox - } - } - - Row - { - height: UM.Theme.getSize("print_setup_item").height - Label - { - text: catalog.i18nc("@label", "Material") - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - height: parent.height - width: tabControl.textWidth - } - - OldControls.ToolButton - { - id: materialSelection - - property var activeExtruder: Cura.MachineManager.activeStack - property var hasActiveExtruder: activeExtruder != null - property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : "" - property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true - property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported - - text: currentRootMaterialName - tooltip: currentRootMaterialName - visible: Cura.MachineManager.hasMaterials - - enabled: Cura.ExtruderManager.activeExtruderIndex > -1 - - height: UM.Theme.getSize("setting_control").height - width: tabControl.controlWidth - - style: UM.Theme.styles.sidebar_header_button - activeFocusOnPress: true - menu: Cura.MaterialMenu - { - extruderIndex: Cura.ExtruderManager.activeExtruderIndex - } - - } - } - - Row - { - height: UM.Theme.getSize("print_setup_item").height - - Label - { - text: Cura.MachineManager.activeDefinitionVariantsName - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - height: parent.height - width: tabControl.textWidth - } - - OldControls.ToolButton - { - id: variantSelection - text: Cura.MachineManager.activeVariantName - tooltip: Cura.MachineManager.activeVariantName; - visible: Cura.MachineManager.hasVariants - - height: UM.Theme.getSize("setting_control").height - width: tabControl.controlWidth - style: UM.Theme.styles.sidebar_header_button - activeFocusOnPress: true; - - menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex } - } - } - } - - } - } -} -- cgit v1.2.3 From 16deeb09510b4bbaa6bc2c7b4ca7b939aa904caf Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 19 Nov 2018 17:10:29 +0100 Subject: Remove old QuickConfigurationSelector It doesn't exist any more. Contributes to issue CURA-5876. --- resources/qml/qmldir | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/qmldir b/resources/qml/qmldir index d5e4106d33..878945b922 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -1,7 +1,6 @@ module Cura MachineSelector 1.0 MachineSelector.qml -QuickConfigurationSelector 1.0 QuickConfigurationSelector.qml CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml PrintSetupSelector 1.0 PrintSetupSelector.qml ActionButton 1.0 ActionButton.qml -- cgit v1.2.3 From a04db164e6a0679ca684dd65ff33c50b9355a242 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 19 Nov 2018 17:11:51 +0100 Subject: Make it possible to swap between auto and custom configuration We're going to need to make this disappear when the printer is not connected. But that is for later. Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/AutoConfiguration.qml | 25 +++ .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 197 +++++++-------------- .../ConfigurationMenu/CustomConfiguration.qml | 168 ++++++++++++++++++ 3 files changed, 258 insertions(+), 132 deletions(-) create mode 100644 resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml create mode 100644 resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml diff --git a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml new file mode 100644 index 0000000000..e1f0ed480e --- /dev/null +++ b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml @@ -0,0 +1,25 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.0 + +import UM 1.3 as UM + +Item +{ + Label + { + id: header + text: catalog.i18nc("@header", "Configurations") + font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text") + + anchors + { + top: parent.top + left: parent.left + right: parent.right + } + } +} \ No newline at end of file diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index d84298ee2e..10c52a7b0f 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -6,8 +6,6 @@ import QtQuick.Controls 2.0 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.11 -import QtQuick.Controls 1.1 as OldControls - import UM 1.2 as UM import Cura 1.0 as Cura @@ -100,163 +98,98 @@ Cura.ExpandableComponent popupItem: Item { + id: popup width: base.width - 2 * UM.Theme.getSize("default_margin").width height: 200 - Label + property var configuration_method: "auto" + + AutoConfiguration + { + id: autoConfiguration + visible: popup.configuration_method === "auto" + anchors.top: header.bottom + height: visible ? childrenRect.height : 0 + } + + CustomConfiguration { - id: customHeader - text: catalog.i18nc("@header", "Custom") - font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text") + id: customConfiguration + visible: popup.configuration_method === "custom" + anchors.top: header.bottom + height: visible ? childrenRect.height : 0 + } + Rectangle + { + id: separator anchors { - top: parent.top left: parent.left right: parent.right + bottom: buttonBar.top + bottomMargin: UM.Theme.getSize("default_margin").height } + height: UM.Theme.getSize("default_lining").height + color: UM.Theme.getColor("lining") } - TabBar + Rectangle { - id: tabBar - onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) - anchors.top: customHeader.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - width: parent.width - height: 50 - Repeater + id: buttonBar + anchors { - model: extrudersModel - - delegate: TabButton - { - width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0 - height: parent.height - contentItem: Item - { - Cura.ExtruderIcon - { - anchors.horizontalCenter: parent.horizontalCenter - materialColor: model.color - extruderEnabled: model.enabled - width: parent.height - height: parent.height - } - } - } + left: parent.left + right: parent.right + bottom: parent.bottom } - } + height: childrenRect.height - Item - { - id: tabControl - width: parent.width - anchors.top: tabBar.bottom - anchors.bottom: parent.bottom - property var model: extrudersModel.items[tabBar.currentIndex] - property real textWidth: Math.round(width * 0.3) - property real controlWidth: width - textWidth - Column + Cura.ActionButton { - spacing: UM.Theme.getSize("default_margin").height - Row - { - height: UM.Theme.getSize("print_setup_item").height - - Label - { - text: catalog.i18nc("@label", "Enabled") - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - height: parent.height - width: tabControl.textWidth - } + id: goToCustom + visible: popup.configuration_method === "auto" + text: catalog.i18nc("@label", "Custom") - OldControls.CheckBox - { - checked: tabControl.model != null ? Cura.MachineManager.getExtruder(tabControl.model.index).isEnabled: false - onClicked: Cura.MachineManager.setExtruderEnabled(tabControl.model.index, checked) - height: UM.Theme.getSize("setting_control").height - style: UM.Theme.styles.checkbox - } - } - - Row + anchors { - height: UM.Theme.getSize("print_setup_item").height - Label - { - text: catalog.i18nc("@label", "Material") - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - height: parent.height - width: tabControl.textWidth - } - - OldControls.ToolButton - { - id: materialSelection - - property var activeExtruder: Cura.MachineManager.activeStack - property var hasActiveExtruder: activeExtruder != null - property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : "" - property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true - property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported - - text: currentRootMaterialName - tooltip: currentRootMaterialName - visible: Cura.MachineManager.hasMaterials - - enabled: Cura.ExtruderManager.activeExtruderIndex > -1 + right: parent.right + bottom: parent.bottom + } - height: UM.Theme.getSize("setting_control").height - width: tabControl.controlWidth + color: UM.Theme.getColor("secondary") + hoverColor: UM.Theme.getColor("secondary") + textColor: UM.Theme.getColor("primary") + textHoverColor: UM.Theme.getColor("text") + height: UM.Theme.getSize("action_panel_button").height + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width - style: UM.Theme.styles.sidebar_header_button - activeFocusOnPress: true - menu: Cura.MaterialMenu - { - extruderIndex: Cura.ExtruderManager.activeExtruderIndex - } + onClicked: popup.configuration_method = "custom" + } - } - } + Cura.ActionButton + { + id: goToAuto + visible: popup.configuration_method === "custom" + text: catalog.i18nc("@label", "Configurations") - Row + anchors { - height: UM.Theme.getSize("print_setup_item").height - - Label - { - text: Cura.MachineManager.activeDefinitionVariantsName - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - height: parent.height - width: tabControl.textWidth - } - - OldControls.ToolButton - { - id: variantSelection - text: Cura.MachineManager.activeVariantName - tooltip: Cura.MachineManager.activeVariantName; - visible: Cura.MachineManager.hasVariants + left: parent.left + bottom: parent.bottom + } - height: UM.Theme.getSize("setting_control").height - width: tabControl.controlWidth - style: UM.Theme.styles.sidebar_header_button - activeFocusOnPress: true; + color: UM.Theme.getColor("secondary") + hoverColor: UM.Theme.getColor("secondary") + textColor: UM.Theme.getColor("primary") + textHoverColor: UM.Theme.getColor("text") + height: UM.Theme.getSize("action_panel_button").height + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width - menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex } - } - } + onClicked: popup.configuration_method = "auto" } - } } } diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml new file mode 100644 index 0000000000..953b6a48f0 --- /dev/null +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -0,0 +1,168 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.0 +import QtQuick.Controls 2.0 +import QtQuick.Controls 1.1 as OldControls + +import Cura 1.0 as Cura +import UM 1.3 as UM + +Item +{ + Label + { + id: header + text: catalog.i18nc("@header", "Custom") + font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text") + + anchors + { + top: parent.top + left: parent.left + right: parent.right + } + } + + TabBar + { + id: tabBar + onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) + anchors.top: header.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + width: parent.width + height: 50 + Repeater + { + model: extrudersModel + + delegate: TabButton + { + width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0 + height: parent.height + contentItem: Item + { + Cura.ExtruderIcon + { + anchors.horizontalCenter: parent.horizontalCenter + materialColor: model.color + extruderEnabled: model.enabled + width: parent.height + height: parent.height + } + } + } + } + } + + Item + { + id: tabControl + width: parent.width + anchors.top: tabBar.bottom + anchors.bottom: parent.bottom + property var model: extrudersModel.items[tabBar.currentIndex] + property real textWidth: Math.round(width * 0.3) + property real controlWidth: width - textWidth + Column + { + spacing: UM.Theme.getSize("default_margin").height + Row + { + height: UM.Theme.getSize("print_setup_item").height + + Label + { + text: catalog.i18nc("@label", "Enabled") + verticalAlignment: Text.AlignVCenter + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + height: parent.height + width: tabControl.textWidth + } + + OldControls.CheckBox + { + checked: tabControl.model != null ? Cura.MachineManager.getExtruder(tabControl.model.index).isEnabled: false + onClicked: Cura.MachineManager.setExtruderEnabled(tabControl.model.index, checked) + height: UM.Theme.getSize("setting_control").height + style: UM.Theme.styles.checkbox + } + } + + Row + { + height: UM.Theme.getSize("print_setup_item").height + Label + { + text: catalog.i18nc("@label", "Material") + verticalAlignment: Text.AlignVCenter + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + height: parent.height + width: tabControl.textWidth + } + + OldControls.ToolButton + { + id: materialSelection + + property var activeExtruder: Cura.MachineManager.activeStack + property var hasActiveExtruder: activeExtruder != null + property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : "" + property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true + property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported + + text: currentRootMaterialName + tooltip: currentRootMaterialName + visible: Cura.MachineManager.hasMaterials + + enabled: Cura.ExtruderManager.activeExtruderIndex > -1 + + height: UM.Theme.getSize("setting_control").height + width: tabControl.controlWidth + + style: UM.Theme.styles.sidebar_header_button + activeFocusOnPress: true + menu: Cura.MaterialMenu + { + extruderIndex: Cura.ExtruderManager.activeExtruderIndex + } + + } + } + + Row + { + height: UM.Theme.getSize("print_setup_item").height + + Label + { + text: Cura.MachineManager.activeDefinitionVariantsName + verticalAlignment: Text.AlignVCenter + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + height: parent.height + width: tabControl.textWidth + } + + OldControls.ToolButton + { + id: variantSelection + text: Cura.MachineManager.activeVariantName + tooltip: Cura.MachineManager.activeVariantName; + visible: Cura.MachineManager.hasVariants + + height: UM.Theme.getSize("setting_control").height + width: tabControl.controlWidth + style: UM.Theme.styles.sidebar_header_button + activeFocusOnPress: true; + + menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex } + } + } + } + + } +} \ No newline at end of file -- cgit v1.2.3 From cbd5238738b1656c986caf87b58957ff605d4fb3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 20 Nov 2018 13:55:28 +0100 Subject: Don't show custom/auto toggle buttons when not connected In order to prevent suddenly switching to the other side when the connection is lost or restored, we only evaluate this upon opening the popup. This way you might be surprised that closing and then opening it can show something else, but it will never surprise you while working on the popup itself as a user. Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 34 ++++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 10c52a7b0f..fe292799a5 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -98,31 +98,37 @@ Cura.ExpandableComponent popupItem: Item { - id: popup + id: popupItem width: base.width - 2 * UM.Theme.getSize("default_margin").width height: 200 - property var configuration_method: "auto" + property var is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible. + onVisibleChanged: + { + is_connected = Cura.MachineManager.activeMachineNetworkKey != "" && Cura.MachineManager.printerConnected //Re-evaluate. + } + + property var configuration_method: buttonBar.visible ? "auto" : "custom" //Auto if connected to a printer at start-up, or Custom if not. AutoConfiguration { id: autoConfiguration - visible: popup.configuration_method === "auto" - anchors.top: header.bottom - height: visible ? childrenRect.height : 0 + visible: popupItem.configuration_method === "auto" + anchors.top: parent.top } CustomConfiguration { id: customConfiguration - visible: popup.configuration_method === "custom" - anchors.top: header.bottom - height: visible ? childrenRect.height : 0 + visible: popupItem.configuration_method === "custom" + anchors.top: parent.top } Rectangle { id: separator + visible: buttonBar.visible + anchors { left: parent.left @@ -131,12 +137,16 @@ Cura.ExpandableComponent bottomMargin: UM.Theme.getSize("default_margin").height } height: UM.Theme.getSize("default_lining").height + color: UM.Theme.getColor("lining") } + //Allow switching between custom and auto. Rectangle { id: buttonBar + visible: popupItem.is_connected //Switching only makes sense if the "auto" part is possible. + anchors { left: parent.left @@ -148,7 +158,7 @@ Cura.ExpandableComponent Cura.ActionButton { id: goToCustom - visible: popup.configuration_method === "auto" + visible: popupItem.configuration_method === "auto" text: catalog.i18nc("@label", "Custom") anchors @@ -165,13 +175,13 @@ Cura.ExpandableComponent leftPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width - onClicked: popup.configuration_method = "custom" + onClicked: popupItem.configuration_method = "custom" } Cura.ActionButton { id: goToAuto - visible: popup.configuration_method === "custom" + visible: popupItem.configuration_method === "custom" text: catalog.i18nc("@label", "Configurations") anchors @@ -188,7 +198,7 @@ Cura.ExpandableComponent leftPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width - onClicked: popup.configuration_method = "auto" + onClicked: popupItem.configuration_method = "auto" } } } -- cgit v1.2.3 From 42d73836f400357e73d288d0a3be56848f7743f6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 20 Nov 2018 14:19:55 +0100 Subject: Move default margin by default to Cura's action buttons So we don't have to repeat that every time you create a new button. Contributes to issue CURA-5876. --- resources/qml/ActionButton.qml | 3 +++ resources/qml/ActionPanel/OutputDevicesActionButton.qml | 2 ++ resources/qml/ActionPanel/OutputProcessWidget.qml | 2 -- resources/qml/MainWindow/MainWindowHeader.qml | 2 -- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 4 ---- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 2a8b894867..08c44fb473 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -29,6 +29,9 @@ Button // we elide the text to the right so the text will be cut off with the three dots at the end. property var fixedWidthMode: false + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width + contentItem: Row { UM.RecolorImage diff --git a/resources/qml/ActionPanel/OutputDevicesActionButton.qml b/resources/qml/ActionPanel/OutputDevicesActionButton.qml index be79a1893e..a2a69ed526 100644 --- a/resources/qml/ActionPanel/OutputDevicesActionButton.qml +++ b/resources/qml/ActionPanel/OutputDevicesActionButton.qml @@ -48,6 +48,8 @@ Item right: parent.right } + leftPadding: UM.Theme.getSize("narrow_margin").width //Need more space than usual here for wide text. + rightPadding: UM.Theme.getSize("narrow_margin").width tooltip: catalog.i18nc("@info:tooltip", "Select the active output device") iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom") color: UM.Theme.getColor("action_panel_secondary") diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index f4e014b1ec..772c05741f 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -104,8 +104,6 @@ Column { id: previewStageShortcut - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("action_panel_button").height text: catalog.i18nc("@button", "Preview") color: UM.Theme.getColor("secondary") diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 59ec542e6b..6f3358648b 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -81,8 +81,6 @@ Rectangle rightMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter } - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width text: catalog.i18nc("@action:button", "Marketplace") height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) color: UM.Theme.getColor("main_window_header_secondary_button_background_active") diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index fe292799a5..cb90735250 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -172,8 +172,6 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") height: UM.Theme.getSize("action_panel_button").height - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width onClicked: popupItem.configuration_method = "custom" } @@ -195,8 +193,6 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") height: UM.Theme.getSize("action_panel_button").height - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width onClicked: popupItem.configuration_method = "auto" } -- cgit v1.2.3 From a1068a3ef27d7fa3499ae8c149a3d0da2945e2cb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 20 Nov 2018 14:24:09 +0100 Subject: Rename action_panel_button theme entry to action_button Because it's not just used in the save panel. Contributes to issue CURA-5876. --- resources/qml/ActionPanel/OutputProcessWidget.qml | 6 +++--- resources/qml/ActionPanel/SliceProcessWidget.qml | 2 +- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 4 ++-- resources/themes/cura-light/theme.json | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index 772c05741f..61efda2f2d 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -104,7 +104,7 @@ Column { id: previewStageShortcut - height: UM.Theme.getSize("action_panel_button").height + height: UM.Theme.getSize("action_button").height text: catalog.i18nc("@button", "Preview") color: UM.Theme.getColor("secondary") hoverColor: UM.Theme.getColor("secondary") @@ -116,8 +116,8 @@ Column Cura.OutputDevicesActionButton { - width: previewStageShortcut.visible ? UM.Theme.getSize("action_panel_button").width : parent.width - height: UM.Theme.getSize("action_panel_button").height + width: previewStageShortcut.visible ? UM.Theme.getSize("action_button").width : parent.width + height: UM.Theme.getSize("action_button").height } } } \ No newline at end of file diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 2d4a7b6b89..7de1a22edb 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -85,7 +85,7 @@ Column { id: prepareButton width: parent.width - height: UM.Theme.getSize("action_panel_button").height + height: UM.Theme.getSize("action_button").height fixedWidthMode: true text: { diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index cb90735250..1015f67a2e 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -171,7 +171,7 @@ Cura.ExpandableComponent hoverColor: UM.Theme.getColor("secondary") textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") - height: UM.Theme.getSize("action_panel_button").height + height: UM.Theme.getSize("action_button").height onClicked: popupItem.configuration_method = "custom" } @@ -192,7 +192,7 @@ Cura.ExpandableComponent hoverColor: UM.Theme.getColor("secondary") textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") - height: UM.Theme.getSize("action_panel_button").height + height: UM.Theme.getSize("action_button").height onClicked: popupItem.configuration_method = "auto" } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index d28611529b..8b3e606094 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -385,7 +385,6 @@ "action_panel_widget": [25.0, 0.0], "action_panel_information_widget": [20.0, 0.0], - "action_panel_button": [15.0, 3.0], "machine_selector_widget": [16.0, 4.5], @@ -432,6 +431,9 @@ "button_icon": [2.5, 2.5], "button_lining": [0, 0], + "action_button": [15.0, 3.0], + "action_button_radius": [0.15, 0.15], + "small_button": [2, 2], "small_button_icon": [1.5, 1.5], @@ -520,8 +522,6 @@ "avatar_image": [6.8, 6.8], - "action_button_radius": [0.15, 0.15], - "monitor_config_override_box": [1.0, 14.0], "monitor_extruder_circle": [2.75, 2.75], "monitor_text_line": [1.16, 1.16], -- cgit v1.2.3 From dca286cea51e1f336df2a5fa2aa0f7f80dc9917e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 20 Nov 2018 14:34:06 +0100 Subject: Give action button a sane default height We don't want to give it a default width since that should just adjust to its contents by default, which is fine. Contributes to issue CURA-5876. --- resources/qml/ActionButton.qml | 1 + resources/qml/ActionPanel/OutputProcessWidget.qml | 1 - resources/qml/ActionPanel/SliceProcessWidget.qml | 1 - resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 2 -- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 08c44fb473..0ed639db75 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -31,6 +31,7 @@ Button leftPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width + height: UM.Theme.getSize("action_button").height contentItem: Row { diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index 61efda2f2d..98dbe5bd2c 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -104,7 +104,6 @@ Column { id: previewStageShortcut - height: UM.Theme.getSize("action_button").height text: catalog.i18nc("@button", "Preview") color: UM.Theme.getColor("secondary") hoverColor: UM.Theme.getColor("secondary") diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 7de1a22edb..09e0b2584a 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -85,7 +85,6 @@ Column { id: prepareButton width: parent.width - height: UM.Theme.getSize("action_button").height fixedWidthMode: true text: { diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 1015f67a2e..aa30a1236b 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -171,7 +171,6 @@ Cura.ExpandableComponent hoverColor: UM.Theme.getColor("secondary") textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") - height: UM.Theme.getSize("action_button").height onClicked: popupItem.configuration_method = "custom" } @@ -192,7 +191,6 @@ Cura.ExpandableComponent hoverColor: UM.Theme.getColor("secondary") textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") - height: UM.Theme.getSize("action_button").height onClicked: popupItem.configuration_method = "auto" } -- cgit v1.2.3 From d42ddad606111ffcf3a1e764e3bc0af6c7064d79 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 20 Nov 2018 14:47:41 +0100 Subject: Add icons on left and right side of text For this I had to implement functionality in ActionButton to be able to display the icon on either side. Contributes to issue CURA-5876. --- resources/qml/ActionButton.qml | 24 ++++++++++++++++++---- .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 5 +++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 0ed639db75..28bda7fd35 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -11,7 +11,8 @@ Button { id: button property alias cursorShape: mouseArea.cursorShape - property alias iconSource: buttonIcon.source + property alias iconSource: buttonIconLeft.source + property var iconOnRightSide: false property alias textFont: buttonText.font property alias cornerRadius: backgroundRect.radius property alias tooltip: tooltip.text @@ -35,16 +36,17 @@ Button contentItem: Row { + //Icon if displayed on the left side. UM.RecolorImage { - id: buttonIcon + id: buttonIconLeft source: "" height: Math.round(0.6 * parent.height) - width: height + width: visible ? height : 0 sourceSize.width: width sourceSize.height: height color: button.hovered ? button.textHoverColor : button.textColor - visible: source != "" + visible: source != "" && !button.iconOnRightSide anchors.verticalCenter: parent.verticalCenter } @@ -61,6 +63,20 @@ Button horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight } + + //Icon if displayed on the right side. + UM.RecolorImage + { + id: buttonIconRight + source: buttonIconLeft.source + height: Math.round(0.6 * parent.height) + width: visible ? height : 0 + sourceSize.width: width + sourceSize.height: height + color: button.hovered ? button.textHoverColor : button.textColor + visible: source != "" && button.iconOnRightSide + anchors.verticalCenter: parent.verticalCenter + } } background: Rectangle diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index aa30a1236b..b38384ef8a 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -172,6 +172,9 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") + iconSource: UM.Theme.icons.arrow_right + iconOnRightSide: true + onClicked: popupItem.configuration_method = "custom" } @@ -192,6 +195,8 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") + iconSource: UM.Theme.icons.arrow_left + onClicked: popupItem.configuration_method = "auto" } } -- cgit v1.2.3 From 6de24250edbb5d5a86dbdea6eff79e15f7196326 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 20 Nov 2018 14:50:12 +0100 Subject: Make icon height equal to text height This seems to be about the same actually as what it was. But now the relation is in there. I also made the right icon inherit as much as possible from the left icon so that if we change something, we only have to change it in the left icon. Contributes to issue CURA-5876. --- resources/qml/ActionButton.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 28bda7fd35..7ecaeda4b0 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -41,7 +41,7 @@ Button { id: buttonIconLeft source: "" - height: Math.round(0.6 * parent.height) + height: buttonText.height width: visible ? height : 0 sourceSize.width: width sourceSize.height: height @@ -69,13 +69,13 @@ Button { id: buttonIconRight source: buttonIconLeft.source - height: Math.round(0.6 * parent.height) + height: buttonText.height width: visible ? height : 0 sourceSize.width: width sourceSize.height: height - color: button.hovered ? button.textHoverColor : button.textColor + color: buttonIconLeft.color visible: source != "" && button.iconOnRightSide - anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenter: buttonIconLeft.verticalCenter } } -- cgit v1.2.3 From eb056ee17bbc7d843a83ce108e95d51bc6f499ba Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 21 Nov 2018 16:06:26 +0100 Subject: Fix display of custom configuration Since it had no width, everything was resized to 0. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 953b6a48f0..aa4cf3624b 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -10,6 +10,8 @@ import UM 1.3 as UM Item { + width: parent.width + Label { id: header -- cgit v1.2.3 From a052b8ec69e014c0ebce92ffb4fcb0067d85831c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 21 Nov 2018 16:08:29 +0100 Subject: Use Theme.getIcon instead of Theme.icons This is better for performance, according to the deprecation warning I got. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index b38384ef8a..111f42483e 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -172,7 +172,7 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") - iconSource: UM.Theme.icons.arrow_right + iconSource: UM.Theme.getIcon("arrow_right") iconOnRightSide: true onClicked: popupItem.configuration_method = "custom" @@ -195,7 +195,7 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") - iconSource: UM.Theme.icons.arrow_left + iconSource: UM.Theme.getIcon("arrow_left") onClicked: popupItem.configuration_method = "auto" } -- cgit v1.2.3 From a826dfb156c46acfbe26533eab594aa27305040d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 21 Nov 2018 16:12:00 +0100 Subject: Fix binding loop in height of view selection bar Since these were part of the childrenRect of the bar, and attached to the bottom of the bar, the childrenRect depended on the position of the children and that depends on the childrenRect again. So just attach it to the top, it's logical. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 111f42483e..8f31d80810 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -164,7 +164,7 @@ Cura.ExpandableComponent anchors { right: parent.right - bottom: parent.bottom + top: parent.top } color: UM.Theme.getColor("secondary") @@ -187,7 +187,7 @@ Cura.ExpandableComponent anchors { left: parent.left - bottom: parent.bottom + top: parent.top } color: UM.Theme.getColor("secondary") -- cgit v1.2.3 From 7f11142d5086b40164b490d90617a31bf41f63d8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 22 Nov 2018 14:57:55 +0100 Subject: Fix height and vertical layout of popup Many things were made simpler. This took some time to fix... Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/AutoConfiguration.qml | 4 ++ .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 49 ++++++++++------------ .../ConfigurationMenu/CustomConfiguration.qml | 6 ++- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml index e1f0ed480e..cde18ab488 100644 --- a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml @@ -8,12 +8,16 @@ import UM 1.3 as UM Item { + width: parent.width + height: visible ? childrenRect.height : 0 + Label { id: header text: catalog.i18nc("@header", "Configurations") font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") + height: contentHeight anchors { diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 8f31d80810..4aa8d66caa 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -96,32 +96,36 @@ Cura.ExpandableComponent } } - popupItem: Item + popupItem: Column { id: popupItem width: base.width - 2 * UM.Theme.getSize("default_margin").width - height: 200 + height: implicitHeight //Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up. + spacing: UM.Theme.getSize("default_margin").height property var is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible. onVisibleChanged: { - is_connected = Cura.MachineManager.activeMachineNetworkKey != "" && Cura.MachineManager.printerConnected //Re-evaluate. + is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected //Re-evaluate. } - property var configuration_method: buttonBar.visible ? "auto" : "custom" //Auto if connected to a printer at start-up, or Custom if not. + property var configuration_method: is_connected ? "auto" : "custom" //Auto if connected to a printer at start-up, or Custom if not. - AutoConfiguration + Item { - id: autoConfiguration - visible: popupItem.configuration_method === "auto" - anchors.top: parent.top - } + width: parent.width + height: childrenRect.height + AutoConfiguration + { + id: autoConfiguration + visible: popupItem.configuration_method === "auto" + } - CustomConfiguration - { - id: customConfiguration - visible: popupItem.configuration_method === "custom" - anchors.top: parent.top + CustomConfiguration + { + id: customConfiguration + visible: popupItem.configuration_method === "custom" + } } Rectangle @@ -129,30 +133,19 @@ Cura.ExpandableComponent id: separator visible: buttonBar.visible - anchors - { - left: parent.left - right: parent.right - bottom: buttonBar.top - bottomMargin: UM.Theme.getSize("default_margin").height - } + width: parent.width height: UM.Theme.getSize("default_lining").height color: UM.Theme.getColor("lining") } //Allow switching between custom and auto. - Rectangle + Item { id: buttonBar visible: popupItem.is_connected //Switching only makes sense if the "auto" part is possible. - anchors - { - left: parent.left - right: parent.right - bottom: parent.bottom - } + width: parent.width height: childrenRect.height Cura.ActionButton diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index aa4cf3624b..d424f35ebe 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -11,6 +11,7 @@ import UM 1.3 as UM Item { width: parent.width + height: visible ? childrenRect.height : 0 Label { @@ -18,6 +19,7 @@ Item text: catalog.i18nc("@header", "Custom") font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") + height: contentHeight anchors { @@ -62,14 +64,15 @@ Item { id: tabControl width: parent.width + height: childrenRect.height anchors.top: tabBar.bottom - anchors.bottom: parent.bottom property var model: extrudersModel.items[tabBar.currentIndex] property real textWidth: Math.round(width * 0.3) property real controlWidth: width - textWidth Column { spacing: UM.Theme.getSize("default_margin").height + Row { height: UM.Theme.getSize("print_setup_item").height @@ -165,6 +168,5 @@ Item } } } - } } \ No newline at end of file -- cgit v1.2.3 From 4c26262054877c502e9244d06df9c2dce138c365 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 22 Nov 2018 17:06:56 +0100 Subject: Use re-usable TabRow component Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index d424f35ebe..50ff108431 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -29,22 +29,19 @@ Item } } - TabBar + UM.TabRow { id: tabBar - onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) anchors.top: header.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - width: parent.width - height: 50 + + onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) + Repeater { model: extrudersModel - - delegate: TabButton + delegate: UM.TabRowButton { - width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0 - height: parent.height contentItem: Item { Cura.ExtruderIcon -- cgit v1.2.3 From 90a73f351da7bfa695ab5fcb6e9e9361e6200a44 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 14:12:34 +0100 Subject: Fix positioning of tabs in custom menu The label's bottom side is at its top, so we must add its height so that it gets positioned correctly. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 50ff108431..25111a9365 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -33,7 +33,7 @@ Item { id: tabBar anchors.top: header.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height + header.height onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) @@ -114,7 +114,7 @@ Item property var hasActiveExtruder: activeExtruder != null property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : "" property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true - property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported + property var valueWarning: !Cura.MachineManager.isActiveQualitySupported text: currentRootMaterialName tooltip: currentRootMaterialName @@ -131,7 +131,6 @@ Item { extruderIndex: Cura.ExtruderManager.activeExtruderIndex } - } } -- cgit v1.2.3 From ac5f79ba2ced74cb13fe1fc00fe328f0b7d5a8a0 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 15:47:32 +0100 Subject: Add tab style to tabbed content It now gets a proper background colour, lining and radius. Contributes to issue CURA-5876. --- .../ConfigurationMenu/CustomConfiguration.qml | 35 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 25111a9365..1f7673cd0a 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.0 +import QtQuick 2.6 import QtQuick.Controls 2.0 import QtQuick.Controls 1.1 as OldControls @@ -33,7 +33,7 @@ Item { id: tabBar anchors.top: header.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + header.height + anchors.topMargin: UM.Theme.getSize("default_margin").height onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) @@ -57,17 +57,46 @@ Item } } - Item + Rectangle { id: tabControl width: parent.width height: childrenRect.height anchors.top: tabBar.bottom + + radius: UM.Theme.getSize("default_radius").width + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("lining") + color: UM.Theme.getColor("secondary") + + //Remove rounding and lining at the top. + Rectangle + { + width: parent.width + height: parent.radius + anchors.top: parent.top + color: UM.Theme.getColor("lining") + Rectangle + { + anchors + { + left: parent.left + leftMargin: parent.parent.border.width + right: parent.right + rightMargin: parent.parent.border.width + top: parent.top + } + height: parent.parent.radius + color: parent.parent.color + } + } + property var model: extrudersModel.items[tabBar.currentIndex] property real textWidth: Math.round(width * 0.3) property real controlWidth: width - textWidth Column { + padding: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").height Row -- cgit v1.2.3 From 4b897ffd67a5572f305a981cba79ace625d086d9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 16:03:40 +0100 Subject: Fix width of content in tabbed content Contributes to issue CURA-5876. --- .../ConfigurationMenu/CustomConfiguration.qml | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 1f7673cd0a..78448d5be5 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -59,7 +59,6 @@ Item Rectangle { - id: tabControl width: parent.width height: childrenRect.height anchors.top: tabBar.bottom @@ -91,14 +90,18 @@ Item } } - property var model: extrudersModel.items[tabBar.currentIndex] - property real textWidth: Math.round(width * 0.3) - property real controlWidth: width - textWidth Column { + id: selectors padding: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").height + property var model: extrudersModel.items[tabBar.currentIndex] + + readonly property real paddedWidth: parent.width - padding * 2 + property real textWidth: Math.round(paddedWidth * 0.3) + property real controlWidth: paddedWidth - textWidth + Row { height: UM.Theme.getSize("print_setup_item").height @@ -110,13 +113,13 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") height: parent.height - width: tabControl.textWidth + width: selectors.textWidth } OldControls.CheckBox { - checked: tabControl.model != null ? Cura.MachineManager.getExtruder(tabControl.model.index).isEnabled: false - onClicked: Cura.MachineManager.setExtruderEnabled(tabControl.model.index, checked) + checked: selectors.model != null ? Cura.MachineManager.getExtruder(selectors.model.index).isEnabled: false + onClicked: Cura.MachineManager.setExtruderEnabled(selectors.model.index, checked) height: UM.Theme.getSize("setting_control").height style: UM.Theme.styles.checkbox } @@ -132,7 +135,7 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") height: parent.height - width: tabControl.textWidth + width: selectors.textWidth } OldControls.ToolButton @@ -152,7 +155,7 @@ Item enabled: Cura.ExtruderManager.activeExtruderIndex > -1 height: UM.Theme.getSize("setting_control").height - width: tabControl.controlWidth + width: selectors.controlWidth style: UM.Theme.styles.sidebar_header_button activeFocusOnPress: true @@ -174,7 +177,7 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") height: parent.height - width: tabControl.textWidth + width: selectors.textWidth } OldControls.ToolButton @@ -185,7 +188,7 @@ Item visible: Cura.MachineManager.hasVariants height: UM.Theme.getSize("setting_control").height - width: tabControl.controlWidth + width: selectors.controlWidth style: UM.Theme.styles.sidebar_header_button activeFocusOnPress: true; -- cgit v1.2.3 From 87a0dc65e17742760fe7b551e2b8b5c4db0035a2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 17:09:36 +0100 Subject: Add list of available configurations to AutoConfiguration This is the main item it needs to display. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml index cde18ab488..8e86549e17 100644 --- a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml @@ -5,6 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import UM 1.3 as UM +import Cura 1.0 as Cura Item { @@ -26,4 +27,13 @@ Item right: parent.right } } + + ConfigurationListView + { + anchors.top: header.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").width + width: parent.width + + outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null + } } \ No newline at end of file -- cgit v1.2.3 From a268c95559fcfda0e90048c666a1c9e3ed62f002 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 17:10:56 +0100 Subject: Remove double header This header is no longer necessary since the AutoConfiguration item provides its own header that doesn't scroll along. Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 7aaf87b4df..ef967dfa35 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -12,7 +12,6 @@ Column { id: base property var outputDevice: null - property var computedHeight: container.height + configurationListHeading.height + 3 * padding height: childrenRect.height + 2 * padding padding: UM.Theme.getSize("default_margin").width spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) @@ -27,15 +26,6 @@ Column } } - Label - { - id: configurationListHeading - text: catalog.i18nc("@label:header configurations", "Available configurations") - font: UM.Theme.getFont("large") - width: parent.width - 2 * parent.padding - color: UM.Theme.getColor("configuration_item_text") - } - Component { id: sectionHeading -- cgit v1.2.3 From 3b219e3ac331e3404867433e1f968d2a29be4fa6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 17:13:25 +0100 Subject: Remove padding The padding is already done by the enveloping Column and its parent popupItem. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index ef967dfa35..be9aad6d04 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -13,7 +13,6 @@ Column id: base property var outputDevice: null height: childrenRect.height + 2 * padding - padding: UM.Theme.getSize("default_margin").width spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) function forceModelUpdate() -- cgit v1.2.3 From a03e1be6011362cb044cc589373640e60aab1e5a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 17:19:32 +0100 Subject: Simplify sectionHeading element No need to define that component in a higher location, just define it where you need it. Also, no need to use a Rectangle for this if it has no colour, just use an Item, but the Item itself is also not necessary if you just need the padding. Contributes to issue CURA-5876. --- .../ConfigurationMenu/ConfigurationListView.qml | 23 +++++++--------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index be9aad6d04..25dc3fac11 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -25,21 +25,6 @@ Column } } - Component - { - id: sectionHeading - Rectangle - { - height: childrenRect.height + UM.Theme.getSize("default_margin").height - Label - { - text: section - font: UM.Theme.getFont("default_bold") - color: UM.Theme.getColor("configuration_item_text") - } - } - } - ScrollView { id: container @@ -58,7 +43,13 @@ Column section.property: "modelData.printerType" section.criteria: ViewSection.FullString - section.delegate: sectionHeading + section.delegate: Label + { + text: section + font: UM.Theme.getFont("default_bold") + color: UM.Theme.getColor("configuration_item_text") + bottomPadding: UM.Theme.getSize("default_margin").height + } model: (outputDevice != null) ? outputDevice.uniqueConfigurations : [] delegate: ConfigurationItem -- cgit v1.2.3 From a3fe9839baafe17c2c221a50c16f590d5b1acd39 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 17:33:37 +0100 Subject: Change all uses of 'small' and 'very small' fonts to default These two fonts are exactly the same, but I want to use the 'small' font to be something a bit smaller. I'm 'removing' the superfluous font but will be re-using it immediately to look a bit smaller. Contributes to issue CURA-5876. --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 8 ++++---- .../Toolbox/resources/qml/ToolboxCompatibilityChart.qml | 2 +- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 16 ++++++++-------- .../Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 2 +- .../resources/qml/MonitorBuildplateConfiguration.qml | 2 +- .../resources/qml/MonitorExtruderConfiguration.qml | 4 ++-- resources/qml/ActionPanel/OutputProcessWidget.qml | 4 ++-- resources/qml/ActionPanel/PrintJobInformation.qml | 8 ++++---- resources/qml/ActionPanel/SliceProcessWidget.qml | 2 +- resources/qml/IconLabel.qml | 2 +- resources/qml/JobSpecs.qml | 2 +- .../Menus/ConfigurationMenu/ConfigurationListView.qml | 2 +- resources/qml/PrinterOutput/ExtruderBox.qml | 2 +- resources/qml/PrinterOutput/HeatedBedBox.qml | 2 +- resources/qml/PrinterOutput/OutputDeviceHeader.qml | 4 ++-- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 4aaea20813..9c1df0c49e 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -86,13 +86,13 @@ Item Label { text: catalog.i18nc("@label", "Website") + ":" - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } Label { text: catalog.i18nc("@label", "Email") + ":" - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } } @@ -118,7 +118,7 @@ Item } return "" } - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) @@ -134,7 +134,7 @@ Item } return "" } - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index 62e1e3ab86..6a01d7ff2f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -210,7 +210,7 @@ Item } return result } - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 437a2ef351..90f372cf87 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -82,25 +82,25 @@ Item Label { text: catalog.i18nc("@label", "Version") + ":" - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } Label { text: catalog.i18nc("@label", "Last updated") + ":" - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } Label { text: catalog.i18nc("@label", "Author") + ":" - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } Label { text: catalog.i18nc("@label", "Downloads") + ":" - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } } @@ -119,7 +119,7 @@ Item Label { text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } Label @@ -133,7 +133,7 @@ Item var date = new Date(details.last_updated) return date.toLocaleString(UM.Preferences.getValue("general/language")) } - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } Label @@ -153,7 +153,7 @@ Item return "" + details.author_name + "" } } - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) @@ -161,7 +161,7 @@ Item Label { text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown")) - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 887140bbfa..be44c0f374 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -81,7 +81,7 @@ Item width: parent.width wrapMode: Text.WordWrap color: UM.Theme.getColor("text_medium") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") } } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml index 9ffb1eabb4..7edeb81a96 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml @@ -52,7 +52,7 @@ Item id: buildplateLabel color: "#191919" // TODO: Theme! elide: Text.ElideRight - font: UM.Theme.getFont("very_small") // 12pt, regular + font: UM.Theme.getFont("default") // 12pt, regular text: "" // FIXED-LINE-HEIGHT: diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorExtruderConfiguration.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorExtruderConfiguration.qml index afbd4c3641..1e53191d8c 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorExtruderConfiguration.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorExtruderConfiguration.qml @@ -49,7 +49,7 @@ Item } color: "#191919" // TODO: Theme! elide: Text.ElideRight - font: UM.Theme.getFont("very_small") // 12pt, regular + font: UM.Theme.getFont("default") // 12pt, regular text: "" // FIXED-LINE-HEIGHT: @@ -66,7 +66,7 @@ Item } color: "#191919" // TODO: Theme! elide: Text.ElideRight - font: UM.Theme.getFont("small") // 12pt, bold + font: UM.Theme.getFont("default_bold") // 12pt, bold text: "" // FIXED-LINE-HEIGHT: diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index 6f9e6a02c3..296ee2fc16 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -50,7 +50,7 @@ Column text: PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long) source: UM.Theme.getIcon("clock") - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default_bold") } Cura.IconLabel @@ -79,7 +79,7 @@ Column return totalWeights + "g · " + totalLengths.toFixed(2) + "m" } source: UM.Theme.getIcon("spool") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") } } diff --git a/resources/qml/ActionPanel/PrintJobInformation.qml b/resources/qml/ActionPanel/PrintJobInformation.qml index e53a92a994..b1172a91e0 100644 --- a/resources/qml/ActionPanel/PrintJobInformation.qml +++ b/resources/qml/ActionPanel/PrintJobInformation.qml @@ -31,7 +31,7 @@ Column { text: catalog.i18nc("@label", "Time specification").toUpperCase() color: UM.Theme.getColor("primary") - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default_bold") renderType: Text.NativeRendering } @@ -62,7 +62,7 @@ Column } width: parent.width - 2 * UM.Theme.getSize("default_margin").width color: UM.Theme.getColor("text") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") renderType: Text.NativeRendering textFormat: Text.RichText } @@ -81,7 +81,7 @@ Column { text: catalog.i18nc("@label", "Material specification").toUpperCase() color: UM.Theme.getColor("primary") - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default_bold") renderType: Text.NativeRendering } @@ -153,7 +153,7 @@ Column } width: parent.width - 2 * UM.Theme.getSize("default_margin").width color: UM.Theme.getColor("text") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") renderType: Text.NativeRendering textFormat: Text.RichText } diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 09e0b2584a..9ce86463f8 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -49,7 +49,7 @@ Column text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice") source: UM.Theme.getIcon("warning") color: UM.Theme.getColor("warning") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") } // Progress bar, only visible when the backend is in the process of slice the printjob diff --git a/resources/qml/IconLabel.qml b/resources/qml/IconLabel.qml index 7c90382892..1f15e0823f 100644 --- a/resources/qml/IconLabel.qml +++ b/resources/qml/IconLabel.qml @@ -43,7 +43,7 @@ Item anchors.verticalCenter: icon.verticalCenter text: "Empty label" color: UM.Theme.getColor("text") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") renderType: Text.NativeRendering } } \ No newline at end of file diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 45111992c1..717d6e925b 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -124,7 +124,7 @@ Item { } height: UM.Theme.getSize("jobspecs_line").height verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default_bold") color: UM.Theme.getColor("text_scene") text: CuraApplication.getSceneBoundingBoxString } diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 25dc3fac11..8a7094497e 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -46,7 +46,7 @@ Column section.delegate: Label { text: section - font: UM.Theme.getFont("default_bold") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("configuration_item_text") bottomPadding: UM.Theme.getSize("default_margin").height } diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index 510a44f9da..d72f9ba0b2 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -45,7 +45,7 @@ Item { id: extruderTargetTemperature text: Math.round(extruderModel.targetHotendTemperature) + "°C" - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default_bold") color: UM.Theme.getColor("text_inactive") anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 962ffa9b01..59f7fa7bc6 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -34,7 +34,7 @@ Item { id: bedTargetTemperature text: printerModel != null ? printerModel.targetBedTemperature + "°C" : "" - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default_bold") color: UM.Theme.getColor("text_inactive") anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width diff --git a/resources/qml/PrinterOutput/OutputDeviceHeader.qml b/resources/qml/PrinterOutput/OutputDeviceHeader.qml index b5ed1b7b4e..4e81d852bb 100644 --- a/resources/qml/PrinterOutput/OutputDeviceHeader.qml +++ b/resources/qml/PrinterOutput/OutputDeviceHeader.qml @@ -43,7 +43,7 @@ Item { id: outputDeviceAddressLabel text: (outputDevice != null && outputDevice.address != null) ? outputDevice.address : "" - font: UM.Theme.getFont("small") + font: UM.Theme.getFont("default_bold") color: UM.Theme.getColor("text_inactive") anchors.top: parent.top anchors.right: parent.right @@ -54,7 +54,7 @@ Item { text: outputDevice != null ? "" : catalog.i18nc("@info:status", "The printer is not connected.") color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") wrapMode: Text.WordWrap anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width -- cgit v1.2.3 From 7f2f2090da66caa3686de27c3f5d6474aeeab8fe Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Nov 2018 17:35:58 +0100 Subject: Make small and very_small fonts actually smaller Rather than the same as default_bold and default. This also makes the extruder_icon font obsolete. Turns out it's actually just a very small font. Contributes to issue CURA-5876. --- resources/qml/ExtruderIcon.qml | 2 +- resources/themes/cura-light/theme.json | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index c103ee245c..7151719fb9 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -49,7 +49,7 @@ Item id: extruderNumberText anchors.centerIn: parent text: index + 1 - font: UM.Theme.getFont("extruder_icon") + font: UM.Theme.getFont("very_small") width: contentWidth height: contentHeight visible: extruderEnabled diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 57007827a8..a51b397262 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -41,12 +41,12 @@ "family": "Noto Sans" }, "small": { - "size": 1.0, - "weight": 63, + "size": 0.85, + "weight": 50, "family": "Noto Sans" }, "very_small": { - "size": 1.0, + "size": 0.7, "weight": 50, "family": "Noto Sans" }, @@ -64,12 +64,6 @@ "size": 1.15, "weight": 50, "family": "Noto Sans" - }, - "extruder_icon": - { - "size": 0.7, - "weight": 50, - "family": "Noto Sans" } }, -- cgit v1.2.3 From 4be8af7cb278fc8f1a7118d1cfbc9ba02d47cd80 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 09:38:32 +0100 Subject: Restyle printer type headers It's now a grey box with the printer type name inside and some padding and such. Contributes to issue CURA-5876. --- .../ConfigurationMenu/ConfigurationListView.qml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 8a7094497e..2f5bf0b1a2 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -43,12 +43,24 @@ Column section.property: "modelData.printerType" section.criteria: ViewSection.FullString - section.delegate: Label + section.delegate: Item { - text: section - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("configuration_item_text") - bottomPadding: UM.Theme.getSize("default_margin").height + height: printerTypeLabelBox.height + UM.Theme.getSize("default_margin").height + Rectangle + { + id: printerTypeLabelBox + color: UM.Theme.getColor("text_detail") + width: childrenRect.width + height: childrenRect.height + + Label + { + text: section + font: UM.Theme.getFont("small") + color: UM.Theme.getColor("configuration_item_text") + padding: UM.Theme.getSize("narrow_margin").width + } + } } model: (outputDevice != null) ? outputDevice.uniqueConfigurations : [] -- cgit v1.2.3 From c489f911fb2b16bef7dfa5a4bac76ee83620d13b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 11:04:41 +0100 Subject: Use QtQuick 2.0 and simplify ConfigurationItem It now uses a ButtonGroup (from QtQuick2). Also, all the mess with when the border and background colours are updated and force-updated and such is now cleaned up. Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/ConfigurationItem.qml | 173 ++++++++------------- .../ConfigurationMenu/ConfigurationListView.qml | 10 +- 2 files changed, 75 insertions(+), 108 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 7427b5ddff..d825a8cc6e 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -7,143 +7,108 @@ import QtQuick.Controls 2.0 import UM 1.2 as UM import Cura 1.0 as Cura -Rectangle +Button { id: configurationItem property var configuration: null - property var selected: false signal activateConfiguration() height: childrenRect.height - border.width: UM.Theme.getSize("default_lining").width - border.color: updateBorderColor() - color: selected ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item") - property var textColor: selected ? UM.Theme.getColor("configuration_item_text_active") : UM.Theme.getColor("configuration_item_text") - function updateBorderColor() - { - border.color = selected ? UM.Theme.getColor("configuration_item_border_active") : UM.Theme.getColor("configuration_item_border") - } + property var textColor: checked ? UM.Theme.getColor("configuration_item_text_active") : UM.Theme.getColor("configuration_item_text") - Column + contentItem: Rectangle { - id: contentColumn - width: parent.width - padding: UM.Theme.getSize("default_margin").width - spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) + height: childrenRect.height + color: parent.checked ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item") + border.color: (parent.checked || parent.hovered) ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width - Row + Column { - id: extruderRow - - width: parent.width - 2 * parent.padding - height: childrenRect.height + id: contentColumn + width: parent.width + padding: UM.Theme.getSize("default_margin").width + spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) - spacing: UM.Theme.getSize("default_margin").width - - Repeater + Row { - id: repeater + id: extruderRow + + width: parent.width - 2 * parent.padding height: childrenRect.height - model: configuration.extruderConfigurations - delegate: PrintCoreConfiguration + + spacing: UM.Theme.getSize("default_margin").width + + Repeater { - width: Math.round(parent.width / 2) - printCoreConfiguration: modelData - mainColor: textColor + id: repeater + height: childrenRect.height + model: configuration.extruderConfigurations + delegate: PrintCoreConfiguration + { + width: Math.round(parent.width / 2) + printCoreConfiguration: modelData + mainColor: textColor + } } } - } - //Buildplate row separator - Rectangle - { - id: separator - - visible: buildplateInformation.visible - width: parent.width - 2 * parent.padding - height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0 - color: textColor - } + //Buildplate row separator + Rectangle + { + id: separator - Item - { - id: buildplateInformation - width: parent.width - 2 * parent.padding - height: childrenRect.height - visible: configuration.buildplateConfiguration != "" - - UM.RecolorImage { - id: buildplateIcon - anchors.left: parent.left - width: UM.Theme.getSize("main_window_header_button_icon").width - height: UM.Theme.getSize("main_window_header_button_icon").height - sourceSize.width: width - sourceSize.height: height - source: UM.Theme.getIcon("buildplate") + visible: buildplateInformation.visible + width: parent.width - 2 * parent.padding + height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0 color: textColor } - Label + Item { - id: buildplateLabel - anchors.left: buildplateIcon.right - anchors.verticalCenter: buildplateIcon.verticalCenter - anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2) - text: configuration.buildplateConfiguration - renderType: Text.NativeRendering - color: textColor - } - } - } + id: buildplateInformation + width: parent.width - 2 * parent.padding + height: childrenRect.height + visible: configuration.buildplateConfiguration != "" + + UM.RecolorImage { + id: buildplateIcon + anchors.left: parent.left + width: UM.Theme.getSize("main_window_header_button_icon").width + height: UM.Theme.getSize("main_window_header_button_icon").height + sourceSize.width: width + sourceSize.height: height + source: UM.Theme.getIcon("buildplate") + color: textColor + } - MouseArea - { - id: mouse - anchors.fill: parent - onClicked: activateConfiguration() - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - onEntered: - { - parent.border.color = UM.Theme.getColor("configuration_item_border_hover") - if (configurationItem.selected == false) - { - configurationItem.color = UM.Theme.getColor("wide_lining") + Label + { + id: buildplateLabel + anchors.left: buildplateIcon.right + anchors.verticalCenter: buildplateIcon.verticalCenter + anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2) + text: configuration.buildplateConfiguration + renderType: Text.NativeRendering + color: textColor + } } } - onExited: + + Connections { - updateBorderColor() - if (configurationItem.selected == false) + target: Cura.MachineManager + onCurrentConfigurationChanged: { - configurationItem.color = UM.Theme.getColor("configuration_item") + configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration) } } - } - Connections - { - target: Cura.MachineManager - onCurrentConfigurationChanged: { - configurationItem.selected = Cura.MachineManager.matchesConfiguration(configuration) - updateBorderColor() - } - } - - Component.onCompleted: - { - configurationItem.selected = Cura.MachineManager.matchesConfiguration(configuration) - updateBorderColor() - } - - onVisibleChanged: - { - if(visible) + Component.onCompleted: { - // I cannot trigger function updateBorderColor() after visibility change - color = selected ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item") + configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration) } } } \ No newline at end of file diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 2f5bf0b1a2..7df93b9cbe 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -2,8 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.4 import UM 1.2 as UM import Cura 1.0 as Cura @@ -31,8 +30,10 @@ Column width: parent.width - parent.padding height: Math.min(configurationList.contentHeight, 350 * screenScaleFactor) - style: UM.Theme.styles.scrollview - __wheelAreaScrollSpeed: 75 // Scroll three lines in one scroll event + ButtonGroup + { + buttons: configurationList.children + } ListView { @@ -64,6 +65,7 @@ Column } model: (outputDevice != null) ? outputDevice.uniqueConfigurations : [] + delegate: ConfigurationItem { width: parent.width - UM.Theme.getSize("default_margin").width -- cgit v1.2.3 From e05566865a9d5333d1dbf444b62a3ecbd4a29445 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 11:19:03 +0100 Subject: Use ExtruderIcon component to display extruder icon Since we already have that component pre-designed, let's use it. Contributes to issue CURA-5876. --- .../ConfigurationMenu/PrintCoreConfiguration.qml | 34 ++++------------------ 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index 97b5bee745..e8cadda05e 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import UM 1.2 as UM - +import Cura 1.0 as Cura Column { @@ -33,37 +33,13 @@ Column color: mainColor } - // Rounded item to show the extruder number - Item + Cura.ExtruderIcon { - id: extruderIconItem - anchors.verticalCenter: extruderLabel.verticalCenter - anchors.left: extruderLabel.right - anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) - width: UM.Theme.getSize("section_icon").width height: UM.Theme.getSize("section_icon").height - - UM.RecolorImage { - id: mainCircle - anchors.fill: parent - - anchors.centerIn: parent - sourceSize.width: parent.width - sourceSize.height: parent.height - source: UM.Theme.getIcon("extruder_button") - color: mainColor - } - - Label - { - id: extruderNumberText - anchors.centerIn: parent - text: printCoreConfiguration.position + 1 - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") - color: mainColor - } + materialColor: mainColor + anchors.left: extruderLabel.right + anchors.leftMargin: UM.Theme.getSize("narrow_margin").width } } -- cgit v1.2.3 From 6876c12106e32d74a1d492eac6d95fc9130a8474 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 11:43:32 +0100 Subject: Remove weird padding from button I don't know why the default Button has padding everywhere, but I don't want it. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index d825a8cc6e..a6778702d1 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -15,6 +15,9 @@ Button signal activateConfiguration() height: childrenRect.height + padding: 0 //Stupid QML button has spacing by default. + rightPadding: 0 + leftPadding: 0 property var textColor: checked ? UM.Theme.getColor("configuration_item_text_active") : UM.Theme.getColor("configuration_item_text") @@ -73,7 +76,8 @@ Button height: childrenRect.height visible: configuration.buildplateConfiguration != "" - UM.RecolorImage { + UM.RecolorImage + { id: buildplateIcon anchors.left: parent.left width: UM.Theme.getSize("main_window_header_button_icon").width -- cgit v1.2.3 From a2b1f5397962d5e4da7511e54eef4e7a1ad235a0 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 11:53:17 +0100 Subject: Use normal text colour instead of specialised configuration item text They were the same anyway, and they should always be the same. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 10 ++++------ .../qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 2 +- resources/themes/cura-light/theme.json | 2 -- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index a6778702d1..6a6f0ea834 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -19,8 +19,6 @@ Button rightPadding: 0 leftPadding: 0 - property var textColor: checked ? UM.Theme.getColor("configuration_item_text_active") : UM.Theme.getColor("configuration_item_text") - contentItem: Rectangle { height: childrenRect.height @@ -53,7 +51,7 @@ Button { width: Math.round(parent.width / 2) printCoreConfiguration: modelData - mainColor: textColor + mainColor: UM.Theme.getColor("text") } } } @@ -66,7 +64,7 @@ Button visible: buildplateInformation.visible width: parent.width - 2 * parent.padding height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0 - color: textColor + color: UM.Theme.getColor("text") } Item @@ -85,7 +83,7 @@ Button sourceSize.width: width sourceSize.height: height source: UM.Theme.getIcon("buildplate") - color: textColor + color: UM.Theme.getColor("text") } Label @@ -96,7 +94,7 @@ Button anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2) text: configuration.buildplateConfiguration renderType: Text.NativeRendering - color: textColor + color: UM.Theme.getColor("text") } } } diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 7df93b9cbe..2b7444be01 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -58,7 +58,7 @@ Column { text: section font: UM.Theme.getFont("small") - color: UM.Theme.getColor("configuration_item_text") + color: UM.Theme.getColor("text") padding: UM.Theme.getSize("narrow_margin").width } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index a51b397262..383159fd91 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -319,8 +319,6 @@ "configuration_item": [255, 255, 255, 0], "configuration_item_active": [12, 169, 227, 32], - "configuration_item_text": [0, 0, 0, 255], - "configuration_item_text_active": [0, 0, 0, 255], "configuration_item_border": [127, 127, 127, 255], "configuration_item_border_active": [12, 169, 227, 32], "configuration_item_border_hover": [50, 130, 255, 255], -- cgit v1.2.3 From e58409b1ef07885a7e7d1807cbf243fc15deaf47 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 12:51:52 +0100 Subject: Correct colours for the selected configuration This should always be the same as the ExpandableComponent's background, so white when it's not active and light blue when it's active, regardless of theme. The naming of this theme entry is a bit weird because the ActionButton theme is used for ExpandableComponent and now for ConfigurationItem as well, but that's why we should NEVER name these theme entries to something specific to one item. Oh well, I'm not about to refactor that now with all the branches going on everywhere. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 6a6f0ea834..98f777d3f3 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -22,7 +22,7 @@ Button contentItem: Rectangle { height: childrenRect.height - color: parent.checked ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item") + color: parent.checked ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") border.color: (parent.checked || parent.hovered) ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width -- cgit v1.2.3 From 0be2453daf29080111f622e371708fd970946336 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 12:55:07 +0100 Subject: Update style of border of configuration items Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 98f777d3f3..278381dc5a 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -23,8 +23,8 @@ Button { height: childrenRect.height color: parent.checked ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") - border.color: (parent.checked || parent.hovered) ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") - border.width: UM.Theme.getSize("default_lining").width + border.color: parent.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") + border.width: parent.hovered ? UM.Theme.getSize("thick_lining").width : UM.Theme.getSize("default_lining").width Column { -- cgit v1.2.3 From e751b59b1cd13855b413d79ef8a950bb53b7287b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 12:55:58 +0100 Subject: Remove unused configuration item theme entries The theme of configuration items is now in sync with the rest of the interface. Contributes to issue CURA-5876. --- resources/themes/cura-dark/theme.json | 8 -------- resources/themes/cura-light/theme.json | 6 ------ 2 files changed, 14 deletions(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 62b1dbfa0f..40016c5a94 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -197,14 +197,6 @@ "layerview_support_interface": [64, 192, 255, 255], "layerview_nozzle": [181, 166, 66, 120], - "configuration_item": [0, 0, 0, 0], - "configuration_item_active": [12, 169, 227, 179], - "configuration_item_text": [255, 255, 255, 255], - "configuration_item_text_active": [255, 255, 255, 255], - "configuration_item_border": [255, 255, 255, 255], - "configuration_item_border_active": [12, 169, 227, 179], - "configuration_item_border_hover": [12, 169, 227, 179], - "material_compatibility_warning": [255, 255, 255, 255], "quality_slider_unavailable": [179, 179, 179, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 383159fd91..de9b48c7f0 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -317,12 +317,6 @@ "layerview_support_interface": [64, 192, 255, 255], "layerview_nozzle": [181, 166, 66, 50], - "configuration_item": [255, 255, 255, 0], - "configuration_item_active": [12, 169, 227, 32], - "configuration_item_border": [127, 127, 127, 255], - "configuration_item_border_active": [12, 169, 227, 32], - "configuration_item_border_hover": [50, 130, 255, 255], - "tab_status_connected": [50, 130, 255, 255], "tab_status_disconnected": [200, 200, 200, 255], -- cgit v1.2.3 From 81cadf702cedea664c1071d46e5261c1dc592b93 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 13:00:51 +0100 Subject: Give configuration items a rounded radius Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 278381dc5a..f04e856705 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -25,6 +25,7 @@ Button color: parent.checked ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") border.color: parent.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") border.width: parent.hovered ? UM.Theme.getSize("thick_lining").width : UM.Theme.getSize("default_lining").width + radius: UM.Theme.getSize("default_radius").width Column { -- cgit v1.2.3 From c6a9aca34602c0e5a32c7f308055fcd9815a2bbb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 13:05:32 +0100 Subject: Switch checked and hovered themes I misunderstood the theme as it was in the screenshots. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index f04e856705..2988ab9eec 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -22,9 +22,9 @@ Button contentItem: Rectangle { height: childrenRect.height - color: parent.checked ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") - border.color: parent.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") - border.width: parent.hovered ? UM.Theme.getSize("thick_lining").width : UM.Theme.getSize("default_lining").width + color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") + border.color: parent.checked ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") + border.width: parent.checked ? UM.Theme.getSize("thick_lining").width : UM.Theme.getSize("default_lining").width radius: UM.Theme.getSize("default_radius").width Column -- cgit v1.2.3 From 89126c7323a6764cbe3c961953e3361f4581b641 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 13:08:41 +0100 Subject: Use background instead of contentItem This way the padding and such doesn't matter any more. And the original background disappears, which was unthemed and still behind the original contentItem. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 2988ab9eec..297c95d1d1 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -15,11 +15,8 @@ Button signal activateConfiguration() height: childrenRect.height - padding: 0 //Stupid QML button has spacing by default. - rightPadding: 0 - leftPadding: 0 - contentItem: Rectangle + background: Rectangle { height: childrenRect.height color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") -- cgit v1.2.3 From b15c272d235c36edc5056aace5293f287d430144 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 13:24:13 +0100 Subject: Fix applying configuration when clicking Also no longer use that signal for it. It was completely unnecessary. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 6 +++++- resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 297c95d1d1..69c0b11882 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -12,7 +12,6 @@ Button id: configurationItem property var configuration: null - signal activateConfiguration() height: childrenRect.height @@ -111,4 +110,9 @@ Button configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration) } } + + onClicked: + { + Cura.MachineManager.applyRemoteConfiguration(configuration) + } } \ No newline at end of file diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 2b7444be01..86deae9c4e 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -70,11 +70,6 @@ Column { width: parent.width - UM.Theme.getSize("default_margin").width configuration: modelData - onActivateConfiguration: - { - switchPopupState() - Cura.MachineManager.applyRemoteConfiguration(configuration) - } } } } -- cgit v1.2.3 From cf8d88054d8ded00237ee95587b5e0366060794e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 13:29:57 +0100 Subject: Use proper colour for material in configuration item No idea this would be so easy. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index e8cadda05e..ae21a19f5e 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -37,7 +37,7 @@ Column { width: UM.Theme.getSize("section_icon").width height: UM.Theme.getSize("section_icon").height - materialColor: mainColor + materialColor: printCoreConfiguration.material.color anchors.left: extruderLabel.right anchors.leftMargin: UM.Theme.getSize("narrow_margin").width } -- cgit v1.2.3 From bb9598afd1c2162d461ea8c456da6f0b54e228e9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 13:55:54 +0100 Subject: Redesign layout of configuration item contents This is the new design. Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/ConfigurationItem.qml | 1 - .../ConfigurationMenu/PrintCoreConfiguration.qml | 69 ++++++++++------------ resources/themes/cura-light/theme.json | 2 +- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 69c0b11882..ffe3b32926 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -48,7 +48,6 @@ Button { width: Math.round(parent.width / 2) printCoreConfiguration: modelData - mainColor: UM.Theme.getColor("text") } } } diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index ae21a19f5e..dc908fdb0b 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -7,61 +7,52 @@ import QtQuick.Controls 2.0 import UM 1.2 as UM import Cura 1.0 as Cura -Column +Row { id: extruderInfo property var printCoreConfiguration - property var mainColor: "black" - spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) height: childrenRect.height + spacing: UM.Theme.getSize("default_margin").width + //Extruder icon. Item { - id: extruder - width: parent.width - height: childrenRect.height + width: childrenRect.width + height: information.height + Cura.ExtruderIcon + { + materialColor: printCoreConfiguration.material.color + anchors.verticalCenter: parent.verticalCenter + } + } + Column + { + id: information Label { - id: extruderLabel - text: catalog.i18nc("@label:extruder label", "Extruder") + text: printCoreConfiguration.material.brand renderType: Text.NativeRendering elide: Text.ElideRight - anchors.left: parent.left font: UM.Theme.getFont("default") - color: mainColor + color: UM.Theme.getColor("text") } - - Cura.ExtruderIcon + Label { - width: UM.Theme.getSize("section_icon").width - height: UM.Theme.getSize("section_icon").height - materialColor: printCoreConfiguration.material.color - anchors.left: extruderLabel.right - anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + text: printCoreConfiguration.material.name + renderType: Text.NativeRendering + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + } + Label + { + text: printCoreConfiguration.hotendID + renderType: Text.NativeRendering + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") } - } - - Label - { - id: materialLabel - text: printCoreConfiguration.material.name - renderType: Text.NativeRendering - elide: Text.ElideRight - width: parent.width - font: UM.Theme.getFont("default_bold") - color: mainColor - } - - Label - { - id: printCoreTypeLabel - text: printCoreConfiguration.hotendID - renderType: Text.NativeRendering - elide: Text.ElideRight - width: parent.width - font: UM.Theme.getFont("default") - color: mainColor } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index de9b48c7f0..824d4cf3ee 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -397,7 +397,7 @@ "thin_margin": [0.71, 0.71], "narrow_margin": [0.5, 0.5], - "extruder_icon": [1.8, 1.8], + "extruder_icon": [2.5, 2.5], "simple_mode_infill_caption": [0.0, 5.0], "simple_mode_infill_height": [0.0, 8.0], -- cgit v1.2.3 From 1555a1ab1787def2427449b1fbcde94d41893bbe Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 14:03:05 +0100 Subject: Make manufacturer and extruder labels lighter The proper colour would've been 'detail' but that seems to not be used much at all, and it's too light. In other places, 'inactive' is used in this place more often. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 2 +- resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 4aa8d66caa..202bc22ce0 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -64,7 +64,7 @@ Cura.ExpandableComponent text: model.material_brand elide: Text.ElideRight font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("text_inactive") anchors { diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index dc908fdb0b..5709cc948c 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -36,7 +36,7 @@ Row renderType: Text.NativeRendering elide: Text.ElideRight font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("text_inactive") } Label { @@ -52,7 +52,7 @@ Row renderType: Text.NativeRendering elide: Text.ElideRight font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("text_inactive") } } } -- cgit v1.2.3 From b0e9f23eee3c053c6179beeabbd1687a4dba0543 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 14:06:07 +0100 Subject: Correct line colour when hovered A detail that I almost missed in the design examples. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index ffe3b32926..2fbbef7130 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -19,7 +19,7 @@ Button { height: childrenRect.height color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") - border.color: parent.checked ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") + border.color: (parent.checked || parent.hovered) ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") border.width: parent.checked ? UM.Theme.getSize("thick_lining").width : UM.Theme.getSize("default_lining").width radius: UM.Theme.getSize("default_radius").width -- cgit v1.2.3 From 609f07399e7735801f728826990e53a390a5f206 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 14:20:47 +0100 Subject: Show extruder as disabled if either material or core is missing It basically just means you can't print with it. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index 5709cc948c..cc6461ebc4 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -24,6 +24,7 @@ Row { materialColor: printCoreConfiguration.material.color anchors.verticalCenter: parent.verticalCenter + extruderEnabled: printCoreConfiguration.material.name !== "" && printCoreConfiguration.hotendID !== "" } } -- cgit v1.2.3 From 956741922d561e2e7405554cf68b6c634c00f616 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 14:41:48 +0100 Subject: Make elements retain their position if hotend or material is missing Just a space makes it keep the correct height. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index cc6461ebc4..8d2f0c0f7c 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -33,7 +33,7 @@ Row id: information Label { - text: printCoreConfiguration.material.brand + text: printCoreConfiguration.material.brand ? printCoreConfiguration.material.brand : " " //Use space so that the height is still correct. renderType: Text.NativeRendering elide: Text.ElideRight font: UM.Theme.getFont("default") @@ -41,7 +41,7 @@ Row } Label { - text: printCoreConfiguration.material.name + text: printCoreConfiguration.material.name ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct. renderType: Text.NativeRendering elide: Text.ElideRight font: UM.Theme.getFont("default") @@ -49,7 +49,7 @@ Row } Label { - text: printCoreConfiguration.hotendID + text: printCoreConfiguration.hotendID ? printCoreConfiguration.hotendID : " " //Use space so that the height is still correct. renderType: Text.NativeRendering elide: Text.ElideRight font: UM.Theme.getFont("default") -- cgit v1.2.3 From 0a71a9dd3ecd5c16fa82a498698f3e937619b842 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 14:47:18 +0100 Subject: Increase margins around configuration item As per the design. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 2fbbef7130..3ea220c91e 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -27,7 +27,7 @@ Button { id: contentColumn width: parent.width - padding: UM.Theme.getSize("default_margin").width + padding: UM.Theme.getSize("wide_margin").width spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) Row -- cgit v1.2.3 From 55dd9be0629b5ac091628ea9184416da7edae972 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 15:11:13 +0100 Subject: Move PrinterTypeLabel to a more central location So that we can re-use it in other places too. Contributes to issue CURA-5876. --- resources/qml/PrinterSelector/PrinterTypeLabel.qml | 34 ---------------------- resources/qml/PrinterTypeLabel.qml | 34 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 resources/qml/PrinterSelector/PrinterTypeLabel.qml create mode 100644 resources/qml/PrinterTypeLabel.qml diff --git a/resources/qml/PrinterSelector/PrinterTypeLabel.qml b/resources/qml/PrinterSelector/PrinterTypeLabel.qml deleted file mode 100644 index cd9f3b9743..0000000000 --- a/resources/qml/PrinterSelector/PrinterTypeLabel.qml +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.7 -import QtQuick.Controls 2.1 - -import UM 1.1 as UM - -// This component creates a label with the abbreviated name of a printer, with a rectangle surrounding the label. -// It is created in a separated place in order to be reused whenever needed. -Item -{ - property alias text: printerTypeLabel.text - - width: UM.Theme.getSize("printer_type_label").width - height: UM.Theme.getSize("printer_type_label").height - - Rectangle - { - anchors.fill: parent - color: UM.Theme.getColor("printer_type_label_background") - } - - Label - { - id: printerTypeLabel - text: "CFFFP" // As an abbreviated name of the Custom FFF Printer - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - renderType: Text.NativeRendering - font: UM.Theme.getFont("very_small") - color: UM.Theme.getColor("text") - } -} \ No newline at end of file diff --git a/resources/qml/PrinterTypeLabel.qml b/resources/qml/PrinterTypeLabel.qml new file mode 100644 index 0000000000..cd9f3b9743 --- /dev/null +++ b/resources/qml/PrinterTypeLabel.qml @@ -0,0 +1,34 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.1 + +import UM 1.1 as UM + +// This component creates a label with the abbreviated name of a printer, with a rectangle surrounding the label. +// It is created in a separated place in order to be reused whenever needed. +Item +{ + property alias text: printerTypeLabel.text + + width: UM.Theme.getSize("printer_type_label").width + height: UM.Theme.getSize("printer_type_label").height + + Rectangle + { + anchors.fill: parent + color: UM.Theme.getColor("printer_type_label_background") + } + + Label + { + id: printerTypeLabel + text: "CFFFP" // As an abbreviated name of the Custom FFF Printer + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + renderType: Text.NativeRendering + font: UM.Theme.getFont("very_small") + color: UM.Theme.getColor("text") + } +} \ No newline at end of file -- cgit v1.2.3 From c1bb1a9b982d7e44b9dd0bc68b9b7e993dfc3712 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 15:12:44 +0100 Subject: Use normal font size for shorthand label This element had been designed when very_small was in the theme equal to default. I changed the entire application to use default instead of very_small and made very_small a smaller font, but didn't change that on the branch that this element was designed on. So now also change it here. Contributes to issue CURA-5876. --- resources/qml/PrinterTypeLabel.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrinterTypeLabel.qml b/resources/qml/PrinterTypeLabel.qml index cd9f3b9743..7feae32e16 100644 --- a/resources/qml/PrinterTypeLabel.qml +++ b/resources/qml/PrinterTypeLabel.qml @@ -28,7 +28,7 @@ Item anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter renderType: Text.NativeRendering - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } } \ No newline at end of file -- cgit v1.2.3 From 3ad2e4f62a5a7612ecf2372e0230a2362d7f3f66 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 15:24:58 +0100 Subject: Re-use PrinterTypeLabel component and use abbreviated name Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/ConfigurationListView.qml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 393c2715b2..c40eb5b9e9 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -46,21 +46,11 @@ Column section.criteria: ViewSection.FullString section.delegate: Item { - height: printerTypeLabelBox.height + UM.Theme.getSize("default_margin").height - Rectangle + height: printerTypeLabel.height + UM.Theme.getSize("default_margin").height + Cura.PrinterTypeLabel { - id: printerTypeLabelBox - color: UM.Theme.getColor("text_detail") - width: childrenRect.width - height: childrenRect.height - - Label - { - text: section - font: UM.Theme.getFont("small") - color: UM.Theme.getColor("text") - padding: UM.Theme.getSize("narrow_margin").width - } + id: printerTypeLabel + text: Cura.MachineManager.getAbbreviatedMachineName(section) } } -- cgit v1.2.3 From 41a5f05391dbc06dc4afde0321364e596ab8452b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 15:57:26 +0100 Subject: Remove SyncButton It hasn't been used now for a while. Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/SyncButton.qml | 102 --------------------- 1 file changed, 102 deletions(-) delete mode 100644 resources/qml/Menus/ConfigurationMenu/SyncButton.qml diff --git a/resources/qml/Menus/ConfigurationMenu/SyncButton.qml b/resources/qml/Menus/ConfigurationMenu/SyncButton.qml deleted file mode 100644 index 558ae1e477..0000000000 --- a/resources/qml/Menus/ConfigurationMenu/SyncButton.qml +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.7 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 - -import UM 1.2 as UM -import Cura 1.0 as Cura - -Button -{ - id: base - property var outputDevice: null - property var matched: updateOnSync() - text: matched == true ? catalog.i18nc("@label:extruder label", "Yes") : catalog.i18nc("@label:extruder label", "No") - width: parent.width - height: parent.height - - function updateOnSync() - { - if (outputDevice != undefined) - { - for (var index in outputDevice.uniqueConfigurations) - { - var configuration = outputDevice.uniqueConfigurations[index] - if (Cura.MachineManager.matchesConfiguration(configuration)) - { - base.matched = true; - return; - } - } - } - base.matched = false; - } - - style: ButtonStyle - { - background: Rectangle - { - color: - { - if(control.pressed) - { - return UM.Theme.getColor("machine_selector_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("machine_selector_hover"); - } - else - { - return UM.Theme.getColor("machine_selector_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: height - color: UM.Theme.getColor("text_emphasis") - source: UM.Theme.getIcon("arrow_bottom") - } - UM.RecolorImage - { - id: sidebarComboBoxLabel - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.verticalCenter: parent.verticalCenter; - - width: UM.Theme.getSize("printer_sync_icon").width - height: UM.Theme.getSize("printer_sync_icon").height - - color: control.matched ? UM.Theme.getColor("printer_config_matched") : UM.Theme.getColor("printer_config_mismatch") - source: UM.Theme.getIcon("tab_status_connected") - sourceSize.width: width - sourceSize.height: height - } - } - label: Label {} - } - - Connections - { - target: outputDevice - onUniqueConfigurationsChanged: updateOnSync() - } - - Connections - { - target: Cura.MachineManager - onCurrentConfigurationChanged: updateOnSync() - onOutputDevicesChanged: updateOnSync() - } -} \ No newline at end of file -- cgit v1.2.3 From 26c7558a53b571deaea91d8d2acd39ee9f5a005d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 16:44:16 +0100 Subject: Don't show labels if controls themselves are not shown The height of the popup is luckily automatically adjusted now. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 78448d5be5..87096c3a14 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -136,6 +136,7 @@ Item color: UM.Theme.getColor("text") height: parent.height width: selectors.textWidth + visible: materialSelection.visible } OldControls.ToolButton @@ -178,6 +179,7 @@ Item color: UM.Theme.getColor("text") height: parent.height width: selectors.textWidth + visible: variantSelection.visible } OldControls.ToolButton -- cgit v1.2.3 From 0b8a56458d5d6bea6dc88c8674c3459fa5eee402 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Nov 2018 17:11:32 +0100 Subject: Remove unused CustomConfigurationSelector I checked. It is no longer used. Contributes to issue CURA-5876. --- resources/qml/CustomConfigurationSelector.qml | 357 -------------------------- 1 file changed, 357 deletions(-) delete mode 100644 resources/qml/CustomConfigurationSelector.qml diff --git a/resources/qml/CustomConfigurationSelector.qml b/resources/qml/CustomConfigurationSelector.qml deleted file mode 100644 index c78ca700da..0000000000 --- a/resources/qml/CustomConfigurationSelector.qml +++ /dev/null @@ -1,357 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.7 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 - -import UM 1.2 as UM -import Cura 1.0 as Cura - -Rectangle -{ - implicitWidth: parent.width - implicitHeight: parent.height - - id: base - color: UM.Theme.getColor("main_background") - - // Height has an extra 2x margin for the top & bottom margin. - height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").width - - Cura.ExtrudersModel { id: extrudersModel } - - ListView - { - // Horizontal list that shows the extruders - id: extrudersList - visible: extrudersModel.items.length > 1 - property var index: 0 - - height: UM.Theme.getSize("configuration_selector_mode_tabs").height - boundsBehavior: Flickable.StopAtBounds - - anchors - { - left: parent.left - right: parent.right - top: parent.top - margins: UM.Theme.getSize("thick_margin").width - } - - ExclusiveGroup { id: extruderMenuGroup } - - orientation: ListView.Horizontal - - model: extrudersModel - - Connections - { - target: Cura.MachineManager - onGlobalContainerChanged: forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values. - } - - delegate: Button - { - height: parent.height - width: Math.round(ListView.view.width / extrudersModel.rowCount()) - - text: model.name - tooltip: model.name - exclusiveGroup: extruderMenuGroup - checked: Cura.ExtruderManager.activeExtruderIndex == index - - property bool extruder_enabled: true - - MouseArea // TODO; This really should be fixed. It makes absolutely no sense to have a button AND a mouse area. - { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: - { - switch (mouse.button) - { - case Qt.LeftButton: - extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled - if (extruder_enabled) - { - forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values. - Cura.ExtruderManager.setActiveExtruderIndex(index) - } - break - case Qt.RightButton: - extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled - extruderMenu.popup() - break - } - } - } - - Menu - { - id: extruderMenu - - MenuItem - { - text: catalog.i18nc("@action:inmenu", "Enable Extruder") - onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true) - visible: !extruder_enabled // using an intermediate variable prevents an empty popup that occured now and then - } - - MenuItem - { - text: catalog.i18nc("@action:inmenu", "Disable Extruder") - onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false) - visible: extruder_enabled - enabled: Cura.MachineManager.numberExtrudersEnabled > 1 - } - } - - style: ButtonStyle - { - background: Rectangle - { - anchors.fill: parent - border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width - border.color: - { - if (Cura.MachineManager.getExtruder(index).isEnabled) - { - if(control.checked || control.pressed) - { - return UM.Theme.getColor("action_button_active_border") - } - else if (control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border") - } - return UM.Theme.getColor("action_button_border") - } - return UM.Theme.getColor("action_button_disabled_border") - } - color: - { - if (Cura.MachineManager.getExtruder(index).isEnabled) - { - if(control.checked || control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if (control.hovered) - { - return UM.Theme.getColor("action_button_hovered") - } - return UM.Theme.getColor("action_button") - } - return UM.Theme.getColor("action_button_disabled") - } - Behavior on color { ColorAnimation { duration: 50; } } - - Item - { - id: extruderButtonFace - anchors.centerIn: parent - width: childrenRect.width - - Label - { - // Static text that holds the "Extruder" label - id: extruderStaticText - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - - color: - { - if (Cura.MachineManager.getExtruder(index).isEnabled) - { - if(control.checked || control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if (control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text") - } - return UM.Theme.getColor("action_button_text") - } - return UM.Theme.getColor("action_button_disabled_text") - } - - font: UM.Theme.getFont("large_nonbold") - text: catalog.i18nc("@label", "Extruder") - visible: width < (control.width - extruderIcon.width - UM.Theme.getSize("default_margin").width) - elide: Text.ElideRight - } - - ExtruderIcon - { - // Round icon with the extruder number and material color indicator. - id: extruderIcon - - anchors.verticalCenter: parent.verticalCenter - anchors.left: extruderStaticText.right - anchors.leftMargin: UM.Theme.getSize("default_margin").width - width: control.height - Math.round(UM.Theme.getSize("default_margin").width / 2) - height: width - - checked: control.checked - materialColor: model.color - textColor: extruderStaticText.color - } - } - } - - label: Item {} - } - } - } - - Item - { - id: materialRow - height: UM.Theme.getSize("print_setup_item").height - visible: Cura.MachineManager.hasMaterials - - anchors - { - left: parent.left - right: parent.right - top: extrudersList.bottom - margins: UM.Theme.getSize("thick_margin").width - } - - Label - { - id: materialLabel - text: catalog.i18nc("@label", "Material"); - width: Math.round(parent.width * 0.45 - UM.Theme.getSize("default_margin").width) - height: parent.height - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default"); - color: UM.Theme.getColor("text"); - } - - ToolButton - { - id: materialSelection - - property var activeExtruder: Cura.MachineManager.activeStack - property var hasActiveExtruder: activeExtruder != null - property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : "" - - text: currentRootMaterialName - tooltip: currentRootMaterialName - visible: Cura.MachineManager.hasMaterials - - enabled: !extrudersList.visible || Cura.ExtruderManager.activeExtruderIndex > -1 - - height: UM.Theme.getSize("setting_control").height - width: Math.round(parent.width * 0.7) + UM.Theme.getSize("thick_margin").width - anchors.right: parent.right - style: UM.Theme.styles.sidebar_header_button - activeFocusOnPress: true; - menu: Cura.MaterialMenu - { - extruderIndex: Cura.ExtruderManager.activeExtruderIndex - } - - property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true - property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported - } - } - - Item - { - id: variantRow - height: UM.Theme.getSize("print_setup_item").height - visible: Cura.MachineManager.hasVariants - - anchors - { - left: parent.left - right: parent.right - top: materialRow.bottom - margins: UM.Theme.getSize("thick_margin").width - } - - Label - { - id: variantLabel - text: Cura.MachineManager.activeDefinitionVariantsName; - width: Math.round(parent.width * 0.45 - UM.Theme.getSize("default_margin").width) - height: parent.height - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default"); - color: UM.Theme.getColor("text"); - } - - ToolButton - { - id: variantSelection - text: Cura.MachineManager.activeVariantName - tooltip: Cura.MachineManager.activeVariantName; - visible: Cura.MachineManager.hasVariants - - height: UM.Theme.getSize("setting_control").height - width: Math.round(parent.width * 0.7 + UM.Theme.getSize("thick_margin").width) - anchors.right: parent.right - style: UM.Theme.styles.sidebar_header_button - activeFocusOnPress: true; - - menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex } - } - } - - Item - { - id: materialCompatibilityLink - height: UM.Theme.getSize("print_setup_item").height - - anchors.right: parent.right - anchors.top: variantRow.bottom - anchors.margins: UM.Theme.getSize("thick_margin").width - UM.RecolorImage - { - id: warningImage - - anchors.right: materialInfoLabel.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width - - source: UM.Theme.getIcon("warning") - width: UM.Theme.getSize("section_icon").width - height: UM.Theme.getSize("section_icon").height - - sourceSize.width: width - sourceSize.height: height - - color: UM.Theme.getColor("material_compatibility_warning") - - visible: !Cura.MachineManager.isCurrentSetupSupported - } - - Label - { - id: materialInfoLabel - wrapMode: Text.WordWrap - text: "" + catalog.i18nc("@label", "Check compatibility") + "" - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") - - verticalAlignment: Text.AlignTop - - anchors.right: parent.right - - MouseArea - { - anchors.fill: parent - - onClicked: - { - // open the material URL with web browser - Qt.openUrlExternally("https://ultimaker.com/incoming-links/cura/material-compatibilty"); - } - } - } - } -} -- cgit v1.2.3 From 1c96c81ba98f9887cae38fe8de939db4131da9e4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 11:11:17 +0100 Subject: Remove unnecessary extra setMetaDataEntry This is a relic from when you first had to add the metadata entry. Now it does nothing any more because it's being set directly afterwards to the actual value that is desired in the end. Contributes to issue CURA-5876. --- cura/Settings/ExtruderStack.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cura/Settings/ExtruderStack.py b/cura/Settings/ExtruderStack.py index d7faedb71c..ed758db183 100644 --- a/cura/Settings/ExtruderStack.py +++ b/cura/Settings/ExtruderStack.py @@ -52,8 +52,6 @@ class ExtruderStack(CuraContainerStack): return super().getNextStack() def setEnabled(self, enabled: bool) -> None: - if "enabled" not in self._metadata: - self.setMetaDataEntry("enabled", "True") self.setMetaDataEntry("enabled", str(enabled)) self.enabledChanged.emit() -- cgit v1.2.3 From 4e2f51e7e8cbc58b647260885cc96d06c00727df Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 11:13:04 +0100 Subject: Use public activeExtruderIndex rather than internal _activeExtruderIndex So that this getter still does what it needs to do if we ever decide to add side-effects. Contributes to issue CURA-5876. --- cura/Settings/ExtruderManager.py | 4 ++-- cura/Settings/MachineManager.py | 2 +- plugins/CuraEngineBackend/ProcessSlicedLayersJob.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 9089ba96e9..b0bcf3b100 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -63,7 +63,7 @@ class ExtruderManager(QObject): if not self._application.getGlobalContainerStack(): return None # No active machine, so no active extruder. try: - return self._extruder_trains[self._application.getGlobalContainerStack().getId()][str(self._active_extruder_index)].getId() + return self._extruder_trains[self._application.getGlobalContainerStack().getId()][str(self.activeExtruderIndex)].getId() except KeyError: # Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong. return None @@ -144,7 +144,7 @@ class ExtruderManager(QObject): @pyqtSlot(result = QObject) def getActiveExtruderStack(self) -> Optional["ExtruderStack"]: - return self.getExtruderStack(self._active_extruder_index) + return self.getExtruderStack(self.activeExtruderIndex) ## Get an extruder stack by index def getExtruderStack(self, index) -> Optional["ExtruderStack"]: diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 226a352602..40a3bfc563 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -866,7 +866,7 @@ class MachineManager(QObject): caution_message = Message(catalog.i18nc( "@info:generic", "Settings have been changed to match the current availability of extruders: [%s]" % ", ".join(add_user_changes)), - lifetime=0, + lifetime = 0, title = catalog.i18nc("@info:title", "Settings updated")) caution_message.show() diff --git a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py index 594bf3a43e..71c96880e8 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py @@ -195,7 +195,7 @@ class ProcessSlicedLayersJob(Job): if extruders: material_color_map = numpy.zeros((len(extruders), 4), dtype=numpy.float32) for extruder in extruders: - position = int(extruder.getMetaDataEntry("position", default="0")) # Get the position + position = int(extruder.getMetaDataEntry("position", default = "0")) try: default_color = ExtrudersModel.defaultColors[position] except IndexError: -- cgit v1.2.3 From e93bbf07a4e377bb55e7b5c62292487344fcc29a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 14:53:10 +0100 Subject: Fix circular dependency with tab index and active stack Only when actually clicking the tab should it change the active extruder index; not when the current index is changed for any other reason. Next up: Don't change the current index for any other reason. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 87096c3a14..8ad512349b 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -35,7 +35,7 @@ Item anchors.top: header.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex) + currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) Repeater { @@ -53,6 +53,10 @@ Item height: parent.height } } + onClicked: + { + Cura.ExtruderManager.setActiveExtruderIndex(tabBar.currentIndex) + } } } } -- cgit v1.2.3 From 1d9a13cac27c4e8c571c53757ec81882d1c8994a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 15:40:59 +0100 Subject: Reset tab index when repeater's model is rebuilt We can't prevent the model from being rebuilt. At least, not without a major refactor. Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 8ad512349b..bdf5ccfaa1 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -39,6 +39,7 @@ Item Repeater { + id: repeater model: extrudersModel delegate: UM.TabRowButton { @@ -59,6 +60,18 @@ Item } } } + + //When the model of the extruders is rebuilt, the list of extruders is briefly emptied and rebuilt. + //This causes the currentIndex of the tab to be in an invalid position which resets it to 0. + //Therefore we need to change it back to what it was: The active extruder index. + Connections + { + target: repeater.model + onModelChanged: + { + tabBar.currentIndex = Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) + } + } } Rectangle -- cgit v1.2.3 From 18bb403413330fa4891ec80d4cb6177b8caa71b3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 15:42:46 +0100 Subject: No longer switch away from extruder when disabling It feels confusing when this happens. Contributes to issue CURA-5876. --- cura/Settings/ExtrudersModel.py | 4 ++-- cura/Settings/MachineManager.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index 14a8dadc69..955bd9dbb2 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Ultimaker B.V. +# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, pyqtProperty, QTimer @@ -177,7 +177,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): machine_extruder_count = global_container_stack.getProperty("machine_extruder_count", "value") for extruder in Application.getInstance().getExtruderManager().getActiveExtruderStacks(): - position = extruder.getMetaDataEntry("position", default = "0") # Get the position + position = extruder.getMetaDataEntry("position", default = "0") try: position = int(position) except ValueError: diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 40a3bfc563..be4a4e2b4e 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -993,10 +993,6 @@ class MachineManager(QObject): self.updateNumberExtrudersEnabled() self.correctExtruderSettings() - # In case this extruder is being disabled and it's the currently selected one, switch to the default extruder - if not enabled and position == ExtruderManager.getInstance().activeExtruderIndex: - ExtruderManager.getInstance().setActiveExtruderIndex(int(self._default_extruder_position)) - # ensure that the quality profile is compatible with current combination, or choose a compatible one if available self._updateQualityWithMaterial() self.extruderChanged.emit() -- cgit v1.2.3 From ede50ef3cad83e1c6c6a8b282bf27d9b261f17a9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 15:44:15 +0100 Subject: Simplify dependencies on activeStack The properties, being formulas, were not properly updated when the active stack changed. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index bdf5ccfaa1..8044d86347 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -135,7 +135,7 @@ Item OldControls.CheckBox { - checked: selectors.model != null ? Cura.MachineManager.getExtruder(selectors.model.index).isEnabled: false + checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false onClicked: Cura.MachineManager.setExtruderEnabled(selectors.model.index, checked) height: UM.Theme.getSize("setting_control").height style: UM.Theme.styles.checkbox @@ -160,14 +160,11 @@ Item { id: materialSelection - property var activeExtruder: Cura.MachineManager.activeStack - property var hasActiveExtruder: activeExtruder != null - property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : "" - property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true + property var valueError: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible", "") != "True" : true property var valueWarning: !Cura.MachineManager.isActiveQualitySupported - text: currentRootMaterialName - tooltip: currentRootMaterialName + text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.material.name : "" + tooltip: text visible: Cura.MachineManager.hasMaterials enabled: Cura.ExtruderManager.activeExtruderIndex > -1 -- cgit v1.2.3 From ed37e692a38e6effb5f25a97409623330c6ea78f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 15:45:04 +0100 Subject: Don't disable enable checkbox before machine is loaded It is unnecessary because you can't see it or click on it before adding a machine. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 8044d86347..605d0444e6 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -167,8 +167,6 @@ Item tooltip: text visible: Cura.MachineManager.hasMaterials - enabled: Cura.ExtruderManager.activeExtruderIndex > -1 - height: UM.Theme.getSize("setting_control").height width: selectors.controlWidth -- cgit v1.2.3 From 82d4897ba4e24ba9e1ed52a9d79dff0fc88e0096 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 16:18:46 +0100 Subject: Use MouseArea to catch click instead of onClicked This is necessary because when you click it, the 'checked' property no longer depends on the active extruder. So prevent it from being clicked at all and handle the click separately in this MouseArea. Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 605d0444e6..08ba042948 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -136,9 +136,19 @@ Item OldControls.CheckBox { checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false - onClicked: Cura.MachineManager.setExtruderEnabled(selectors.model.index, checked) height: UM.Theme.getSize("setting_control").height style: UM.Theme.styles.checkbox + + /* Use a MouseArea to process the click on this checkbox. + This is necessary because actually clicking the checkbox + causes the "checked" property to be overwritten. After + it's been overwritten, the original link that made it + depend on the active extruder stack is broken. */ + MouseArea + { + anchors.fill: parent + onClicked: Cura.MachineManager.setExtruderEnabled(Cura.ExtruderManager.activeExtruderIndex, !parent.checked) + } } } -- cgit v1.2.3 From d5d49fcec8ea3888ff53b47285322c56407e555a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 16:43:48 +0100 Subject: Disable extruder enabled checkbox if it's the last one You can't disable the last extruder. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 08ba042948..6a3ab82ce2 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -10,6 +10,12 @@ import UM 1.3 as UM Item { + UM.I18nCatalog + { + id: catalog + name: "cura" + } + width: parent.width height: visible ? childrenRect.height : 0 @@ -136,6 +142,7 @@ Item OldControls.CheckBox { checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false + enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder. height: UM.Theme.getSize("setting_control").height style: UM.Theme.styles.checkbox @@ -148,6 +155,7 @@ Item { anchors.fill: parent onClicked: Cura.MachineManager.setExtruderEnabled(Cura.ExtruderManager.activeExtruderIndex, !parent.checked) + enabled: parent.enabled } } } -- cgit v1.2.3 From f4950cf92b2ba797d62ff85a6c936762c68bb81f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 17:04:50 +0100 Subject: Give checkboxes a style if they're disabled Contributes to issue CURA-5876. --- resources/themes/cura-light/styles.qml | 2 +- resources/themes/cura-light/theme.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index f00aab44c0..97eae65d27 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -646,7 +646,7 @@ QtObject implicitWidth: Theme.getSize("checkbox").width implicitHeight: Theme.getSize("checkbox").height - color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_hover") : Theme.getColor("checkbox") + color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_hover") : (control.enabled ? Theme.getColor("checkbox") : Theme.getColor("checkbox_disabled")) Behavior on color { ColorAnimation { duration: 50; } } radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : 0 diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index bd7c632eb1..0d77ecf802 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -235,6 +235,7 @@ "checkbox_border": [64, 69, 72, 255], "checkbox_border_hover": [50, 130, 255, 255], "checkbox_mark": [119, 122, 124, 255], + "checkbox_disabled": [223, 223, 223, 255], "checkbox_text": [27, 27, 27, 255], "tooltip": [68, 192, 255, 255], -- cgit v1.2.3 From 0a6e420710ae3c76a9f707c69b0afaec5307ae8f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 30 Nov 2018 17:05:25 +0100 Subject: Make active tab white Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 6a3ab82ce2..b269b95df2 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -89,7 +89,7 @@ Item radius: UM.Theme.getSize("default_radius").width border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") - color: UM.Theme.getColor("secondary") + color: UM.Theme.getColor("main_background") //Remove rounding and lining at the top. Rectangle -- cgit v1.2.3 From 82e66eeaa1957184e8cf9b4ce1359ec47690f946 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 09:02:41 +0100 Subject: Remove tabs and lining with single-extruder printers There's no sense in showing tabs if the user can't use them. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index b269b95df2..957cd16b3e 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -40,6 +40,7 @@ Item id: tabBar anchors.top: header.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height + visible: Cura.MachineManager.numberExtrudersEnabled > 1 currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) @@ -86,8 +87,8 @@ Item height: childrenRect.height anchors.top: tabBar.bottom - radius: UM.Theme.getSize("default_radius").width - border.width: UM.Theme.getSize("default_lining").width + radius: tabBar.visible ? UM.Theme.getSize("default_radius").width : 0 + border.width: tabBar.visible ? UM.Theme.getSize("default_lining").width : 0 border.color: UM.Theme.getColor("lining") color: UM.Theme.getColor("main_background") @@ -98,6 +99,7 @@ Item height: parent.radius anchors.top: parent.top color: UM.Theme.getColor("lining") + visible: tabBar.visible Rectangle { anchors -- cgit v1.2.3 From db05d7853a3567da6bb328f676c3f89dfb74bfcc Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 09:04:35 +0100 Subject: Remove background colour from tab window The colour is the same as what is behind it anyway. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 957cd16b3e..eae160b48a 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -90,7 +90,6 @@ Item radius: tabBar.visible ? UM.Theme.getSize("default_radius").width : 0 border.width: tabBar.visible ? UM.Theme.getSize("default_lining").width : 0 border.color: UM.Theme.getColor("lining") - color: UM.Theme.getColor("main_background") //Remove rounding and lining at the top. Rectangle -- cgit v1.2.3 From f3af5a72ad7b29f3e27197cff85c43bcff0519fd Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 11:13:26 +0100 Subject: Use ListModel.count instead of rowCount The .count property properly updates when the model is changed. Contributes to issue CURA-5876. --- cura/Settings/ExtrudersModel.py | 2 +- cura/Settings/MachineManager.py | 2 +- .../MachineSettingsAction.qml | 4 ++-- resources/qml/Dialogs/AddMachineDialog.qml | 2 +- .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 2 +- resources/qml/Menus/ProfileMenu.qml | 8 ++++---- resources/qml/Preferences/MachinesPage.qml | 8 +++++--- .../qml/Preferences/Materials/MaterialsList.qml | 8 ++++---- resources/qml/Preferences/ProfilesPage.qml | 24 ++++++++++++++-------- .../qml/Preferences/SettingVisibilityPage.qml | 2 +- resources/qml/Settings/SettingOptionalExtruder.qml | 13 +++++++----- resources/qml/SidebarSimple.qml | 6 +++--- resources/qml/Toolbar.qml | 2 +- resources/qml/ViewsSelector.qml | 2 +- 14 files changed, 49 insertions(+), 36 deletions(-) diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index 955bd9dbb2..5f10ac99d4 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -165,7 +165,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): def __updateExtruders(self): extruders_changed = False - if self.rowCount() != 0: + if self.count != 0: extruders_changed = True items = [] diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index be4a4e2b4e..7e1a06f45c 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1540,7 +1540,7 @@ class MachineManager(QObject): elif word.isdigit(): abbr_machine += word else: - stripped_word = ''.join(char for char in unicodedata.normalize('NFD', word.upper()) if unicodedata.category(char) != 'Mn') + stripped_word = "".join(char for char in unicodedata.normalize("NFD", word.upper()) if unicodedata.category(char) != "Mn") # - use only the first character if the word is too long (> 3 characters) # - use the whole word if it's not too long (<= 3 characters) if len(stripped_word) > 3: diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index 004b4e3cfc..c88a721a84 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2018 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -23,7 +23,7 @@ Cura.MachineAction target: base.extrudersModel onModelChanged: { - var extruderCount = base.extrudersModel.rowCount(); + var extruderCount = base.extrudersModel.count; base.extruderTabsCount = extruderCount; } } diff --git a/resources/qml/Dialogs/AddMachineDialog.qml b/resources/qml/Dialogs/AddMachineDialog.qml index 8b2b9d1868..bcf5807949 100644 --- a/resources/qml/Dialogs/AddMachineDialog.qml +++ b/resources/qml/Dialogs/AddMachineDialog.qml @@ -170,7 +170,7 @@ UM.Dialog if (machineList.model.getItem(machineList.currentIndex).section != section) { // Find the first machine from this section - for(var i = 0; i < machineList.model.rowCount(); i++) + for(var i = 0; i < machineList.model.count; i++) { var item = machineList.model.getItem(i); if (item.section == section) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 202bc22ce0..9927ad1498 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -44,7 +44,7 @@ Cura.ExpandableComponent delegate: Item { height: parent.height - width: Math.round(ListView.view.width / extrudersModel.rowCount()) + width: Math.round(ListView.view.width / extrudersModel.count) // Extruder icon. Shows extruder index and has the same color as the active material. Cura.ExtruderIcon diff --git a/resources/qml/Menus/ProfileMenu.qml b/resources/qml/Menus/ProfileMenu.qml index ffd3c556b6..e09b7930a8 100644 --- a/resources/qml/Menus/ProfileMenu.qml +++ b/resources/qml/Menus/ProfileMenu.qml @@ -34,7 +34,7 @@ Menu MenuSeparator { id: customSeparator - visible: Cura.CustomQualityProfilesDropDownMenuModel.rowCount > 0 + visible: Cura.CustomQualityProfilesDropDownMenuModel.count > 0 } Instantiator @@ -45,7 +45,7 @@ Menu Connections { target: Cura.CustomQualityProfilesDropDownMenuModel - onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.rowCount() > 0 + onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.count > 0 } MenuItem @@ -59,12 +59,12 @@ Menu onObjectAdded: { - customSeparator.visible = model.rowCount() > 0; + customSeparator.visible = model.count > 0; menu.insertItem(index, object); } onObjectRemoved: { - customSeparator.visible = model.rowCount() > 0; + customSeparator.visible = model.count > 0; menu.removeItem(object); } } diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 4dc5465dc6..bc75b9bc72 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -21,8 +21,10 @@ UM.ManagementPage function activeMachineIndex() { - for(var i = 0; i < model.rowCount(); i++) { - if (model.getItem(i).id == Cura.MachineManager.activeMachineId) { + for(var i = 0; i < model.count; i++) + { + if (model.getItem(i).id == Cura.MachineManager.activeMachineId) + { return i; } } @@ -47,7 +49,7 @@ UM.ManagementPage { text: catalog.i18nc("@action:button", "Remove"); iconName: "list-remove"; - enabled: base.currentItem != null && model.rowCount() > 1 + enabled: base.currentItem != null && model.count > 1 onClicked: confirmDialog.open(); }, Button diff --git a/resources/qml/Preferences/Materials/MaterialsList.qml b/resources/qml/Preferences/Materials/MaterialsList.qml index 00bead9650..61f92db84c 100644 --- a/resources/qml/Preferences/Materials/MaterialsList.qml +++ b/resources/qml/Preferences/Materials/MaterialsList.qml @@ -57,7 +57,7 @@ Item var currentItemId = base.currentItem == null ? "" : base.currentItem.root_material_id search_root_id = currentItemId } - for (var material_idx = 0; material_idx < genericMaterialsModel.rowCount(); material_idx++) + for (var material_idx = 0; material_idx < genericMaterialsModel.count; material_idx++) { var material = genericMaterialsModel.getItem(material_idx) if (material.root_material_id == search_root_id) @@ -72,15 +72,15 @@ Item return true } } - for (var brand_idx = 0; brand_idx < materialsModel.rowCount(); brand_idx++) + for (var brand_idx = 0; brand_idx < materialsModel.count; brand_idx++) { var brand = materialsModel.getItem(brand_idx) var types_model = brand.material_types - for (var type_idx = 0; type_idx < types_model.rowCount(); type_idx++) + for (var type_idx = 0; type_idx < types_model.count; type_idx++) { var type = types_model.getItem(type_idx) var colors_model = type.colors - for (var material_idx = 0; material_idx < colors_model.rowCount(); material_idx++) + for (var material_idx = 0; material_idx < colors_model.count; material_idx++) { var material = colors_model.getItem(material_idx) if (material.root_material_id == search_root_id) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index ba0c2848a5..d7ffbb3152 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -188,21 +188,27 @@ Item Connections { target: qualitiesModel - onItemsChanged: { + onItemsChanged: + { var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name; - if (newQualityNameToSelect != "") { + if (newQualityNameToSelect != "") + { toSelectItemName = newQualityNameToSelect; } var newIdx = -1; // Default to nothing if nothing can be found - if (toSelectItemName != "") { + if (toSelectItemName != "") + { // Select the required quality name if given - for (var idx = 0; idx < qualitiesModel.rowCount(); ++idx) { + for (var idx = 0; idx < qualitiesModel.count; ++idx) + { var item = qualitiesModel.getItem(idx); - if (item.name == toSelectItemName) { + if (item.name == toSelectItemName) + { // Switch to the newly created profile if needed newIdx = idx; - if (base.toActivateNewQuality) { + if (base.toActivateNewQuality) + { // Activate this custom quality if required Cura.MachineManager.setQualityChangesGroup(item.quality_changes_group); } @@ -382,9 +388,11 @@ Item var selectedItemName = Cura.MachineManager.activeQualityOrQualityChangesName; // Select the required quality name if given - for (var idx = 0; idx < qualitiesModel.rowCount(); idx++) { + for (var idx = 0; idx < qualitiesModel.count; idx++) + { var item = qualitiesModel.getItem(idx); - if (item.name == selectedItemName) { + if (item.name == selectedItemName) + { currentIndex = idx; break; } diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 8896d0611e..bb47301b69 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -54,7 +54,7 @@ UM.PreferencesPage { return Qt.Unchecked } - else if(definitionsModel.visibleCount == definitionsModel.rowCount(null)) + else if(definitionsModel.visibleCount == definitionsModel.count) { return Qt.Checked } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index a3c1422b30..5f0d8327f8 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -1,5 +1,5 @@ -// Copyright (c) 2016 Ultimaker B.V. -// Uranium is released under the terms of the LGPLv3 or higher. +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 2.0 @@ -31,12 +31,15 @@ SettingItem { forceActiveFocus(); propertyProvider.setPropertyValue("value", model.getItem(index).index); - } else + } + else { if (propertyProvider.properties.value == -1) { - control.currentIndex = model.rowCount() - 1; // we know the last item is "Not overriden" - } else { + control.currentIndex = model.count - 1; // we know the last item is "Not overriden" + } + else + { control.currentIndex = propertyProvider.properties.value; // revert to the old value } } diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 5e723a3d70..e07810691e 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -106,7 +106,7 @@ Item var availableMin = -1 var availableMax = -1 - for (var i = 0; i < Cura.QualityProfilesDropDownMenuModel.rowCount(); i++) + for (var i = 0; i < Cura.QualityProfilesDropDownMenuModel.count; i++) { var qualityItem = Cura.QualityProfilesDropDownMenuModel.getItem(i) @@ -183,7 +183,7 @@ Item qualityModel.existingQualityProfile = 0 // check, the ticks count cannot be less than zero - qualityModel.totalTicks = Math.max(0, Cura.QualityProfilesDropDownMenuModel.rowCount() - 1) + qualityModel.totalTicks = Math.max(0, Cura.QualityProfilesDropDownMenuModel.count - 1) } } @@ -1156,7 +1156,7 @@ Item function populateExtruderModel() { extruderModel.clear(); - for(var extruderNumber = 0; extruderNumber < extruders.rowCount() ; extruderNumber++) + for(var extruderNumber = 0; extruderNumber < extruders.count; extruderNumber++) { extruderModel.append({ text: extruders.getItem(extruderNumber).name, diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 0240aaab26..4e00bd7248 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -65,7 +65,7 @@ Item style: UM.Theme.styles.toolbar_button property bool isFirstElement: toolsModel.getItem(0).id == model.id - property bool isLastElement: toolsModel.getItem(toolsModel.rowCount() - 1).id == model.id + property bool isLastElement: toolsModel.getItem(toolsModel.count - 1).id == model.id onCheckedChanged: { diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index e9fdd57177..e239ea82a0 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -19,7 +19,7 @@ Cura.ExpandableComponent property var activeView: { - for (var i = 0; i < viewModel.rowCount(); i++) + for (var i = 0; i < viewModel.count; i++) { if (viewModel.items[i].active) { -- cgit v1.2.3 From 6012ea0b9edf78369bec7abc463869f226e26b23 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 11:15:11 +0100 Subject: Don't use QtQuick imports from Qt 5.11 Our build system uses 5.10. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 2 +- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index c40eb5b9e9..32be97f74e 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -2,7 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 2.4 +import QtQuick.Controls 2.3 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 9927ad1498..816ac27470 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -4,7 +4,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Controls.Styles 1.4 -import QtQuick.Layouts 1.11 import UM 1.2 as UM import Cura 1.0 as Cura -- cgit v1.2.3 From af747ae09c254327dd5d85e90a2cea86cc5d5562 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 11:19:25 +0100 Subject: Don't hide tab bar when disabling all but one extruder And make sure the checkbox for enabling also disappears. We don't want to make this dependent on the number of enabled extruders, but on the total number of extruders. This way you can actually re-enable an extruder again because the tab bar shouldn't disappear. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index eae160b48a..7ff47ea16f 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -40,7 +40,7 @@ Item id: tabBar anchors.top: header.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - visible: Cura.MachineManager.numberExtrudersEnabled > 1 + visible: extrudersModel.count > 1 currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) @@ -138,6 +138,7 @@ Item color: UM.Theme.getColor("text") height: parent.height width: selectors.textWidth + visible: extrudersModel.count > 1 } OldControls.CheckBox @@ -146,6 +147,7 @@ Item enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder. height: UM.Theme.getSize("setting_control").height style: UM.Theme.styles.checkbox + visible: extrudersModel.count > 1 /* Use a MouseArea to process the click on this checkbox. This is necessary because actually clicking the checkbox -- cgit v1.2.3 From 39411222da20db6a39f1341e6d42c9610c88c85a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 11:37:22 +0100 Subject: Use normal font size for Auto slicing... message It should've been the normal font size anyway. This is not small! Contributes to issue CURA-5876. --- resources/qml/ActionPanel/SliceProcessWidget.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index cae598fea6..dee099bc88 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -48,7 +48,7 @@ Column text: catalog.i18nc("@label:PrintjobStatus", "Auto slicing...") color: UM.Theme.getColor("text") - font: UM.Theme.getFont("very_small") + font: UM.Theme.getFont("default") renderType: Text.NativeRendering } -- cgit v1.2.3 From c8cb3a094a216eac21b139ba6577541ea53046d1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 11:52:10 +0100 Subject: Re-use SecondaryButton instead of setting colours ourselves It has a pre-defined theme. Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 816ac27470..fc8b31f125 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -147,7 +147,7 @@ Cura.ExpandableComponent width: parent.width height: childrenRect.height - Cura.ActionButton + Cura.SecondaryButton { id: goToCustom visible: popupItem.configuration_method === "auto" @@ -159,18 +159,13 @@ Cura.ExpandableComponent top: parent.top } - color: UM.Theme.getColor("secondary") - hoverColor: UM.Theme.getColor("secondary") - textColor: UM.Theme.getColor("primary") - textHoverColor: UM.Theme.getColor("text") - iconSource: UM.Theme.getIcon("arrow_right") iconOnRightSide: true onClicked: popupItem.configuration_method = "custom" } - Cura.ActionButton + Cura.SecondaryButton { id: goToAuto visible: popupItem.configuration_method === "custom" @@ -182,11 +177,6 @@ Cura.ExpandableComponent top: parent.top } - color: UM.Theme.getColor("secondary") - hoverColor: UM.Theme.getColor("secondary") - textColor: UM.Theme.getColor("primary") - textHoverColor: UM.Theme.getColor("text") - iconSource: UM.Theme.getIcon("arrow_left") onClicked: popupItem.configuration_method = "auto" -- cgit v1.2.3 From 65d3aa44802c740d06c19ebbc58a2e9f2732ee80 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Dec 2018 11:59:03 +0100 Subject: Fix broken sizes due to merged theme entry Merge conflict went wrong, I think. Contributes to issue CURA-5876. --- resources/qml/ActionPanel/OutputProcessWidget.qml | 2 +- resources/qml/ActionPanel/SliceProcessWidget.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index 3a85a13810..8ce5d13f17 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -111,7 +111,7 @@ Column { id: previewStageShortcut - height: UM.Theme.getSize("action_panel_button").height + height: UM.Theme.getSize("action_button").height text: catalog.i18nc("@button", "Preview") onClicked: UM.Controller.setActiveStage("PreviewStage") diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index dee099bc88..1143bb4c1a 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -101,7 +101,7 @@ Column // Disable the slice process when width: parent.width - height: UM.Theme.getSize("action_panel_button").height + height: UM.Theme.getSize("action_button").height visible: !autoSlice Cura.PrimaryButton { -- cgit v1.2.3 From 9b8b91b6a41eef06b504f47474d213f54335a308 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 3 Dec 2018 17:34:08 +0100 Subject: More specific variable type for is_connected Contributes to issue CURA-5876. Co-Authored-By: Ghostkeeper --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index fc8b31f125..79b7c9bf66 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -102,7 +102,7 @@ Cura.ExpandableComponent height: implicitHeight //Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up. spacing: UM.Theme.getSize("default_margin").height - property var is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible. + property bool is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible. onVisibleChanged: { is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected //Re-evaluate. -- cgit v1.2.3 From 82d8410d184d0727612158bf50e45a8b13ae31a9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 13:58:54 +0100 Subject: Don't emit enabledChanged signal if it didn't change Contributes to issue CURA-5876. --- cura/Settings/ExtruderStack.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cura/Settings/ExtruderStack.py b/cura/Settings/ExtruderStack.py index ed758db183..d626ef06da 100644 --- a/cura/Settings/ExtruderStack.py +++ b/cura/Settings/ExtruderStack.py @@ -52,6 +52,8 @@ class ExtruderStack(CuraContainerStack): return super().getNextStack() def setEnabled(self, enabled: bool) -> None: + if self.getMetaDataEntry("enabled", True) == enabled: #No change. + return #Don't emit a signal then. self.setMetaDataEntry("enabled", str(enabled)) self.enabledChanged.emit() -- cgit v1.2.3 From a1f579a5288a43dd48480f565ed8c2dd514f9b47 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:01:49 +0100 Subject: Improve wording of iconOnRightSide documentation Contributes to issue CURA-5876. --- resources/qml/ActionButton.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index cd0a264766..116253ab7a 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -43,7 +43,7 @@ Button contentItem: Row { - //Icon if displayed on the left side. + //Left side icon. Only displayed if !iconOnRightSide. UM.RecolorImage { id: buttonIconLeft @@ -71,7 +71,7 @@ Button elide: Text.ElideRight } - //Icon if displayed on the right side. + //Right side icon. Only displayed if iconOnRightSide. UM.RecolorImage { id: buttonIconRight -- cgit v1.2.3 From 801701623eedd41681c4caf31251b2cd4bf33f84 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:04:07 +0100 Subject: Remove unnecessary top anchor in first subitem of item It already gets aligned to the top anyway. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml index 8e86549e17..58b6bac089 100644 --- a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml @@ -22,7 +22,6 @@ Item anchors { - top: parent.top left: parent.left right: parent.right } -- cgit v1.2.3 From 759b5b58476c3d2be6c0faf5118fc052f1d6bec8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:23:41 +0100 Subject: Use anchors rather than a calculation with padding It's supposed to be slightly more efficient. Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/ConfigurationItem.qml | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 3ea220c91e..7ba7202819 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -34,7 +34,13 @@ Button { id: extruderRow - width: parent.width - 2 * parent.padding + anchors + { + left: parent.left + leftMargin: parent.padding + right: parent.right + rightMargin: parent.padding + } height: childrenRect.height spacing: UM.Theme.getSize("default_margin").width @@ -58,7 +64,13 @@ Button id: separator visible: buildplateInformation.visible - width: parent.width - 2 * parent.padding + anchors + { + left: parent.left + leftMargin: parent.padding + right: parent.right + rightMargin: parent.padding + } height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0 color: UM.Theme.getColor("text") } @@ -66,7 +78,14 @@ Button Item { id: buildplateInformation - width: parent.width - 2 * parent.padding + + anchors + { + left: parent.left + leftMargin: parent.padding + right: parent.right + rightMargin: parent.padding + } height: childrenRect.height visible: configuration.buildplateConfiguration != "" -- cgit v1.2.3 From 7cc1f021c1333fe962a2875167f6b1750bc238fb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:25:58 +0100 Subject: Fix right-alignment of configuration items in list The scrollbar will go on top of it now, but it looks nicer if you don't scroll. Maybe we have to make it adaptable? Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 32be97f74e..5a9f72260c 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -27,7 +27,7 @@ Column ScrollView { id: container - width: parent.width - parent.padding + width: parent.width height: Math.min(configurationList.contentHeight, 350 * screenScaleFactor) ButtonGroup @@ -58,7 +58,7 @@ Column delegate: ConfigurationItem { - width: parent.width - UM.Theme.getSize("default_margin").width + width: parent.width configuration: modelData } } -- cgit v1.2.3 From 347240410ad1885d3dc237dc7f0db1f9e249671b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:35:28 +0100 Subject: Use enumeration to check and switch state of configuration menu Instead of a string. This is a bit more restrictive. Contributes to issue CURA-5876. --- .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 79b7c9bf66..1b7dfe30e4 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -28,6 +28,12 @@ Cura.ExpandableComponent name: "cura" } + enum ConfigurationMethod + { + AUTO, + CUSTOM + } + iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") headerItem: Item { @@ -108,7 +114,7 @@ Cura.ExpandableComponent is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected //Re-evaluate. } - property var configuration_method: is_connected ? "auto" : "custom" //Auto if connected to a printer at start-up, or Custom if not. + property int configuration_method: is_connected ? ConfigurationMenu.ConfigurationMethod.AUTO : ConfigurationMenu.ConfigurationMethod.CUSTOM //Auto if connected to a printer at start-up, or Custom if not. Item { @@ -117,13 +123,13 @@ Cura.ExpandableComponent AutoConfiguration { id: autoConfiguration - visible: popupItem.configuration_method === "auto" + visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.AUTO } CustomConfiguration { id: customConfiguration - visible: popupItem.configuration_method === "custom" + visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.CUSTOM } } @@ -150,7 +156,7 @@ Cura.ExpandableComponent Cura.SecondaryButton { id: goToCustom - visible: popupItem.configuration_method === "auto" + visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.AUTO text: catalog.i18nc("@label", "Custom") anchors @@ -162,13 +168,13 @@ Cura.ExpandableComponent iconSource: UM.Theme.getIcon("arrow_right") iconOnRightSide: true - onClicked: popupItem.configuration_method = "custom" + onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.CUSTOM } Cura.SecondaryButton { id: goToAuto - visible: popupItem.configuration_method === "custom" + visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.CUSTOM text: catalog.i18nc("@label", "Configurations") anchors @@ -179,7 +185,7 @@ Cura.ExpandableComponent iconSource: UM.Theme.getIcon("arrow_left") - onClicked: popupItem.configuration_method = "auto" + onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.AUTO } } } -- cgit v1.2.3 From 2dde2438b2a984e2dabf19edcb5164934e456050 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:38:13 +0100 Subject: Remove unnecessary anchors Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 1b7dfe30e4..a49fe5574f 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -159,11 +159,7 @@ Cura.ExpandableComponent visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.AUTO text: catalog.i18nc("@label", "Custom") - anchors - { - right: parent.right - top: parent.top - } + anchors.right: parent.right iconSource: UM.Theme.getIcon("arrow_right") iconOnRightSide: true @@ -177,12 +173,6 @@ Cura.ExpandableComponent visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.CUSTOM text: catalog.i18nc("@label", "Configurations") - anchors - { - left: parent.left - top: parent.top - } - iconSource: UM.Theme.getIcon("arrow_left") onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.AUTO -- cgit v1.2.3 From 023100f4c3690e564d26ddf4bd6ffece955d4c38 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Dec 2018 14:39:08 +0100 Subject: Changed valueError property to bool instead of var A bit more specific. Contributes to issue CURA-5876. Co-Authored-By: Ghostkeeper --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 7ff47ea16f..e28478e9e2 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -181,7 +181,7 @@ Item { id: materialSelection - property var valueError: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible", "") != "True" : true + property bool valueError: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible", "") != "True" : true property var valueWarning: !Cura.MachineManager.isActiveQualitySupported text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.material.name : "" @@ -232,4 +232,4 @@ Item } } } -} \ No newline at end of file +} -- cgit v1.2.3 From 8a257f018486a2d4cc22ae980ea4e8dd8e5ffc57 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Dec 2018 14:39:39 +0100 Subject: Change valueWarning property to bool instead of var A bit more specific. Contributes to issue CURA-5876. Co-Authored-By: Ghostkeeper --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index e28478e9e2..72b640e94a 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -182,7 +182,7 @@ Item id: materialSelection property bool valueError: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible", "") != "True" : true - property var valueWarning: !Cura.MachineManager.isActiveQualitySupported + property bool valueWarning: !Cura.MachineManager.isActiveQualitySupported text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.material.name : "" tooltip: text -- cgit v1.2.3 From ef29fb0cfaaf22ccd582ad238cbc3259894fb137 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:44:12 +0100 Subject: Remove unnecessary item wrapper Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index 8d2f0c0f7c..4064a961d5 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -16,16 +16,11 @@ Row spacing: UM.Theme.getSize("default_margin").width //Extruder icon. - Item + Cura.ExtruderIcon { - width: childrenRect.width - height: information.height - Cura.ExtruderIcon - { - materialColor: printCoreConfiguration.material.color - anchors.verticalCenter: parent.verticalCenter - extruderEnabled: printCoreConfiguration.material.name !== "" && printCoreConfiguration.hotendID !== "" - } + materialColor: printCoreConfiguration.material.color + anchors.verticalCenter: parent.verticalCenter + extruderEnabled: printCoreConfiguration.material.name !== "" && printCoreConfiguration.hotendID !== "" } Column -- cgit v1.2.3 From 2fdfdaa00b4cc7cea04e754a25ad58f056d3d684 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 14:47:34 +0100 Subject: Rename iconOnRightSide to isIconOnRightSide More accurately represents the type of value that's in this property. Contributes to issue CURA-5876. --- resources/qml/ActionButton.qml | 10 +++++----- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 116253ab7a..2107264dff 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -12,7 +12,7 @@ Button { id: button property alias iconSource: buttonIconLeft.source - property var iconOnRightSide: false + property bool isIconOnRightSide: false property alias textFont: buttonText.font property alias cornerRadius: backgroundRect.radius property alias tooltip: tooltip.text @@ -43,7 +43,7 @@ Button contentItem: Row { - //Left side icon. Only displayed if !iconOnRightSide. + //Left side icon. Only displayed if !isIconOnRightSide. UM.RecolorImage { id: buttonIconLeft @@ -53,7 +53,7 @@ Button sourceSize.width: width sourceSize.height: height color: button.hovered ? button.textHoverColor : button.textColor - visible: source != "" && !button.iconOnRightSide + visible: source != "" && !button.isIconOnRightSide anchors.verticalCenter: parent.verticalCenter } @@ -71,7 +71,7 @@ Button elide: Text.ElideRight } - //Right side icon. Only displayed if iconOnRightSide. + //Right side icon. Only displayed if isIconOnRightSide. UM.RecolorImage { id: buttonIconRight @@ -81,7 +81,7 @@ Button sourceSize.width: width sourceSize.height: height color: buttonIconLeft.color - visible: source != "" && button.iconOnRightSide + visible: source != "" && button.isIconOnRightSide anchors.verticalCenter: buttonIconLeft.verticalCenter } } diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index a49fe5574f..f81176ab1a 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -162,7 +162,7 @@ Cura.ExpandableComponent anchors.right: parent.right iconSource: UM.Theme.getIcon("arrow_right") - iconOnRightSide: true + isIconOnRightSide: true onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.CUSTOM } -- cgit v1.2.3 From 4d87c464237c4c92c2aa5dfd0c4909a94f49bf92 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 15:04:51 +0100 Subject: Remove sourceSize.width: width from all RecolorImages It is now the default in Uranium. Contributes to issue CURA-5876. --- plugins/ModelChecker/ModelChecker.qml | 1 - plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 1 - plugins/PostProcessingPlugin/PostProcessingPlugin.qml | 4 ---- plugins/PrepareStage/PrepareMenu.qml | 1 - plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 1 - .../Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml | 2 -- resources/qml/ActionButton.qml | 4 ---- resources/qml/ActionPanel/PrintInformationWidget.qml | 3 --- resources/qml/Dialogs/AboutDialog.qml | 2 -- resources/qml/Dialogs/AddMachineDialog.qml | 3 +-- resources/qml/ExpandableComponent.qml | 2 -- resources/qml/ExtruderIcon.qml | 3 --- resources/qml/IconLabel.qml | 3 --- resources/qml/IconWithText.qml | 2 -- resources/qml/JobSpecs.qml | 1 - resources/qml/MainWindow/MainWindowHeader.qml | 3 --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 2 -- resources/qml/ObjectsList.qml | 3 +-- .../qml/Preferences/Materials/MaterialsBrandSection.qml | 5 ++--- resources/qml/Preferences/Materials/MaterialsSlot.qml | 2 -- .../qml/Preferences/Materials/MaterialsTypeSection.qml | 2 -- resources/qml/PrinterSelector/MachineSelector.qml | 3 --- resources/qml/Settings/SettingCategory.qml | 13 ++++++++----- resources/qml/Settings/SettingCheckBox.qml | 4 ++-- resources/qml/Settings/SettingView.qml | 11 ++++++----- resources/qml/SidebarSimple.qml | 1 - resources/themes/cura-light/styles.qml | 5 ----- 27 files changed, 20 insertions(+), 67 deletions(-) diff --git a/plugins/ModelChecker/ModelChecker.qml b/plugins/ModelChecker/ModelChecker.qml index 5e41591d6b..437df29516 100644 --- a/plugins/ModelChecker/ModelChecker.qml +++ b/plugins/ModelChecker/ModelChecker.qml @@ -33,7 +33,6 @@ Button { width: UM.Theme.getSize("save_button_specs_icons").width; height: UM.Theme.getSize("save_button_specs_icons").height; - sourceSize.width: width; sourceSize.height: width; color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene"); source: "model_checker.svg" diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 5d4e17a102..0e2bd88619 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -265,7 +265,6 @@ Item { anchors.verticalCenter: parent.verticalCenter width: parent.width height: width - sourceSize.width: width sourceSize.height: width color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") source: UM.Theme.getIcon("minus") diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index bd4d361d35..3fa10c23b9 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -141,7 +141,6 @@ UM.Dialog anchors.horizontalCenter: parent.horizontalCenter width: Math.round(control.width / 2.7) height: Math.round(control.height / 2.7) - sourceSize.width: width sourceSize.height: width color: palette.text source: UM.Theme.getIcon("cross1") @@ -176,7 +175,6 @@ UM.Dialog anchors.horizontalCenter: parent.horizontalCenter width: Math.round(control.width / 2.5) height: Math.round(control.height / 2.5) - sourceSize.width: width sourceSize.height: width color: control.enabled ? palette.text : disabledPalette.text source: UM.Theme.getIcon("arrow_bottom") @@ -211,7 +209,6 @@ UM.Dialog anchors.horizontalCenter: parent.horizontalCenter width: Math.round(control.width / 2.5) height: Math.round(control.height / 2.5) - sourceSize.width: width sourceSize.height: width color: control.enabled ? palette.text : disabledPalette.text source: UM.Theme.getIcon("arrow_top") @@ -498,7 +495,6 @@ UM.Dialog anchors.horizontalCenter: parent.horizontalCenter width: Math.round(parent.width / 2) height: Math.round(parent.height / 2) - sourceSize.width: width sourceSize.height: height color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") : control.pressed ? UM.Theme.getColor("action_button_active_text") : diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index abfe3080c2..fa94bc88b2 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -107,7 +107,6 @@ Item height: UM.Theme.getSize("button_icon").height color: UM.Theme.getColor("toolbar_button_text") - sourceSize.width: width sourceSize.height: height } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index be44c0f374..61374f9d99 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -52,7 +52,6 @@ Item bottom: parent.bottom right: parent.right } - sourceSize.width: width sourceSize.height: height visible: installedPackages != 0 color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 4fb70541d2..8a2fdc8bc8 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -48,8 +48,6 @@ Rectangle right: parent.right bottomMargin: UM.Theme.getSize("default_lining").width } - sourceSize.width: width - sourceSize.height: height visible: installedPackages != 0 color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") source: "../images/installed_check.svg" diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 2107264dff..54d77f7d59 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -50,8 +50,6 @@ Button source: "" height: buttonText.height width: visible ? height : 0 - sourceSize.width: width - sourceSize.height: height color: button.hovered ? button.textHoverColor : button.textColor visible: source != "" && !button.isIconOnRightSide anchors.verticalCenter: parent.verticalCenter @@ -78,8 +76,6 @@ Button source: buttonIconLeft.source height: buttonText.height width: visible ? height : 0 - sourceSize.width: width - sourceSize.height: height color: buttonIconLeft.color visible: source != "" && button.isIconOnRightSide anchors.verticalCenter: buttonIconLeft.verticalCenter diff --git a/resources/qml/ActionPanel/PrintInformationWidget.qml b/resources/qml/ActionPanel/PrintInformationWidget.qml index 82707576e0..436649c4e1 100644 --- a/resources/qml/ActionPanel/PrintInformationWidget.qml +++ b/resources/qml/ActionPanel/PrintInformationWidget.qml @@ -18,9 +18,6 @@ UM.RecolorImage width: UM.Theme.getSize("section_icon").width height: UM.Theme.getSize("section_icon").height - sourceSize.width: width - sourceSize.height: height - color: popup.opened ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium") MouseArea diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index 25c9bbf74b..94eca4e7c0 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -39,8 +39,6 @@ UM.Dialog source: UM.Theme.getImage("logo") - sourceSize.width: width - sourceSize.height: height anchors.top: parent.top anchors.topMargin: ((base.minimumWidth - width) / 2) | 0 anchors.horizontalCenter: parent.horizontalCenter diff --git a/resources/qml/Dialogs/AddMachineDialog.qml b/resources/qml/Dialogs/AddMachineDialog.qml index 918c717b94..f00359869c 100644 --- a/resources/qml/Dialogs/AddMachineDialog.qml +++ b/resources/qml/Dialogs/AddMachineDialog.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2018 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -156,7 +156,6 @@ UM.Dialog 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: palette.windowText source: base.activeCategory == section ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_right") diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index b438f0398c..9bedaa940c 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -139,8 +139,6 @@ Item verticalCenter: parent.verticalCenter margins: background.padding } - sourceSize.width: width - sourceSize.height: height visible: source != "" width: height height: Math.round(0.2 * base.height) diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index 742c2a9dfe..49ad73a32e 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -22,8 +22,6 @@ Item id: mainIcon anchors.fill: parent - sourceSize.width: parent.width - sourceSize.height: parent.height source: UM.Theme.getIcon("extruder_button") color: extruderEnabled ? materialColor: "gray" } @@ -64,7 +62,6 @@ Item id: disabledIcon anchors.fill: parent anchors.margins: UM.Theme.getSize("thick_lining").width - sourceSize.width: width sourceSize.height: width source: UM.Theme.getIcon("cross1") visible: !extruderEnabled diff --git a/resources/qml/IconLabel.qml b/resources/qml/IconLabel.qml index 386ed0ae01..f925b6eab5 100644 --- a/resources/qml/IconLabel.qml +++ b/resources/qml/IconLabel.qml @@ -31,9 +31,6 @@ Item width: UM.Theme.getSize("section_icon").width height: width - sourceSize.width: width - sourceSize.height: height - color: label.color visible: source != "" } diff --git a/resources/qml/IconWithText.qml b/resources/qml/IconWithText.qml index dcb3ef7851..22599b3aed 100644 --- a/resources/qml/IconWithText.qml +++ b/resources/qml/IconWithText.qml @@ -37,8 +37,6 @@ Item width: UM.Theme.getSize("section_icon").width height: UM.Theme.getSize("section_icon").height - sourceSize.width: width - sourceSize.height: height color: "black" anchors diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 717d6e925b..935cb723de 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -60,7 +60,6 @@ Item { { width: UM.Theme.getSize("save_button_specs_icons").width; height: UM.Theme.getSize("save_button_specs_icons").height; - sourceSize.width: width; sourceSize.height: width; color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene"); source: UM.Theme.getIcon("pencil"); diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 34936e9b5a..fa0594e2ae 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -54,9 +54,6 @@ Rectangle source: UM.Theme.getImage("logo") width: UM.Theme.getSize("logo").width height: UM.Theme.getSize("logo").height - - sourceSize.width: width - sourceSize.height: height } Row diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 7ba7202819..4a17e8eed8 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -95,8 +95,6 @@ Button anchors.left: parent.left width: UM.Theme.getSize("main_window_header_button_icon").width height: UM.Theme.getSize("main_window_header_button_icon").height - sourceSize.width: width - sourceSize.height: height source: UM.Theme.getIcon("buildplate") color: UM.Theme.getColor("text") } diff --git a/resources/qml/ObjectsList.qml b/resources/qml/ObjectsList.qml index 8c8eaa16ae..8f45b3744f 100644 --- a/resources/qml/ObjectsList.qml +++ b/resources/qml/ObjectsList.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2018 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -55,7 +55,6 @@ Rectangle { width: control.width height: control.height - sourceSize.width: width sourceSize.height: width color: UM.Theme.getColor("setting_control_text") source: collapsed ? UM.Theme.getIcon("arrow_left") : UM.Theme.getIcon("arrow_bottom") diff --git a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml index c8f391dfb0..a3a0e4708f 100644 --- a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml @@ -55,7 +55,8 @@ Rectangle text: "" implicitWidth: UM.Theme.getSize("favorites_button").width implicitHeight: UM.Theme.getSize("favorites_button").height - UM.RecolorImage { + UM.RecolorImage + { anchors { verticalCenter: parent.verticalCenter @@ -63,8 +64,6 @@ Rectangle } width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width - sourceSize.height: height color: "black" source: brand_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") } diff --git a/resources/qml/Preferences/Materials/MaterialsSlot.qml b/resources/qml/Preferences/Materials/MaterialsSlot.qml index a5af17f47a..a706aaf2b9 100644 --- a/resources/qml/Preferences/Materials/MaterialsSlot.qml +++ b/resources/qml/Preferences/Materials/MaterialsSlot.qml @@ -95,8 +95,6 @@ Rectangle } width: UM.Theme.getSize("favorites_button_icon").width height: UM.Theme.getSize("favorites_button_icon").height - sourceSize.width: width - sourceSize.height: height color: { if (favorite_button.hovered) diff --git a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml index f62fc4ee16..f98c19e0b3 100644 --- a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml @@ -74,8 +74,6 @@ Rectangle } width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width - sourceSize.height: height color: "black" source: material_type_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") } diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 15cd773c90..91b5591cd8 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -59,9 +59,6 @@ Cura.ExpandableComponent width: UM.Theme.getSize("printer_status_icon").width height: UM.Theme.getSize("printer_status_icon").height - sourceSize.width: width - sourceSize.height: height - color: UM.Theme.getColor("primary") visible: isNetworkPrinter && isPrinterConnected diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index aafe36c546..196b2d6b97 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -129,23 +129,26 @@ Button 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: { if (!base.enabled) { return UM.Theme.getColor("setting_category_disabled_text") - } else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) + } + else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) { return UM.Theme.getColor("setting_category_active_hover_text") - } else if (base.pressed || (base.checkable && base.checked)) + } + else if (base.pressed || (base.checkable && base.checked)) { return UM.Theme.getColor("setting_category_active_text") - } else if (base.hovered || base.activeFocus) + } + else if (base.hovered || base.activeFocus) { return UM.Theme.getColor("setting_category_hover_text") - } else + } + else { return UM.Theme.getColor("setting_category_text") } diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index d37754d27c..fb2d5a2f4d 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -115,12 +115,12 @@ SettingItem return UM.Theme.getColor("setting_control_border") } - UM.RecolorImage { + UM.RecolorImage + { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter width: Math.round(parent.width / 2.5) height: Math.round(parent.height / 2.5) - sourceSize.width: width sourceSize.height: width color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); source: UM.Theme.getIcon("check") diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index ef1f123953..bb624bcbde 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -1,5 +1,5 @@ -// Copyright (c) 2017 Ultimaker B.V. -// Uranium is released under the terms of the LGPLv3 or higher. +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 1.1 @@ -129,13 +129,14 @@ Item } style: ButtonStyle { - background: Item { - UM.RecolorImage { + background: Item + { + UM.RecolorImage + { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width sourceSize.height: width color: control.enabled ? UM.Theme.getColor("setting_category_text") : UM.Theme.getColor("setting_category_disabled_text") source: UM.Theme.getIcon("menu") diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index e07810691e..fb4d52979d 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -731,7 +731,6 @@ Item { anchors.fill: parent anchors.margins: 2 * screenScaleFactor - sourceSize.width: width sourceSize.height: width source: UM.Theme.getIcon(model.icon) color: UM.Theme.getColor("quality_slider_unavailable") diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 90344d4644..aaa8ec18f1 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -73,7 +73,6 @@ QtObject anchors.rightMargin: Theme.getSize("default_margin").width width: Theme.getSize("standard_arrow").width height: Theme.getSize("standard_arrow").height - sourceSize.width: width sourceSize.height: width color: control.enabled ? Theme.getColor("setting_category_text") : Theme.getColor("setting_category_disabled_text") source: Theme.getIcon("arrow_bottom") @@ -257,7 +256,6 @@ QtObject anchors.bottomMargin: Theme.getSize("button").height - Math.round(Theme.getSize("button_icon").height / 4) width: Theme.getSize("standard_arrow").width height: Theme.getSize("standard_arrow").height - sourceSize.width: width sourceSize.height: width visible: control.menu != null; color: @@ -543,7 +541,6 @@ QtObject anchors.horizontalCenter: parent.horizontalCenter width: Math.round(parent.width / 2.5) height: Math.round(parent.height / 2.5) - sourceSize.width: width sourceSize.height: width color: Theme.getColor("checkbox_mark") source: control.exclusiveGroup ? Theme.getIcon("dot") : Theme.getIcon("check") @@ -585,7 +582,6 @@ QtObject anchors.horizontalCenter: parent.horizontalCenter width: Math.round(parent.width / 2.5) height: Math.round(parent.height / 2.5) - sourceSize.width: width sourceSize.height: width color: Theme.getColor("checkbox_mark") source: @@ -836,7 +832,6 @@ QtObject anchors.horizontalCenter: parent.horizontalCenter width: Math.floor(control.width / 2) height: Math.floor(control.height / 2) - sourceSize.width: width sourceSize.height: width color: { -- cgit v1.2.3 From de78c44461d89061a5110d30d3b93066dc07bfc1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 16:43:13 +0100 Subject: Fix configuration drop-down for dark theme This actually changes the secondary colour to be darker for the dark theme, to be more in line with the general theme then. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 1 + resources/themes/cura-dark/theme.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 72b640e94a..fe2bf34e35 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -90,6 +90,7 @@ Item radius: tabBar.visible ? UM.Theme.getSize("default_radius").width : 0 border.width: tabBar.visible ? UM.Theme.getSize("default_lining").width : 0 border.color: UM.Theme.getColor("lining") + color: UM.Theme.getColor("main_background") //Remove rounding and lining at the top. Rectangle diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 078f04db1a..d9ef74ebb9 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -15,7 +15,7 @@ "primary_hover": [48, 182, 231, 255], "primary_text": [255, 255, 255, 204], "border": [127, 127, 127, 255], - "secondary": [241, 242, 242, 255], + "secondary": [95, 95, 95, 255], "main_window_header_button_text_inactive": [128, 128, 128, 255], "main_window_header_button_text_hovered": [255, 255, 255, 255], -- cgit v1.2.3 From 1544ab6cf0b5b5a746e2084dffce2da7a3172067 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 17:07:59 +0100 Subject: Explicitly enable hover on ConfigurationItem Apparently the default for this depends on some system setting. In Nallath's computer that system setting makes it false by default for some reason. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 4a17e8eed8..af2712be44 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -12,6 +12,7 @@ Button id: configurationItem property var configuration: null + hoverEnabled: true height: childrenRect.height -- cgit v1.2.3 From 780e5e16917192e8f639142e1058f399a5e291f5 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 4 Dec 2018 17:09:55 +0100 Subject: Fix binding loop in PrintCoreConfiguration Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index 4064a961d5..885f02d740 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -12,7 +12,7 @@ Row id: extruderInfo property var printCoreConfiguration - height: childrenRect.height + height: information.height spacing: UM.Theme.getSize("default_margin").width //Extruder icon. -- cgit v1.2.3 From a62da4e5239b2f29d66d261d5405aa3e35f3f6d0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 09:13:48 +0100 Subject: Use setCurrentIndex instead of direct assignment This should prevent the binding from breaking and hopefully the segfault CURA-5876 --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index fe2bf34e35..2667c837ba 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -76,7 +76,7 @@ Item target: repeater.model onModelChanged: { - tabBar.currentIndex = Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) + tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex) } } } -- cgit v1.2.3 From 5d95d1143762a72e7cfe9c384c9d5752f6b888c2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 5 Dec 2018 09:52:43 +0100 Subject: Use setCurrentIndex to switch tabs at activeExtruderChanged This fixes a mysterious segfault. We still don't know why the segfault occurred though. All we know is that QML logs something about a binding loop on currentIndex, and Qt logs something about removing range [-1 through 0] from VisualItemModel. When the tab bar is then made visible, Cura crashes. It is a nondeterministic crash. After this change, we are not seeing it any more (but with any nondeterministic bug, it's hard to verify that it was actually fixed). Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 2667c837ba..18c2dabb0f 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -42,8 +42,6 @@ Item anchors.topMargin: UM.Theme.getSize("default_margin").height visible: extrudersModel.count > 1 - currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) - Repeater { id: repeater @@ -68,6 +66,18 @@ Item } } + //When active extruder changes for some other reason, switch tabs. + //Don't directly link currentIndex to Cura.ExtruderManager.activeExtruderIndex! + //This causes a segfault in Qt 5.11. Something with VisualItemModel removing index -1. We have to use setCurrentIndex instead. + Connections + { + target: Cura.ExtruderManager + onActiveExtruderChanged: + { + tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex); + } + } + //When the model of the extruders is rebuilt, the list of extruders is briefly emptied and rebuilt. //This causes the currentIndex of the tab to be in an invalid position which resets it to 0. //Therefore we need to change it back to what it was: The active extruder index. -- cgit v1.2.3