From e0ff70dc7850a0809dc79f46e9b2ab93333fec5d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 10 Nov 2021 13:47:41 +0100 Subject: [PATCH 001/377] Convert stage buttons to controls 2 --- resources/qml/MainWindow/MainWindowHeader.qml | 72 ++++++++++++++---- resources/themes/cura-light/styles.qml | 73 ------------------- 2 files changed, 59 insertions(+), 86 deletions(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 815ddff732..5ed3929125 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -1,10 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 2.0 as Controls2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.4 import UM 1.4 as UM import Cura 1.0 as Cura @@ -33,6 +31,10 @@ Item sourceSize.width: width sourceSize.height: height } + ButtonGroup + { + buttons: stagesListContainer.children + } Row { @@ -61,15 +63,61 @@ Item checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId anchors.verticalCenter: parent.verticalCenter - exclusiveGroup: mainWindowHeaderMenuGroup - style: UM.Theme.styles.main_window_header_tab + //style: UM.Theme.styles.main_window_header_tab height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) - iconSource: model.stage.iconSource - - property color overlayColor: "transparent" - property string overlayIconSource: "" // This id is required to find the stage buttons through Squish property string stageId: model.id + hoverEnabled: true + leftPadding: 2 * UM.Theme.getSize("default_margin").width + rightPadding: 2 * UM.Theme.getSize("default_margin").width + + // Set top & bottom padding to whatever space is left from height and the size of the text. + bottomPadding: Math.round((height - buttonLabel.contentHeight) / 2) + topPadding: bottomPadding + + background: Rectangle + { + radius: UM.Theme.getSize("action_button_radius").width + width: contents.width + color: + { + if (stageSelectorButton.checked) + { + return UM.Theme.getColor("main_window_header_button_background_active") + } + else + { + if (stageSelectorButton.hovered) + { + return UM.Theme.getColor("main_window_header_button_background_hovered") + } + return UM.Theme.getColor("main_window_header_button_background_inactive") + } + } + } + + contentItem: Label + { + id: buttonLabel + text: stageSelectorButton.text + anchors.centerIn: stageSelectorButton + font: UM.Theme.getFont("medium") + color: + { + if (stageSelectorButton.checked) + { + return UM.Theme.getColor("main_window_header_button_text_active") + } + else + { + if (stageSelectorButton.hovered) + { + return UM.Theme.getColor("main_window_header_button_text_hovered") + } + return UM.Theme.getColor("main_window_header_button_text_inactive") + } + } + } // This is a trick to assure the activeStage is correctly changed. It doesn't work properly if done in the onClicked (see CURA-6028) MouseArea @@ -79,12 +127,10 @@ Item } } } - - ExclusiveGroup { id: mainWindowHeaderMenuGroup } } // Shortcut button to quick access the Toolbox - Controls2.Button + Button { id: marketplaceButton text: catalog.i18nc("@action:button", "Marketplace") diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 1320b54f37..0a7ac47461 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -96,79 +96,6 @@ QtObject } } - property Component main_window_header_tab: Component - { - ButtonStyle - { - // This property will be back-propagated when the width of the label is calculated - property var buttonWidth: 0 - - background: Rectangle - { - id: backgroundRectangle - implicitHeight: control.height - implicitWidth: buttonWidth - radius: UM.Theme.getSize("action_button_radius").width - - color: - { - if (control.checked) - { - return UM.Theme.getColor("main_window_header_button_background_active") - } - else - { - if (control.hovered) - { - return UM.Theme.getColor("main_window_header_button_background_hovered") - } - return UM.Theme.getColor("main_window_header_button_background_inactive") - } - } - - } - - label: Item - { - id: contents - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - height: control.height - width: buttonLabel.width + 4 * UM.Theme.getSize("default_margin").width - - Label - { - id: buttonLabel - text: control.text - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - font: UM.Theme.getFont("medium") - color: - { - if (control.checked) - { - return UM.Theme.getColor("main_window_header_button_text_active") - } - else - { - if (control.hovered) - { - return UM.Theme.getColor("main_window_header_button_text_hovered") - } - return UM.Theme.getColor("main_window_header_button_text_inactive") - } - } - } - Component.onCompleted: - { - buttonWidth = width - } - } - - - } - } - property Component tool_button: Component { ButtonStyle From 0bb09a47838ac0da85f2c694f1cb6af91b2ce183 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 10 Nov 2021 14:57:01 +0100 Subject: [PATCH 002/377] Replace all old controls 1 comboboxes with UM.Combobox --- .../SimulationViewMenuComponent.qml | 16 +++---- .../qml/components/ToolboxInstalledTile.qml | 5 +-- .../ConfigurationMenu/CustomConfiguration.qml | 5 +-- .../RecommendedAdhesionSelector.qml | 5 +-- .../RecommendedInfillDensitySelector.qml | 5 +-- .../RecommendedSupportSelector.qml | 5 +-- resources/themes/cura-light/styles.qml | 42 ------------------- 7 files changed, 15 insertions(+), 68 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 6dde44c8ae..2c62473764 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -7,7 +7,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.1 import QtGraphicalEffects 1.0 -import UM 1.0 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -187,7 +187,7 @@ Cura.ExpandableComponent { model: CuraApplication.getExtrudersModel() - CheckBox + UM.CheckBox { id: extrudersModelCheckBox checked: viewSettings.extruder_opacities[index] > 0.5 || viewSettings.extruder_opacities[index] == undefined || viewSettings.extruder_opacities[index] == "" @@ -201,8 +201,6 @@ Cura.ExpandableComponent UM.Preferences.setValue("layerview/extruder_opacities", viewSettings.extruder_opacities.join("|")); } - style: UM.Theme.styles.checkbox - Rectangle { id: swatch @@ -277,7 +275,7 @@ Cura.ExpandableComponent } } - CheckBox + UM.CheckBox { id: legendModelCheckBox checked: model.initialValue @@ -285,8 +283,6 @@ Cura.ExpandableComponent height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height width: parent.width - style: UM.Theme.styles.checkbox - Rectangle { anchors.verticalCenter: parent.verticalCenter @@ -315,24 +311,22 @@ Cura.ExpandableComponent } } - CheckBox + UM.CheckBox { checked: viewSettings.only_show_top_layers onClicked: UM.Preferences.setValue("view/only_show_top_layers", checked ? 1.0 : 0.0) text: catalog.i18nc("@label", "Only Show Top Layers") visible: UM.SimulationView.compatibilityMode - style: UM.Theme.styles.checkbox width: parent.width } - CheckBox + UM.CheckBox { checked: viewSettings.top_layer_count == 5 onClicked: UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1) text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top") width: parent.width visible: UM.SimulationView.compatibilityMode - style: UM.Theme.styles.checkbox } Repeater diff --git a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml index e5c94fc996..fb59ff5d34 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 -import UM 1.1 as UM +import UM 1.5 as UM Item { @@ -28,7 +28,7 @@ Item spacing: UM.Theme.getSize("default_margin").width topPadding: UM.Theme.getSize("default_margin").height - CheckBox + UM.CheckBox { id: disableButton anchors.verticalCenter: pluginInfo.verticalCenter @@ -36,7 +36,6 @@ Item visible: model.type == "plugin" width: visible ? UM.Theme.getSize("checkbox").width : 0 enabled: !toolbox.isDownloading - style: UM.Theme.styles.checkbox onClicked: toolbox.isEnabled(model.id) ? toolbox.disable(model.id) : toolbox.enable(model.id) } Column diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 8376693ad1..2533f849fb 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.0 import QtQuick.Controls 1.1 as OldControls import Cura 1.0 as Cura -import UM 1.3 as UM +import UM 1.5 as UM Item { @@ -219,12 +219,11 @@ Item renderType: Text.NativeRendering } - OldControls.CheckBox + UM.CheckBox { id: enabledCheckbox enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder. height: parent.height - style: UM.Theme.styles.checkbox Binding { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml index a3a5047ee9..0aae9280e6 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -44,7 +44,7 @@ Item verticalCenter: enableAdhesionRowTitle.verticalCenter } - CheckBox + UM.CheckBox { id: enableAdhesionCheckBox anchors.verticalCenter: parent.verticalCenter @@ -52,7 +52,6 @@ Item property alias _hovered: adhesionMouseArea.containsMouse //: Setting enable printing build-plate adhesion helper checkbox - style: UM.Theme.styles.checkbox enabled: recommendedPrintSetup.settingsEnabled visible: platformAdhesionType.properties.enabled == "True" diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml index dd2e0aef2b..143eccd042 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -184,7 +184,7 @@ Item } // Gradual Support Infill Checkbox - CheckBox + UM.CheckBox { id: enableGradualInfillCheckBox property alias _hovered: enableGradualInfillMouseArea.containsMouse @@ -194,7 +194,6 @@ Item anchors.left: infillSliderContainer.left text: catalog.i18nc("@label", "Gradual infill") - style: UM.Theme.styles.checkbox enabled: recommendedPrintSetup.settingsEnabled visible: infillSteps.properties.enabled == "True" checked: parseInt(infillSteps.properties.value) > 0 diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 4e2341fb57..91d5524862 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Controls 2.3 as Controls2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -45,14 +45,13 @@ Item verticalCenter: enableSupportRowTitle.verticalCenter } - CheckBox + UM.CheckBox { id: enableSupportCheckBox anchors.verticalCenter: parent.verticalCenter property alias _hovered: enableSupportMouseArea.containsMouse - style: UM.Theme.styles.checkbox enabled: recommendedPrintSetup.settingsEnabled visible: supportEnabled.properties.enabled == "True" diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 0a7ac47461..5d9981d164 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -323,48 +323,6 @@ QtObject } } - property Component checkbox: Component - { - CheckBoxStyle - { - background: Item { } - indicator: Rectangle - { - implicitWidth: UM.Theme.getSize("checkbox").width - implicitHeight: UM.Theme.getSize("checkbox").height - - color: (control.hovered || control._hovered) ? UM.Theme.getColor("checkbox_hover") : (control.enabled ? UM.Theme.getColor("checkbox") : UM.Theme.getColor("checkbox_disabled")) - Behavior on color { ColorAnimation { duration: 50; } } - - radius: control.exclusiveGroup ? Math.round(UM.Theme.getSize("checkbox").width / 2) : UM.Theme.getSize("checkbox_radius").width - - border.width: UM.Theme.getSize("default_lining").width - border.color: (control.hovered || control._hovered) ? UM.Theme.getColor("checkbox_border_hover") : UM.Theme.getColor("checkbox_border") - - 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.height: width - color: UM.Theme.getColor("checkbox_mark") - source: control.exclusiveGroup ? UM.Theme.getIcon("Dot") : UM.Theme.getIcon("Check") - opacity: control.checked - Behavior on opacity { NumberAnimation { duration: 100; } } - } - } - label: Label - { - text: control.text - color: UM.Theme.getColor("checkbox_text") - font: UM.Theme.getFont("default") - elide: Text.ElideRight - renderType: Text.NativeRendering - } - } - } - property Component partially_checkbox: Component { CheckBoxStyle From 83be495414f9000b248296a5ecf89b700a4c0354 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 10 Nov 2021 16:37:26 +0100 Subject: [PATCH 003/377] Replace usage of controls label with our custom label This prevents copy pasting a bunch of parameters that we set by default --- .../src/qml/components/BackupListItem.qml | 12 ++----- .../components/BackupListItemDetailsRow.qml | 12 ++----- .../CuraDrive/src/qml/pages/WelcomePage.qml | 8 ++--- .../PerObjectSettingsPanel.qml | 7 ++-- plugins/PrepareStage/PrepareMenu.qml | 8 ++--- .../SimulationViewMenuComponent.qml | 33 +++++------------ .../components/ToolboxActionButtonStyle.qml | 6 ++-- .../components/ToolboxCompatibilityChart.qml | 19 +++------- .../components/ToolboxDownloadsGridTile.qml | 10 ++---- .../ToolboxDownloadsShowcaseTile.qml | 7 ++-- .../qml/components/ToolboxFooter.qml | 7 ++-- .../qml/components/ToolboxInstalledTile.qml | 12 ++----- .../qml/components/ToolboxTabButton.qml | 7 ++-- .../resources/qml/pages/WelcomePage.qml | 8 ++--- .../qml/MonitorBuildplateConfiguration.qml | 8 ++--- .../qml/MonitorConfigOverrideDialog.qml | 5 ++- .../qml/MonitorContextMenuButton.qml | 7 ++-- .../resources/qml/MonitorIconExtruder.qml | 8 ++--- .../resources/qml/MonitorPrintJobCard.qml | 23 ++++-------- .../qml/MonitorPrintJobProgressBar.qml | 13 ++----- .../resources/qml/MonitorPrinterCard.qml | 36 ++++++------------- .../resources/qml/PrintJobContextMenuItem.qml | 27 +++++++------- resources/qml/Account/AccountWidget.qml | 11 ++---- resources/qml/Account/GeneralOperations.qml | 11 ++---- resources/qml/Account/SyncState.qml | 15 +++----- resources/qml/Account/UserOperations.qml | 16 +++------ resources/qml/ActionButton.qml | 6 ++-- .../ApplicationSwitcher/ApplicationButton.qml | 6 ++-- resources/qml/CheckBoxWithTooltip.qml | 7 ++-- resources/qml/ExpandableComponent.qml | 8 ++--- resources/qml/ExpandableComponentHeader.qml | 6 ++-- resources/qml/ExpandablePopup.qml | 8 ++--- resources/qml/ExtruderIcon.qml | 8 ++--- resources/qml/IconWithText.qml | 9 ++--- resources/qml/JobSpecs.qml | 6 ++-- .../NumericTextFieldWithUnit.qml | 7 ++-- resources/qml/MainWindow/MainWindowHeader.qml | 9 ++--- .../ConfigurationMenu/ConfigurationItem.qml | 8 ++--- .../ConfigurationMenu/CustomConfiguration.qml | 34 ++++-------------- .../PrintCoreConfiguration.qml | 14 +++----- resources/qml/ObjectItemButton.qml | 7 ++-- resources/qml/ObjectSelector.qml | 6 ++-- .../Materials/MaterialsBrandSection.qml | 5 ++- .../Materials/MaterialsTypeSection.qml | 5 ++- .../Custom/CustomPrintSetup.qml | 17 +++------ .../PrintSetupSelector/Custom/MenuButton.qml | 7 ++-- .../Custom/QualitiesWithIntentMenu.qml | 20 +++-------- .../RecommendedSupportSelector.qml | 24 +++---------- resources/qml/PrintSetupTooltip.qml | 10 +++--- .../PrinterOutput/ManualPrinterControl.qml | 22 ++++-------- .../PrinterSelector/MachineSelectorButton.qml | 6 ++-- .../PrinterSelector/MachineSelectorList.qml | 6 ++-- resources/qml/Settings/SettingExtruder.qml | 25 +++---------- .../qml/Settings/SettingOptionalExtruder.qml | 18 ++++------ resources/qml/Settings/SettingUnknown.qml | 8 ++--- resources/qml/TableView.qml | 5 ++- resources/qml/ToolTip.qml | 5 ++- resources/qml/ViewsSelector.qml | 16 +++------ .../AddLocalPrinterScrollView.qml | 36 +++++-------------- .../AddNetworkPrinterScrollView.qml | 16 +++------ .../qml/WelcomePages/ChangelogContent.qml | 5 ++- resources/qml/WelcomePages/DropDownHeader.qml | 6 ++-- resources/qml/WelcomePages/DropDownWidget.qml | 6 ++-- .../qml/WelcomePages/UserAgreementContent.qml | 9 ++--- resources/qml/Widgets/CheckBox.qml | 9 ++--- resources/qml/Widgets/ComboBox.qml | 12 ++----- resources/qml/Widgets/NotificationIcon.qml | 7 ++-- resources/qml/Widgets/RadioButton.qml | 7 ++-- 68 files changed, 225 insertions(+), 572 deletions(-) diff --git a/plugins/CuraDrive/src/qml/components/BackupListItem.qml b/plugins/CuraDrive/src/qml/components/BackupListItem.qml index e35c8351b7..ced85d53bd 100644 --- a/plugins/CuraDrive/src/qml/components/BackupListItem.qml +++ b/plugins/CuraDrive/src/qml/components/BackupListItem.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.1 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -42,28 +42,22 @@ Item onClicked: backupListItem.showDetails = !backupListItem.showDetails } - Label + UM.Label { text: new Date(modelData.generated_time).toLocaleString(UM.Preferences.getValue("general/language")) - color: UM.Theme.getColor("text") elide: Text.ElideRight Layout.minimumWidth: 100 * screenScaleFactor Layout.maximumWidth: 500 * screenScaleFactor Layout.fillWidth: true - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } - Label + UM.Label { text: modelData.metadata.description - color: UM.Theme.getColor("text") elide: Text.ElideRight Layout.minimumWidth: 100 * screenScaleFactor Layout.maximumWidth: 500 * screenScaleFactor Layout.fillWidth: true - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } Cura.SecondaryButton diff --git a/plugins/CuraDrive/src/qml/components/BackupListItemDetailsRow.qml b/plugins/CuraDrive/src/qml/components/BackupListItemDetailsRow.qml index 9e4612fcf8..8ddf8e9d42 100644 --- a/plugins/CuraDrive/src/qml/components/BackupListItemDetailsRow.qml +++ b/plugins/CuraDrive/src/qml/components/BackupListItemDetailsRow.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM RowLayout { @@ -26,27 +26,21 @@ RowLayout color: UM.Theme.getColor("text") } - Label + UM.Label { id: detailName - color: UM.Theme.getColor("text") elide: Text.ElideRight Layout.minimumWidth: 50 * screenScaleFactor Layout.maximumWidth: 100 * screenScaleFactor Layout.fillWidth: true - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } - Label + UM.Label { id: detailValue - color: UM.Theme.getColor("text") elide: Text.ElideRight Layout.minimumWidth: 50 * screenScaleFactor Layout.maximumWidth: 100 * screenScaleFactor Layout.fillWidth: true - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } } diff --git a/plugins/CuraDrive/src/qml/pages/WelcomePage.qml b/plugins/CuraDrive/src/qml/pages/WelcomePage.qml index 0b207bc170..53b8819bd6 100644 --- a/plugins/CuraDrive/src/qml/pages/WelcomePage.qml +++ b/plugins/CuraDrive/src/qml/pages/WelcomePage.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 import QtQuick.Window 2.2 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura import "../components" @@ -28,18 +28,14 @@ Column width: Math.round(parent.width / 4) } - Label + UM.Label { id: welcomeTextLabel text: catalog.i18nc("@description", "Backup and synchronize your Cura settings.") width: Math.round(parent.width / 2) - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter anchors.horizontalCenter: parent.horizontalCenter wrapMode: Label.WordWrap - renderType: Text.NativeRendering } Cura.PrimaryButton diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 9957171379..c97989c449 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -5,7 +5,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import ".." @@ -126,13 +126,10 @@ Item } - Label + UM.Label { id: meshTypeLabel - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") height: UM.Theme.getSize("setting").height - verticalAlignment: Text.AlignVCenter } diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index cf7665bda6..f0779df98f 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -5,7 +5,7 @@ import QtQuick 2.9 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -131,14 +131,10 @@ Item height: UM.Theme.getSize("action_button").height hoverEnabled: true - contentItem: Label + contentItem: UM.Label { text: model.displayText - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter - width: contentWidth height: parent.height } diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 2c62473764..379da63c28 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -43,22 +43,19 @@ Cura.ExpandableComponent headerItem: Item { - Label + UM.Label { id: colorSchemeLabel text: catalog.i18nc("@label", "Color scheme") - verticalAlignment: Text.AlignVCenter height: parent.height elide: Text.ElideRight font: UM.Theme.getFont("medium") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } - Label + UM.Label { text: layerTypeCombobox.currentText - verticalAlignment: Text.AlignVCenter anchors { left: colorSchemeLabel.right @@ -68,8 +65,6 @@ Cura.ExpandableComponent height: parent.height elide: Text.ElideRight font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } } @@ -165,16 +160,13 @@ Cura.ExpandableComponent } } - Label + UM.Label { id: compatibilityModeLabel text: catalog.i18nc("@label", "Compatibility Mode") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") visible: UM.SimulationView.compatibilityMode height: UM.Theme.getSize("layerview_row").height width: parent.width - renderType: Text.NativeRendering } Item // Spacer @@ -213,12 +205,11 @@ Cura.ExpandableComponent border.color: UM.Theme.getColor("lining") } - Label + UM.Label { text: model.name elide: Text.ElideRight color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") anchors { verticalCenter: parent.verticalCenter @@ -227,7 +218,6 @@ Cura.ExpandableComponent leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2) rightMargin: UM.Theme.getSize("default_margin").width * 2 } - renderType: Text.NativeRendering } } } @@ -347,7 +337,7 @@ Cura.ExpandableComponent } } - Label + UM.Label { text: label visible: viewSettings.show_legend @@ -356,8 +346,6 @@ Cura.ExpandableComponent height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height width: parent.width color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering Rectangle { anchors.verticalCenter: parent.verticalCenter @@ -382,7 +370,7 @@ Cura.ExpandableComponent width: parent.width height: UM.Theme.getSize("layerview_row").height - Label //Minimum value. + UM.Label //Minimum value. { text: { @@ -413,12 +401,9 @@ Cura.ExpandableComponent return catalog.i18nc("@label","min") } anchors.left: parent.left - color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } - Label //Unit in the middle. + UM.Label //Unit in the middle. { text: { @@ -450,10 +435,9 @@ Cura.ExpandableComponent anchors.horizontalCenter: parent.horizontalCenter color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") } - Label //Maximum value. + UM.Label //Maximum value. { text: { if (UM.SimulationView.layerActivity && CuraApplication.platformActivity) @@ -484,7 +468,6 @@ Cura.ExpandableComponent anchors.right: parent.right color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") } } diff --git a/plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml b/plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml index eff74278c9..4c8504781a 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml @@ -4,7 +4,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 -import UM 1.1 as UM +import UM 1.5 as UM ButtonStyle { @@ -19,11 +19,9 @@ ButtonStyle color: UM.Theme.getColor("lining") } } - label: Label + label: UM.Label { text: control.text - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } } \ No newline at end of file diff --git a/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml index e1f88a473f..265610a55e 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml @@ -27,7 +27,7 @@ Item // This is a bit of a hack, but the whole QML is pretty messy right now. This needs a big overhaul. height: visible ? heading.height + table.height: 0 - Label + UM.Label { id: heading width: parent.width @@ -35,7 +35,6 @@ Item wrapMode: Text.WordWrap color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering } TableView @@ -92,29 +91,25 @@ Item itemDelegate: Item { height: UM.Theme.getSize("toolbox_chart_row").height - Label + UM.Label { anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight text: styleData.value || "" color: UM.Theme.getColor("text_medium") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } } Component { id: columnTextDelegate - Label + UM.Label { anchors.fill: parent - verticalAlignment: Text.AlignVCenter + text: styleData.value || "" elide: Text.ElideRight color: UM.Theme.getColor("text_medium") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } } @@ -152,7 +147,7 @@ Item } } - Label + UM.Label { id: dataSheetLinks anchors.top: compatibilityItem.bottom @@ -200,10 +195,6 @@ Item return result } - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"]) - renderType: Text.NativeRendering } } diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml index c310bd7121..c53c80f2ea 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Item @@ -98,27 +98,23 @@ Item bottom: parent.bottom } - Label + UM.Label { id: name text: model.name width: parent.width elide: Text.ElideRight - color: UM.Theme.getColor("text") font: UM.Theme.getFont("default_bold") } - Label + UM.Label { id: info text: model.description elide: Text.ElideRight width: parent.width wrapMode: Text.WordWrap - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") anchors.top: name.bottom anchors.bottom: parent.bottom - verticalAlignment: Text.AlignVCenter maximumLineCount: 2 } } diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml index 6695921126..2e8162b0fb 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 -import UM 1.1 as UM +import UM 1.5 as UM Rectangle { @@ -34,7 +34,7 @@ Rectangle horizontalCenter: parent.horizontalCenter } } - Label + UM.Label { id: packageName text: model.name @@ -43,15 +43,12 @@ Rectangle horizontalCenter: parent.horizontalCenter top: thumbnail.bottom } - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter - renderType: Text.NativeRendering height: UM.Theme.getSize("toolbox_heading_label").height width: parent.width - UM.Theme.getSize("default_margin").width wrapMode: Text.WordWrap elide: Text.ElideRight font: UM.Theme.getFont("medium_bold") - color: UM.Theme.getColor("text") } UM.RecolorImage { diff --git a/plugins/Toolbox/resources/qml/components/ToolboxFooter.qml b/plugins/Toolbox/resources/qml/components/ToolboxFooter.qml index 9863bd9a93..f5309e503b 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxFooter.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxFooter.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -14,12 +14,10 @@ Item anchors.bottom: parent.bottom height: visible ? UM.Theme.getSize("toolbox_footer").height : 0 - Label + UM.Label { text: catalog.i18nc("@info", "You will need to restart Cura before changes in packages have effect.") - color: UM.Theme.getColor("text") height: UM.Theme.getSize("toolbox_footer_button").height - verticalAlignment: Text.AlignVCenter wrapMode: Text.WordWrap anchors { @@ -29,7 +27,6 @@ Item right: restartButton.left rightMargin: UM.Theme.getSize("default_margin").width } - renderType: Text.NativeRendering } Cura.PrimaryButton diff --git a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml index fb59ff5d34..80acac924b 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml @@ -72,7 +72,7 @@ Item id: authorInfo width: Math.floor(UM.Theme.getSize("toolbox_action_button").width * 1.25) - Label + UM.Label { text: { @@ -89,24 +89,18 @@ Item width: parent.width height: Math.floor(UM.Theme.getSize("toolbox_property_label").height) wrapMode: Text.WordWrap - verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft onLinkActivated: Qt.openUrlExternally("mailto:" + model.author_email + "?Subject=Cura: " + model.name + " Plugin") color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining") - linkColor: UM.Theme.getColor("text_link") - renderType: Text.NativeRendering } - Label + UM.Label { text: model.version - font: UM.Theme.getFont("default") width: parent.width height: UM.Theme.getSize("toolbox_property_label").height - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft - renderType: Text.NativeRendering } } ToolboxInstalledTileActions diff --git a/plugins/Toolbox/resources/qml/components/ToolboxTabButton.qml b/plugins/Toolbox/resources/qml/components/ToolboxTabButton.qml index 7a7d2be48a..a9e98a67d5 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxTabButton.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxTabButton.qml @@ -3,7 +3,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.1 as UM +import UM 1.5 as UM Button { @@ -28,17 +28,14 @@ Button } } - contentItem: Label + contentItem: UM.Label { id: label text: control.text color: UM.Theme.getColor("toolbox_header_button_text_inactive") font: UM.Theme.getFont("medium") - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter - - renderType: Text.NativeRendering } states: diff --git a/plugins/Toolbox/resources/qml/pages/WelcomePage.qml b/plugins/Toolbox/resources/qml/pages/WelcomePage.qml index 04110cbc0f..49500e195f 100644 --- a/plugins/Toolbox/resources/qml/pages/WelcomePage.qml +++ b/plugins/Toolbox/resources/qml/pages/WelcomePage.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 import QtQuick.Window 2.2 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Column @@ -16,18 +16,14 @@ Column height: childrenRect.height anchors.centerIn: parent - Label + UM.Label { id: welcomeTextLabel text: catalog.i18nc("@description", "Please sign in to get verified plugins and materials for Ultimaker Cura Enterprise") width: Math.round(parent.width / 2) - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter anchors.horizontalCenter: parent.horizontalCenter wrapMode: Label.WordWrap - renderType: Text.NativeRendering } Cura.PrimaryButton diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml index 598d0ec70a..60e3726a32 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml @@ -3,7 +3,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.0 -import UM 1.3 as UM +import UM 1.5 as UM /** * This component comprises a buildplate icon and the buildplate name. It is @@ -57,19 +57,15 @@ Item } } - Label + UM.Label { id: buildplateLabel - color: UM.Theme.getColor("text") elide: Text.ElideRight - font: UM.Theme.getFont("default") // 12pt, regular text: buildplate ? buildplate : "" visible: text !== "" // FIXED-LINE-HEIGHT: height: 18 * screenScaleFactor // TODO: Theme! - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 1fe766d9f7..46497cc389 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -5,7 +5,7 @@ import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 -import UM 1.3 as UM +import UM 1.5 as UM UM.Dialog { @@ -63,7 +63,7 @@ UM.Dialog } ] - Label + UM.Label { anchors { @@ -72,7 +72,6 @@ UM.Dialog bottomMargin: 56 * screenScaleFactor // TODO: Theme! } wrapMode: Text.WordWrap - renderType: Text.NativeRendering text: { if (!printer || !printer.activePrintJob) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml index 0be3732cef..1c6cfda121 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml @@ -3,7 +3,7 @@ import QtQuick 2.3 import QtQuick.Controls 2.0 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Button @@ -17,13 +17,12 @@ Button radius: Math.round(0.5 * width) width: base.width } - contentItem: Label { + contentItem: UM.Label + { color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") font.pixelSize: 32 * screenScaleFactor horizontalAlignment: Text.AlignHCenter text: base.text - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering; } height: width hoverEnabled: enabled diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml index ad0e8a6777..f22ac53298 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml @@ -3,7 +3,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.0 -import UM 1.3 as UM +import UM 1.5 as UM /** * This component is a sort of "super icon" which includes a colored SVG image @@ -35,18 +35,16 @@ Item width: size } - Label + UM.Label { id: positionLabel anchors.centerIn: icon font: UM.Theme.getFont("small") - color: UM.Theme.getColor("text") height: Math.round(size / 2) horizontalAlignment: Text.AlignHCenter text: position + 1 - verticalAlignment: Text.AlignVCenter + width: Math.round(size / 2) visible: position >= 0 - renderType: Text.NativeRendering } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml index 65bf4e3a07..2974e5ce6b 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml @@ -2,7 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 import QtQuick.Controls 2.0 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura /** @@ -55,10 +55,9 @@ Item visible: !printJob radius: 2 * screenScaleFactor // TODO: Theme! } - Label + UM.Label { text: printJob && printJob.name ? printJob.name : "" - color: UM.Theme.getColor("text") elide: Text.ElideRight font: UM.Theme.getFont("medium") // 14pt, regular visible: printJob @@ -66,8 +65,6 @@ Item // FIXED-LINE-HEIGHT: width: parent.width height: parent.height - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } @@ -86,18 +83,15 @@ Item radius: 2 * screenScaleFactor // TODO: Theme! } - Label + UM.Label { text: printJob ? OutputDevice.formatDuration(printJob.timeTotal) : "" - color: UM.Theme.getColor("text") elide: Text.ElideRight font: UM.Theme.getFont("medium") // 14pt, regular visible: printJob // FIXED-LINE-HEIGHT: height: Math.round(18 * screenScaleFactor) // TODO: Theme! - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } @@ -116,11 +110,10 @@ Item radius: 2 * screenScaleFactor // TODO: Theme! } - Label + UM.Label { id: printerAssignmentLabel anchors.verticalCenter: parent.verticalCenter - color: UM.Theme.getColor("text") elide: Text.ElideRight font: UM.Theme.getFont("medium") // 14pt, regular text: { @@ -143,8 +136,6 @@ Item // FIXED-LINE-HEIGHT: height: parent.height - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } Row @@ -186,17 +177,15 @@ Item height: Math.round(72 * screenScaleFactor) // TODO: Theme! } - Label { + UM.Label + { text: printJob && printJob.owner ? printJob.owner : "" - color: UM.Theme.getColor("text") elide: Text.ElideRight font: UM.Theme.getFont("medium") // 14pt, regular anchors.top: printerConfiguration.top // FIXED-LINE-HEIGHT: height: Math.round(18 * screenScaleFactor) // TODO: Theme! - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index 6ad295beec..c78e4ca1b8 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -4,7 +4,7 @@ import QtQuick 2.3 import QtQuick.Controls.Styles 1.3 import QtQuick.Controls 1.4 -import UM 1.3 as UM +import UM 1.5 as UM /** * NOTE: For most labels, a fixed height with vertical alignment is used to make @@ -34,7 +34,7 @@ Item width: UM.Theme.getSize("monitor_progress_bar").width } - Label + UM.Label { id: percentLabel anchors @@ -46,14 +46,11 @@ Item text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" color: printJob && printJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") width: contentWidth - font: UM.Theme.getFont("default") // 12pt, regular // FIXED-LINE-HEIGHT: height: UM.Theme.getSize("monitor_text_line").height - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } - Label + UM.Label { id: statusLabel anchors @@ -62,8 +59,6 @@ Item leftMargin: UM.Theme.getSize("monitor_margin").width verticalCenter: parent.verticalCenter } - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") text: { if (!printJob) @@ -104,7 +99,5 @@ Item // FIXED-LINE-HEIGHT: height: UM.Theme.getSize("monitor_text_line").height - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 5a4556f1f7..e115cb14ee 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -4,7 +4,7 @@ import QtQuick 2.3 import QtQuick.Controls 2.0 import QtQuick.Dialogs 1.1 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura /** @@ -100,10 +100,9 @@ Item width: parent.width radius: 2 * screenScaleFactor // TODO: Theme! - Label + UM.Label { text: printer && printer.name ? printer.name : "" - color: UM.Theme.getColor("text") elide: Text.ElideRight font: UM.Theme.getFont("large") // 16pt, bold width: parent.width @@ -111,8 +110,6 @@ Item // FIXED-LINE-HEIGHT: height: parent.height - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } @@ -138,21 +135,20 @@ Item Item { id: managePrinterLink - anchors { + anchors + { top: printerFamilyPill.bottom topMargin: UM.Theme.getSize("narrow_margin").height } height: 18 * screenScaleFactor // TODO: Theme! width: childrenRect.width - Label + UM.Label { id: managePrinterText anchors.verticalCenter: managePrinterLink.verticalCenter color: UM.Theme.getColor("text_link") - font: UM.Theme.getFont("default") text: catalog.i18nc("@label link to Connect and Cloud interfaces", "Manage printer") - renderType: Text.NativeRendering } UM.RecolorImage { @@ -334,7 +330,7 @@ Item height: childrenRect.height spacing: 18 * screenScaleFactor // TODO: Theme! - Label + UM.Label { id: printerStatus anchors @@ -371,7 +367,6 @@ Item return "" } visible: text !== "" - renderType: Text.NativeRendering } Item @@ -401,7 +396,7 @@ Item height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme! visible: printer && printer.activePrintJob && !printerStatus.visible - Label + UM.Label { id: printerJobNameLabel color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") @@ -412,11 +407,9 @@ Item // FIXED-LINE-HEIGHT: height: 18 * screenScaleFactor // TODO: Theme! - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } - Label + UM.Label { id: printerJobOwnerLabel anchors @@ -427,14 +420,11 @@ Item } color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") elide: Text.ElideRight - font: UM.Theme.getFont("default") // 12pt, regular text: printer && printer.activePrintJob ? printer.activePrintJob.owner : catalog.i18nc("@label", "Anonymous") width: parent.width // FIXED-LINE-HEIGHT: height: 18 * screenScaleFactor // TODO: Theme! - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } @@ -448,21 +438,17 @@ Item visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length === 0 && !printerStatus.visible } - Label + UM.Label { anchors { verticalCenter: parent.verticalCenter } - font: UM.Theme.getFont("default") text: catalog.i18nc("@label:status", "Requires configuration changes") visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible - color: UM.Theme.getColor("text") // FIXED-LINE-HEIGHT: height: 18 * screenScaleFactor // TODO: Theme! - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } @@ -487,17 +473,15 @@ Item radius: 2 * screenScaleFactor // Todo: Theme! } } - contentItem: Label + contentItem: UM.Label { anchors.fill: parent anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme! color: UM.Theme.getColor("monitor_secondary_button_text") font: UM.Theme.getFont("medium") // 14pt, regular text: catalog.i18nc("@action:button", "Details"); - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter height: 18 * screenScaleFactor // TODO: Theme! - renderType: Text.NativeRendering } implicitHeight: 32 * screenScaleFactor // TODO: Theme! implicitWidth: 96 * screenScaleFactor // TODO: Theme! diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml index 3288896572..3cedc17360 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml @@ -1,24 +1,25 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 import QtQuick.Controls 2.0 import QtQuick.Controls.Styles 1.4 -import UM 1.3 as UM +import UM 1.5 as UM -Button { - background: Rectangle { - opacity: parent.down || parent.hovered ? 1 : 0; +Button +{ + background: Rectangle + { + opacity: parent.down || parent.hovered ? 1 : 0 color: UM.Theme.getColor("monitor_context_menu_hover") } - contentItem: Label { - color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled"); + contentItem: UM.Label + { + color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") text: parent.text - horizontalAlignment: Text.AlignLeft; - verticalAlignment: Text.AlignVCenter; - renderType: Text.NativeRendering; + horizontalAlignment: Text.AlignLeft } - height: visible ? 39 * screenScaleFactor : 0; // TODO: Theme! - hoverEnabled: true; - width: parent.width; + height: visible ? 39 * screenScaleFactor : 0 // TODO: Theme! + hoverEnabled: true + width: parent.width } diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index b058ead22f..d738c5c474 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Item @@ -46,15 +46,12 @@ Item } } - contentItem: Label + contentItem: UM.Label { id: label text: signInButton.text - font: UM.Theme.getFont("default") color: UM.Theme.getColor("primary_text") width: contentWidth - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } @@ -113,7 +110,7 @@ Item } } - Label + UM.Label { id: initialLabel anchors.verticalCenter: parent.verticalCenter @@ -121,9 +118,7 @@ Item text: accountWidget.text font: UM.Theme.getFont("large_bold") color: UM.Theme.getColor("primary_text") - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter - renderType: Text.NativeRendering } } diff --git a/resources/qml/Account/GeneralOperations.qml b/resources/qml/Account/GeneralOperations.qml index 08a621d521..5844864332 100644 --- a/resources/qml/Account/GeneralOperations.qml +++ b/resources/qml/Account/GeneralOperations.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Column @@ -12,14 +12,12 @@ Column spacing: UM.Theme.getSize("default_margin").width padding: UM.Theme.getSize("default_margin").width - Label + UM.Label { id: title anchors.horizontalCenter: parent.horizontalCenter - renderType: Text.NativeRendering text: catalog.i18nc("@label", "Sign in to the Ultimaker platform") font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") } Image @@ -33,16 +31,13 @@ Column verticalAlignment: Image.AlignVCenter } - Label + UM.Label { id: generalInformationPoints anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignLeft - renderType: Text.NativeRendering text: catalog.i18nc("@text", "- Add material profiles and plug-ins from the Marketplace\n- Back-up and sync your material profiles and plug-ins\n- Share ideas and get help from 48,000+ users in the Ultimaker community") lineHeight: 1.4 - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") } Cura.PrimaryButton diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index d5a9d392e2..f09759f845 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -1,7 +1,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Row // Sync state icon + message @@ -77,27 +77,22 @@ Row // Sync state icon + message width: childrenRect.width height: childrenRect.height - Label + UM.Label { id: stateLabel // text is determined by State - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering width: contentWidth + UM.Theme.getSize("default_margin").height height: contentHeight - verticalAlignment: Text.AlignVCenter visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled } - Label + UM.Label { id: updatePackagesButton text: catalog.i18nc("@button", "Install pending updates") color: UM.Theme.getColor("text_link") font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter height: contentHeight width: contentWidth + UM.Theme.getSize("default_margin").height visible: Cura.API.account.updatePackagesEnabled @@ -112,14 +107,12 @@ Row // Sync state icon + message } } - Label + UM.Label { id: accountSyncButton text: catalog.i18nc("@button", "Check for account updates") color: UM.Theme.getColor("text_link") font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter height: contentHeight width: contentWidth + UM.Theme.getSize("default_margin").height visible: Cura.API.account.manualSyncEnabled diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index 75a81737f2..be858df993 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Column @@ -41,16 +41,13 @@ Column anchors.verticalCenter: parent.verticalCenter color: UM.Theme.getColor("action_button_disabled") visible: !avatar.hasAvatar - Label + UM.Label { id: initialLabel anchors.centerIn: parent text: profile["username"].charAt(0).toUpperCase() font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter - renderType: Text.NativeRendering } } @@ -62,25 +59,22 @@ Column spacing: UM.Theme.getSize("narrow_margin").height width: childrenRect.width height: childrenRect.height - Label + + UM.Label { id: username - renderType: Text.NativeRendering text: profile.username font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") } SyncState { id: syncRow } - Label + UM.Label { id: lastSyncLabel - renderType: Text.NativeRendering text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime) - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } } diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 62bea5df3b..9d999f28a6 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 import QtGraphicalEffects 1.0 // For the dropshadow -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -127,18 +127,16 @@ Button elideWidth: buttonText.width } - Label + UM.Label { id: buttonText text: button.text color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor): button.textDisabledColor font: UM.Theme.getFont("medium") visible: text != "" - renderType: Text.NativeRendering height: parent.height anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter elide: Text.ElideRight Binding diff --git a/resources/qml/ApplicationSwitcher/ApplicationButton.qml b/resources/qml/ApplicationSwitcher/ApplicationButton.qml index bcf780753c..0384ca2ed5 100644 --- a/resources/qml/ApplicationSwitcher/ApplicationButton.qml +++ b/resources/qml/ApplicationSwitcher/ApplicationButton.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Button @@ -73,7 +73,7 @@ Button } } - Label + UM.Label { id: applicationDisplayName @@ -82,10 +82,8 @@ Button height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter wrapMode: Text.Wrap elide: Text.ElideRight - color: UM.Theme.getColor("text") } } } diff --git a/resources/qml/CheckBoxWithTooltip.qml b/resources/qml/CheckBoxWithTooltip.qml index e17940014a..9788cc496c 100644 --- a/resources/qml/CheckBoxWithTooltip.qml +++ b/resources/qml/CheckBoxWithTooltip.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 -import UM 1.3 as UM +import UM 1.5 as UM CheckBox { @@ -38,7 +38,7 @@ CheckBox } } - contentItem: Label + contentItem: UM.Label { anchors { @@ -47,10 +47,7 @@ CheckBox } text: checkbox.text color: UM.Theme.getColor("checkbox_text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter } ToolTip diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 694cfb9e2e..8821bcbb98 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura // The expandable component has 2 major sub components: @@ -126,7 +126,7 @@ Item color: base.enabled ? (base.expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") anchors.fill: parent - Label + UM.Label { id: disabledLabel visible: !base.enabled @@ -134,10 +134,6 @@ Item leftPadding: background.padding rightPadding: background.padding text: "" - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter - color: UM.Theme.getColor("text") wrapMode: Text.WordWrap } diff --git a/resources/qml/ExpandableComponentHeader.qml b/resources/qml/ExpandableComponentHeader.qml index 7dd1aa358a..831267acbe 100644 --- a/resources/qml/ExpandableComponentHeader.qml +++ b/resources/qml/ExpandableComponentHeader.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura // Header of the popup @@ -22,13 +22,11 @@ Cura.RoundedRectangle border.color: UM.Theme.getColor("lining") radius: UM.Theme.getSize("default_radius").width - Label + UM.Label { id: headerLabel text: "" font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter color: UM.Theme.getColor("small_button_text") height: parent.height diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index 39f2ced8aa..4e9393b086 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura // The expandable component has 2 major sub components: @@ -120,16 +120,12 @@ Item color: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") anchors.fill: parent - Label + UM.Label { id: disabledLabel visible: !base.enabled leftPadding: background.padding text: "" - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter - color: UM.Theme.getColor("text") height: parent.height } diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index 8d5852823d..b9141a449a 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -2,8 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.11 -import QtQuick.Controls 1.1 -import UM 1.2 as UM +import UM 1.5 as UM Item { @@ -43,18 +42,15 @@ Item color: extruderNumberText.color } - Label + UM.Label { id: extruderNumberText anchors.centerIn: parent text: index + 1 font: UM.Theme.getFont("small_emphasis") - color: UM.Theme.getColor("text") width: contentWidth height: contentHeight - renderType: Text.NativeRendering horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter } } } diff --git a/resources/qml/IconWithText.qml b/resources/qml/IconWithText.qml index e582aa5939..8a76481da9 100644 --- a/resources/qml/IconWithText.qml +++ b/resources/qml/IconWithText.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura // Reusable component that holds an (re-colorable) icon on the left with some text on the right. @@ -49,15 +49,10 @@ Item } } - Label + UM.Label { id: label - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - anchors { left: icon.right diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 4aa5fa8bd5..f248f74c20 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -119,15 +119,13 @@ Item } } - Label + UM.Label { id: boundingSpec anchors.top: jobNameRow.bottom anchors.left: parent.left height: UM.Theme.getSize("jobspecs_line").height - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_scene") text: CuraApplication.getSceneBoundingBoxString } diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 32e0e6dcaa..23859e40ec 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -222,7 +222,7 @@ UM.TooltipArea } } - Label + UM.Label { id: unitLabel anchors.right: parent.right @@ -230,10 +230,7 @@ UM.TooltipArea anchors.verticalCenter: parent.verticalCenter text: unitText textFormat: Text.PlainText - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering color: UM.Theme.getColor("setting_unit") - font: UM.Theme.getFont("default") } } } diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 5ed3929125..c38e1bb4ab 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.4 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import "../Account" @@ -96,7 +96,7 @@ Item } } - contentItem: Label + contentItem: UM.Label { id: buttonLabel text: stageSelectorButton.text @@ -158,15 +158,12 @@ Item } } - contentItem: Label + contentItem: UM.Label { id: label text: marketplaceButton.text - font: UM.Theme.getFont("default") color: UM.Theme.getColor("primary_text") width: contentWidth - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } anchors diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 85b653721f..49d6710606 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Button @@ -99,7 +99,7 @@ Button height: width } - Label + UM.Label { id: unknownMaterialMessage text: @@ -147,10 +147,6 @@ Button anchors.top: unknownMaterial.top wrapMode: Text.WordWrap - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter - linkColor: UM.Theme.getColor("text_link") onLinkActivated: { diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 2533f849fb..10bd5624d7 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -19,14 +19,13 @@ Item width: parent.width height: childrenRect.height - Label + UM.Label { id: header text: catalog.i18nc("@header", "Custom") font: UM.Theme.getFont("medium") color: UM.Theme.getColor("small_button_text") height: contentHeight - renderType: Text.NativeRendering anchors { @@ -56,13 +55,11 @@ Item topMargin: visible ? UM.Theme.getSize("default_margin").height : 0 } - Label + UM.Label { text: catalog.i18nc("@label", "Printer") width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width height: contentHeight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") anchors.verticalCenter: printerTypeSelector.verticalCenter anchors.left: parent.left } @@ -208,15 +205,11 @@ Item height: visible ? UM.Theme.getSize("setting_control").height : 0 visible: extrudersModel.count > 1 // If there is only one extruder, there is no point to enable/disable that. - Label + UM.Label { text: catalog.i18nc("@label", "Enabled") - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") height: parent.height width: selectors.textWidth - renderType: Text.NativeRendering } UM.CheckBox @@ -261,15 +254,11 @@ Item height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0 visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false - Label + UM.Label { text: catalog.i18nc("@label", "Material") - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") height: parent.height width: selectors.textWidth - renderType: Text.NativeRendering } OldControls.ToolButton @@ -327,15 +316,11 @@ Item height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0 visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false - Label + UM.Label { text: Cura.MachineManager.activeDefinitionVariantsName - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") height: parent.height width: selectors.textWidth - renderType: Text.NativeRendering } OldControls.ToolButton @@ -371,11 +356,10 @@ Item property bool buildplateCompatibilityWarning: Cura.MachineManager.variantBuildplateUsable // This is a space holder aligning the warning messages. - Label + UM.Label { text: "" width: selectors.textWidth - renderType: Text.NativeRendering } Item @@ -396,19 +380,15 @@ Item visible: !Cura.MachineManager.isCurrentSetupSupported || warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning } - Label + UM.Label { id: materialCompatibilityLabel anchors.left: warningImage.right anchors.leftMargin: UM.Theme.getSize("default_margin").width - verticalAlignment: Text.AlignVCenter width: selectors.controlWidth - warningImage.width - UM.Theme.getSize("default_margin").width text: catalog.i18nc("@label", "Use glue for better adhesion with this material combination.") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") visible: CuraSDKVersion == "dev" ? false : warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning wrapMode: Text.WordWrap - renderType: Text.NativeRendering } } } diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index f93727ea96..06ef0901e7 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -33,30 +33,24 @@ Item margins: UM.Theme.getSize("default_margin").width } - Label + UM.Label { text: (printCoreConfiguration !== null && 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") color: UM.Theme.getColor("text_inactive") width: parent.width } - Label + UM.Label { text: (printCoreConfiguration !== null && printCoreConfiguration.material.brand) ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct. - renderType: Text.NativeRendering elide: Text.ElideRight font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") width: parent.width } - Label + UM.Label { text: (printCoreConfiguration !== null && printCoreConfiguration.hotendID) ? printCoreConfiguration.hotendID : " " //Use space so that the height is still correct. - renderType: Text.NativeRendering elide: Text.ElideRight - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_inactive") width: parent.width } diff --git a/resources/qml/ObjectItemButton.qml b/resources/qml/ObjectItemButton.qml index 1637b8d0cd..d0cad614d8 100644 --- a/resources/qml/ObjectItemButton.qml +++ b/resources/qml/ObjectItemButton.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Button @@ -56,7 +56,7 @@ Button visible: showExtruderSwatches && extruderColor != "" } - Label + UM.Label { id: buttonText anchors @@ -67,12 +67,9 @@ Button verticalCenter: parent.verticalCenter } text: objectItemButton.text - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_scene") opacity: (outsideBuildArea) ? 0.5 : 1.0 visible: text != "" - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter elide: Text.ElideRight } diff --git a/resources/qml/ObjectSelector.qml b/resources/qml/ObjectSelector.qml index 0cdc2b3f80..5f7de1f301 100644 --- a/resources/qml/ObjectSelector.qml +++ b/resources/qml/ObjectSelector.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -51,15 +51,13 @@ Item source: objectSelector.opened ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleUp") } - Label + UM.Label { id: label anchors.left: openCloseIcon.right anchors.leftMargin: UM.Theme.getSize("default_margin").width text: catalog.i18nc("@label", "Object list") - font: UM.Theme.getFont("default") color: openCloseButton.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") - renderType: Text.NativeRendering elide: Text.ElideRight } } diff --git a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml index 04e39f33b1..f0747e697c 100644 --- a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml @@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura // An expandable list of materials. Includes both the header (this file) and the items (brandMaterialList) @@ -43,13 +43,12 @@ Item { id: brand_header width: parent.width - Label + UM.Label { id: brand_name text: sectionName height: UM.Theme.getSize("favorites_row").height width: parent.width - UM.Theme.getSize("favorites_button").width - verticalAlignment: Text.AlignVCenter leftPadding: (UM.Theme.getSize("default_margin").width / 2) | 0 } Item diff --git a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml index 09f9964604..d1d424b290 100644 --- a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml @@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -57,13 +57,12 @@ Item { left: parent ? parent.left : undefined } - Label + UM.Label { text: materialName height: UM.Theme.getSize("favorites_row").height width: parent.width - parent.leftPadding - UM.Theme.getSize("favorites_button").width id: material_type_name - verticalAlignment: Text.AlignVCenter } Item // this one causes lots of warnings { diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index cde2cd8dfc..16356e2c69 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.3 import QtQuick.Controls 1.4 as OldControls import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.6 as Cura import ".." @@ -34,7 +34,7 @@ Item rightMargin: parent.padding } - Label + UM.Label { id: profileLabel anchors @@ -46,9 +46,6 @@ Item } text: catalog.i18nc("@label", "Profile") font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter } NoIntentIcon @@ -80,21 +77,17 @@ Item anchors.right: customisedSettings.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - Label + UM.Label { id: textLabel text: Cura.MachineManager.activeQualityDisplayNameMap["main"] - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") Layout.margins: 0 Layout.maximumWidth: Math.floor(parent.width * 0.7) // Always leave >= 30% for the rest of the row. height: contentHeight - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering elide: Text.ElideRight } - Label + UM.Label { text: activeQualityDetailText() font: UM.Theme.getFont("default") @@ -103,8 +96,6 @@ Item Layout.fillWidth: true height: contentHeight - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering elide: Text.ElideRight function activeQualityDetailText() diff --git a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml index b637e20d58..40c3d73e8b 100644 --- a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml +++ b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.6 as Cura Button @@ -40,14 +40,11 @@ Button return txt } - contentItem: Label + contentItem: UM.Label { id: textLabel text: button.text != "" ? replaceText(button.text) : replaceText(button.labelText) height: contentHeight - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") color: button.enabled ? UM.Theme.getColor("text") :UM.Theme.getColor("text_inactive") } } \ No newline at end of file diff --git a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml index c879ff53fd..b03d9d4b54 100644 --- a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml +++ b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.6 as Cura Popup @@ -66,12 +66,11 @@ Popup height: childrenRect.height width: popup.contentWidth - Label + UM.Label { id: headerLabel text: model.name color: UM.Theme.getColor("text_inactive") - renderType: Text.NativeRendering width: parent.width height: visible ? contentHeight: 0 visible: qualitiesList.visibleChildren.length > 0 @@ -140,11 +139,10 @@ Popup height: childrenRect.height width: popup.contentWidth - Label + UM.Label { id: customProfileHeader text: catalog.i18nc("@label:header", "Custom profiles") - renderType: Text.NativeRendering height: visible ? contentHeight: 0 enabled: false visible: profilesList.visibleChildren.length > 1 @@ -280,29 +278,21 @@ Popup width: parent.width height: childrenRect.height - Label + UM.Label { id: textLabel text: manageProfilesButton.text height: contentHeight anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") } - Label + UM.Label { id: shortcutLabel text: Cura.Actions.manageProfiles.shortcut height: contentHeight anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") } } onClicked: diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 91d5524862..4331363fbb 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -201,7 +201,7 @@ Item } } - contentItem: Controls2.Label + contentItem:UM.Label { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left @@ -211,12 +211,10 @@ Item text: supportExtruderCombobox.currentText textFormat: Text.PlainText - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") elide: Text.ElideLeft - verticalAlignment: Text.AlignVCenter + background: Rectangle { @@ -262,28 +260,16 @@ Item height: supportExtruderCombobox.height highlighted: supportExtruderCombobox.highlightedIndex == index - contentItem: Controls2.Label + contentItem: UM.Label { anchors.fill: parent anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width text: model.name - renderType: Text.NativeRendering - color: - { - if (model.enabled) - { - UM.Theme.getColor("setting_control_text") - } - else - { - UM.Theme.getColor("action_button_disabled_text"); - } - } - font: UM.Theme.getFont("default") + color: model.enabled ? UM.Theme.getColor("setting_control_text"): UM.Theme.getColor("action_button_disabled_text") + elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width background: Rectangle diff --git a/resources/qml/PrintSetupTooltip.qml b/resources/qml/PrintSetupTooltip.qml index 91f044ceed..29fe7d6508 100644 --- a/resources/qml/PrintSetupTooltip.qml +++ b/resources/qml/PrintSetupTooltip.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.0 as UM +import UM 1.5 as UM UM.PointingRectangle { @@ -88,18 +88,16 @@ UM.PointingRectangle active: false //Only allow vertical scrolling. We should grow vertically only, but due to how the label is positioned it allocates space in the ScrollView horizontally. } - Label + UM.Label { id: label x: UM.Theme.getSize("tooltip_margins").width y: UM.Theme.getSize("tooltip_margins").height width: base.width - UM.Theme.getSize("tooltip_margins").width * 2 - wrapMode: Text.Wrap; + wrapMode: Text.Wrap textFormat: Text.RichText - font: UM.Theme.getFont("default"); - color: UM.Theme.getColor("tooltip_text"); - renderType: Text.NativeRendering + color: UM.Theme.getColor("tooltip_text") } } } diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index 3213f1ace8..57e1b26e72 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import "." @@ -62,15 +62,13 @@ Item spacing: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@label", "Jog Position") color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height - verticalAlignment: Text.AlignVCenter } GridLayout @@ -80,14 +78,12 @@ Item rowSpacing: UM.Theme.getSize("default_lining").width columnSpacing: UM.Theme.getSize("default_lining").height - Label + UM.Label { text: catalog.i18nc("@label", "X/Y") color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") width: height height: UM.Theme.getSize("setting_control").height - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter Layout.row: 0 @@ -187,14 +183,12 @@ Item { spacing: UM.Theme.getSize("default_lining").height - Label + UM.Label { text: catalog.i18nc("@label", "Z") color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") width: UM.Theme.getSize("section").height height: UM.Theme.getSize("setting_control").height - verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } @@ -252,15 +246,13 @@ Item property real currentDistance: 10 - Label + UM.Label { text: catalog.i18nc("@label", "Jog Distance") color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height - verticalAlignment: Text.AlignVCenter } Row @@ -296,15 +288,13 @@ Item spacing: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@label", "Send G-code") color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height - verticalAlignment: Text.AlignVCenter } Row diff --git a/resources/qml/PrinterSelector/MachineSelectorButton.qml b/resources/qml/PrinterSelector/MachineSelectorButton.qml index bb30cded9f..74c833f691 100644 --- a/resources/qml/PrinterSelector/MachineSelectorButton.qml +++ b/resources/qml/PrinterSelector/MachineSelectorButton.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -43,7 +43,7 @@ Button width: machineSelectorButton.width - machineSelectorButton.leftPadding height: UM.Theme.getSize("action_button").height - Label + UM.Label { id: buttonText anchors @@ -56,8 +56,6 @@ Button color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("small_button_text") font: UM.Theme.getFont("medium") visible: text != "" - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter elide: Text.ElideRight } diff --git a/resources/qml/PrinterSelector/MachineSelectorList.qml b/resources/qml/PrinterSelector/MachineSelectorList.qml index 18b1a68b20..10458ea4a4 100644 --- a/resources/qml/PrinterSelector/MachineSelectorList.qml +++ b/resources/qml/PrinterSelector/MachineSelectorList.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura ListView @@ -14,16 +14,14 @@ ListView section.property: "hasRemoteConnection" property real contentHeight: childrenRect.height - section.delegate: Label + section.delegate: UM.Label { text: section == "true" ? catalog.i18nc("@label", "Connected printers") : catalog.i18nc("@label", "Preset printers") width: parent.width height: UM.Theme.getSize("action_button").height leftPadding: UM.Theme.getSize("default_margin").width - renderType: Text.NativeRendering font: UM.Theme.getFont("medium") color: UM.Theme.getColor("text_medium") - verticalAlignment: Text.AlignVCenter } delegate: MachineSelectorButton diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index ea514eb069..071d9dbfe5 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura SettingItem @@ -143,7 +143,7 @@ SettingItem } } - contentItem: Label + contentItem: UM.Label { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left @@ -153,13 +153,8 @@ SettingItem text: control.currentText textFormat: Text.PlainText - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - elide: Text.ElideLeft - verticalAlignment: Text.AlignVCenter - background: Rectangle { id: swatch @@ -204,27 +199,15 @@ SettingItem height: control.height highlighted: control.highlightedIndex == index - contentItem: Label + contentItem: UM.Label { anchors.fill: parent anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width text: model.name - renderType: Text.NativeRendering - color: - { - if (model.enabled) - { - UM.Theme.getColor("setting_control_text") - } else - { - UM.Theme.getColor("action_button_disabled_text"); - } - } - font: UM.Theme.getFont("default") + color: model.enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("action_button_disabled_text") elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width background: Rectangle diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 94df1bcc03..19bca44460 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura SettingItem @@ -144,7 +144,7 @@ SettingItem } } - contentItem: Label + contentItem: UM.Label { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left @@ -154,12 +154,9 @@ SettingItem text: control.currentText textFormat: Text.PlainText - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter background: Rectangle { @@ -175,13 +172,15 @@ SettingItem } } - popup: Popup { + popup: Popup + { y: control.height - UM.Theme.getSize("default_lining").height width: control.width implicitHeight: contentItem.implicitHeight + 2 * UM.Theme.getSize("default_lining").width padding: UM.Theme.getSize("default_lining").width - contentItem: ListView { + contentItem: ListView + { clip: true implicitHeight: contentHeight model: control.popup.visible ? control.delegateModel : null @@ -202,7 +201,7 @@ SettingItem height: control.height highlighted: control.highlightedIndex == index - contentItem: Label + contentItem: UM.Label { anchors.fill: parent anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width @@ -210,7 +209,6 @@ SettingItem text: model.name textFormat: Text.PlainText - renderType: Text.NativeRendering color: { if (model.enabled) { @@ -219,9 +217,7 @@ SettingItem UM.Theme.getColor("action_button_disabled_text"); } } - font: UM.Theme.getFont("default") elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width background: Rectangle diff --git a/resources/qml/Settings/SettingUnknown.qml b/resources/qml/Settings/SettingUnknown.qml index 8eeb2fb6a0..645e4571b0 100644 --- a/resources/qml/Settings/SettingUnknown.qml +++ b/resources/qml/Settings/SettingUnknown.qml @@ -4,17 +4,13 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 -import UM 1.2 as UM +import UM 1.5 as UM SettingItem { - contents: Label + contents: UM.Label { anchors.fill: parent text: propertyProvider.properties.value + " " + unit - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter } } diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 1b084be5a0..db495c3dc2 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQ import QtQuick.Controls 2.3 import QtQuick.Controls.Styles 1.4 -import UM 1.2 as UM +import UM 1.5 as UM OldControls.TableView @@ -15,7 +15,7 @@ OldControls.TableView { height: tableCellLabel.implicitHeight - Label + UM.Label { id: tableCellLabel color: styleData.selected ? UM.Theme.getColor("primary_button_text") : UM.Theme.getColor("text") @@ -23,7 +23,6 @@ OldControls.TableView text: styleData.value anchors.fill: parent anchors.leftMargin: 10 * screenScaleFactor - verticalAlignment: Text.AlignVCenter } } diff --git a/resources/qml/ToolTip.qml b/resources/qml/ToolTip.qml index 3157f81d89..444794f8bf 100644 --- a/resources/qml/ToolTip.qml +++ b/resources/qml/ToolTip.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.0 as UM +import UM 1.5 as UM import Cura 1.0 as Cura ToolTip @@ -62,7 +62,7 @@ ToolTip visible: tooltip.height != 0 } - contentItem: Label + contentItem: UM.Label { id: label text: tooltip.text @@ -70,7 +70,6 @@ ToolTip wrapMode: Text.Wrap textFormat: Text.RichText color: UM.Theme.getColor("tooltip_text") - renderType: Text.NativeRendering } function show() { diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index af98469921..452cc5a09a 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Cura.ExpandablePopup @@ -44,22 +44,19 @@ Cura.ExpandablePopup headerItem: Item { - Label + UM.Label { id: title text: catalog.i18nc("@label", "View type") - verticalAlignment: Text.AlignVCenter height: parent.height elide: Text.ElideRight font: UM.Theme.getFont("medium") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } - Label + UM.Label { text: viewSelector.activeView ? viewSelector.activeView.name : "" - verticalAlignment: Text.AlignVCenter anchors { left: title.right @@ -69,8 +66,6 @@ Cura.ExpandablePopup height: parent.height elide: Text.ElideRight font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } } @@ -102,14 +97,11 @@ Cura.ExpandablePopup checkable: true checked: viewSelector.activeView != null ? viewSelector.activeView.id == id : false - contentItem: Label + contentItem: UM.Label { id: buttonText text: viewsSelectorButton.text - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter elide: Text.ElideRight } diff --git a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml index 5fbe0f3909..e1c61bb09f 100644 --- a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -146,16 +146,13 @@ Item source: base.currentSection == section ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight") } - Label + UM.Label { id: label anchors.left: arrow.right anchors.leftMargin: UM.Theme.getSize("default_margin").width - verticalAlignment: Text.AlignVCenter text: button.text font: UM.Theme.getFont("default_bold") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } } @@ -210,7 +207,7 @@ Item spacing: UM.Theme.getSize("default_margin").width padding: UM.Theme.getSize("default_margin").width - Label + UM.Label { width: parent.width - (2 * UM.Theme.getSize("default_margin").width) wrapMode: Text.Wrap @@ -228,48 +225,33 @@ Item verticalItemAlignment: Grid.AlignVCenter - Label + UM.Label { id: manufacturerLabel text: catalog.i18nc("@label", "Manufacturer") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { text: base.getMachineMetaDataEntry("manufacturer") width: parent.width - manufacturerLabel.width - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering wrapMode: Text.WordWrap } - Label + UM.Label { id: profileAuthorLabel text: catalog.i18nc("@label", "Profile author") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { text: base.getMachineMetaDataEntry("author") width: parent.width - profileAuthorLabel.width - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering wrapMode: Text.WordWrap } - Label + UM.Label { id: printerNameLabel text: catalog.i18nc("@label", "Printer name") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } Cura.TextField @@ -286,7 +268,5 @@ Item } } } - - } } diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 1209071320..51f69dfa30 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura // @@ -34,16 +34,13 @@ Item anchors.right: parent.right anchors.top: parent.top - Label + UM.Label { id: noPrinterLabel height: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("default_margin").height anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width text: catalog.i18nc("@label", "There is no printer found over your network.") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter visible: networkPrinterListView.count == 0 // Do not show if there are discovered devices. } @@ -107,16 +104,13 @@ Item { id: sectionHeading - Label + UM.Label { anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height text: section - font: UM.Theme.getFont("default") color: UM.Theme.getColor("small_button_text") - verticalAlignment: Text.AlignVCenter - renderType: Text.NativeRendering } } @@ -233,7 +227,7 @@ Item source: UM.Theme.getIcon("LinkExternal") } - Label + UM.Label { id: troubleshootingLabel anchors.right: parent.right @@ -241,8 +235,6 @@ Item text: catalog.i18nc("@label", "Troubleshooting") font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_link") - linkColor: UM.Theme.getColor("text_link") - renderType: Text.NativeRendering } MouseArea diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index d106f94c04..6af6137887 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -15,7 +15,7 @@ Item { UM.I18nCatalog { id: catalog; name: "cura" } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -24,7 +24,6 @@ Item text: catalog.i18nc("@label", "Release Notes") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } Cura.ScrollableTextArea diff --git a/resources/qml/WelcomePages/DropDownHeader.qml b/resources/qml/WelcomePages/DropDownHeader.qml index cb41ca808b..a4b416b093 100644 --- a/resources/qml/WelcomePages/DropDownHeader.qml +++ b/resources/qml/WelcomePages/DropDownHeader.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura import ".." @@ -46,16 +46,14 @@ Cura.RoundedRectangle onClicked: base.clicked() } - Label + UM.Label { id: title anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter - verticalAlignment: Text.AlignVCenter text: base.title font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering color: base.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") } diff --git a/resources/qml/WelcomePages/DropDownWidget.qml b/resources/qml/WelcomePages/DropDownWidget.qml index dde1be752b..2639a8eb43 100644 --- a/resources/qml/WelcomePages/DropDownWidget.qml +++ b/resources/qml/WelcomePages/DropDownWidget.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -88,14 +88,12 @@ Item { id: emptyComponent - Label + UM.Label { text: catalog.i18nc("@label", "Empty") height: UM.Theme.getSize("action_button").height horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering } } } diff --git a/resources/qml/WelcomePages/UserAgreementContent.qml b/resources/qml/WelcomePages/UserAgreementContent.qml index 764ef03e18..dcff613efb 100644 --- a/resources/qml/WelcomePages/UserAgreementContent.qml +++ b/resources/qml/WelcomePages/UserAgreementContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura // @@ -14,7 +14,7 @@ Item { UM.I18nCatalog { id: catalog; name: "cura" } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -23,10 +23,9 @@ Item text: catalog.i18nc("@label", "User Agreement") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } - Label + UM.Label { id: disclaimerLineLabel anchors @@ -44,8 +43,6 @@ Item textFormat: Text.RichText wrapMode: Text.WordWrap font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } Cura.PrimaryButton diff --git a/resources/qml/Widgets/CheckBox.qml b/resources/qml/Widgets/CheckBox.qml index 295283d76e..4a4af99f63 100644 --- a/resources/qml/Widgets/CheckBox.qml +++ b/resources/qml/Widgets/CheckBox.qml @@ -1,10 +1,10 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -64,14 +64,11 @@ CheckBox } } - contentItem: Label + contentItem: UM.Label { id: textLabel leftPadding: control.indicator.width + control.spacing text: control.text font: control.font - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter } } diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 36288f0f4f..1d6b26e2ce 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -65,7 +65,7 @@ ComboBox color: UM.Theme.getColor("setting_control_button") } - contentItem: Label + contentItem: UM.Label { id: contentLabel anchors.left: parent.left @@ -86,11 +86,8 @@ ComboBox } textFormat: Text.PlainText - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") color: control.currentIndex == -1 ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter } popup: Popup @@ -140,7 +137,7 @@ ComboBox return (typeof _val !== 'undefined') ? _val : "" } - contentItem: Label + contentItem: UM.Label { id: delegateLabel // FIXME: Somehow the top/bottom anchoring is not correct on Linux and it results in invisible texts. @@ -150,11 +147,8 @@ ComboBox text: delegateItem.text textFormat: Text.PlainText - renderType: Text.NativeRendering color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter } background: UM.TooltipArea diff --git a/resources/qml/Widgets/NotificationIcon.qml b/resources/qml/Widgets/NotificationIcon.qml index 5cf4d17777..7ef44559b6 100644 --- a/resources/qml/Widgets/NotificationIcon.qml +++ b/resources/qml/Widgets/NotificationIcon.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.4 as UM +import UM 1.5 as UM // @@ -22,15 +22,12 @@ Rectangle property alias labelText: notificationLabel.text property alias labelFont: notificationLabel.font - Label + UM.Label { id: notificationLabel anchors.fill: parent color: UM.Theme.getColor("primary_text") horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering // This is a bit of a hack, but we don't really have enough room for 2 characters (eg 9+). The default font // does have a tad bit to much spacing. So instead of adding a whole new font, we just modify it a bit for this diff --git a/resources/qml/Widgets/RadioButton.qml b/resources/qml/Widgets/RadioButton.qml index 13aee7ba90..18347b69da 100644 --- a/resources/qml/Widgets/RadioButton.qml +++ b/resources/qml/Widgets/RadioButton.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -43,13 +43,10 @@ RadioButton } } - contentItem: Label + contentItem: UM.Label { - verticalAlignment: Text.AlignVCenter leftPadding: radioButton.indicator.width + radioButton.spacing text: radioButton.text font: radioButton.font - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } } From f71502fe388db6dd4197f583d32e9da10f8e0a4c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 10 Nov 2021 16:46:24 +0100 Subject: [PATCH 004/377] Replace button with reusable simple button --- resources/qml/JobSpecs.qml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index f248f74c20..878051a4d0 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -41,35 +41,21 @@ Item anchors.left: parent.left height: UM.Theme.getSize("jobspecs_line").height - Button + UM.SimpleButton { id: printJobPencilIcon anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter width: UM.Theme.getSize("save_button_specs_icons").width height: UM.Theme.getSize("save_button_specs_icons").height - + iconSource: UM.Theme.getIcon("Pen") + hoverColor: UM.Theme.getColor("small_button_text_hover") + color: UM.Theme.getColor("small_button_text") onClicked: { printJobTextfield.selectAll() printJobTextfield.focus = true } - - style: ButtonStyle - { - background: Item - { - UM.RecolorImage - { - 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("small_button_text_hover") : UM.Theme.getColor("small_button_text") - source: UM.Theme.getIcon("Pen") - } - } - } } TextField From ea8969fe4e6a988d82aefcf2a613b0339a1ab20a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 10 Nov 2021 17:24:28 +0100 Subject: [PATCH 005/377] Remove multiple references to controls 1 --- .../components/ToolboxActionButtonStyle.qml | 27 ------------------- .../components/ToolboxCompatibilityChart.qml | 10 +++---- .../components/ToolboxDetailTileActions.qml | 16 +++-------- .../components/ToolboxDownloadsGridTile.qml | 2 -- .../components/ToolboxDownloadsShowcase.qml | 13 +++------ .../ToolboxDownloadsShowcaseTile.qml | 2 -- .../qml/components/ToolboxHeader.qml | 1 - .../qml/components/ToolboxInstalledTile.qml | 8 ++---- .../ToolboxInstalledTileActions.qml | 14 +++------- 9 files changed, 14 insertions(+), 79 deletions(-) delete mode 100644 plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml diff --git a/plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml b/plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml deleted file mode 100644 index 4c8504781a..0000000000 --- a/plugins/Toolbox/resources/qml/components/ToolboxActionButtonStyle.qml +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Toolbox is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 -import UM 1.5 as UM - -ButtonStyle -{ - background: Rectangle - { - implicitWidth: UM.Theme.getSize("toolbox_action_button").width - implicitHeight: UM.Theme.getSize("toolbox_action_button").height - color: "transparent" - border - { - width: UM.Theme.getSize("default_lining").width - color: UM.Theme.getColor("lining") - } - } - label: UM.Label - { - text: control.text - horizontalAlignment: Text.AlignHCenter - } -} \ No newline at end of file diff --git a/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml index 265610a55e..c749cd876b 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxCompatibilityChart.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -58,14 +58,12 @@ Item { color: UM.Theme.getColor("main_background") height: UM.Theme.getSize("toolbox_chart_row").height - Label + UM.Label { anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight text: styleData.value || "" - color: UM.Theme.getColor("text") font: UM.Theme.getFont("default_bold") - renderType: Text.NativeRendering } Rectangle { @@ -78,14 +76,12 @@ Item rowDelegate: Item { height: UM.Theme.getSize("toolbox_chart_row").height - Label + UM.Label { anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight text: styleData.value || "" color: UM.Theme.getColor("text_medium") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } } itemDelegate: Item diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/components/ToolboxDetailTileActions.qml index d683877605..db6999a491 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDetailTileActions.qml @@ -1,9 +1,7 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM import Cura 1.1 as Cura @@ -50,16 +48,12 @@ Column } } - Label + UM.Label { wrapMode: Text.WordWrap text: catalog.i18nc("@label:The string between and is the highlighted link", "Log in is required to install or update") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") visible: loginRequired width: installButton.width - renderType: Text.NativeRendering MouseArea { @@ -68,7 +62,7 @@ Column } } - Label + UM.Label { property var whereToBuyUrl: { @@ -76,12 +70,8 @@ Column return (pg_name in packageData.links) ? packageData.links[pg_name] : undefined } - renderType: Text.NativeRendering text: catalog.i18nc("@label:The string between and is the highlighted link", "Buy material spools") - linkColor: UM.Theme.getColor("text_link") visible: whereToBuyUrl != undefined - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") MouseArea { anchors.fill: parent diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml index c53c80f2ea..511d0ac91e 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsGridTile.qml @@ -2,8 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.5 as UM import Cura 1.1 as Cura diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml index a42a10aa29..e2c46c6077 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcase.qml @@ -2,9 +2,7 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 -import UM 1.1 as UM +import UM 1.5 as UM Rectangle { @@ -21,7 +19,7 @@ Rectangle { width: parent.width - parent.padding * 2 height: childrenRect.height - Label + UM.Label { id: heading text: catalog.i18nc("@label", "Premium") @@ -29,7 +27,6 @@ Rectangle height: contentHeight color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("large") - renderType: Text.NativeRendering } UM.TooltipArea { @@ -37,16 +34,12 @@ Rectangle height: childrenRect.height anchors.right: parent.right text: catalog.i18nc("@info:tooltip", "Go to Web Marketplace") - Label + UM.Label { text: "".arg(toolbox.getWebMarketplaceUrl("materials") + "?utm_source=cura&utm_medium=software&utm_campaign=marketplace-search") + catalog.i18nc("@label", "Search materials") + "" width: contentWidth height: contentHeight horizontalAlignment: Text.AlignRight - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering - - linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) visible: toolbox.viewCategory === "material" diff --git a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml index 2e8162b0fb..c4d92f7df1 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxDownloadsShowcaseTile.qml @@ -2,8 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM diff --git a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml index 2c43110af9..a84def7859 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxHeader.qml @@ -2,7 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 import UM 1.4 as UM import Cura 1.0 as Cura diff --git a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml index 80acac924b..08156f2720 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTile.qml @@ -2,8 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM Item @@ -44,7 +42,7 @@ Item topPadding: UM.Theme.getSize("narrow_margin").height property var color: model.type === "plugin" && !isEnabled ? UM.Theme.getColor("lining") : UM.Theme.getColor("text") width: Math.floor(tileRow.width - (authorInfo.width + pluginActions.width + 2 * tileRow.spacing + ((disableButton.visible) ? disableButton.width + tileRow.spacing : 0))) - Label + UM.Label { text: model.name width: parent.width @@ -53,9 +51,8 @@ Item wrapMode: Text.WordWrap font: UM.Theme.getFont("large_bold") color: pluginInfo.color - renderType: Text.NativeRendering } - Label + UM.Label { text: model.description font: UM.Theme.getFont("default") @@ -64,7 +61,6 @@ Item width: parent.width wrapMode: Text.WordWrap color: pluginInfo.color - renderType: Text.NativeRendering } } Column diff --git a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTileActions.qml b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTileActions.qml index 1726497c00..8ee3de8e0b 100644 --- a/plugins/Toolbox/resources/qml/components/ToolboxInstalledTileActions.qml +++ b/plugins/Toolbox/resources/qml/components/ToolboxInstalledTileActions.qml @@ -2,9 +2,7 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -16,15 +14,13 @@ Column width: UM.Theme.getSize("toolbox_action_button").width spacing: UM.Theme.getSize("narrow_margin").height - Label + UM.Label { visible: !model.is_installed text: catalog.i18nc("@label", "Will install upon restarting") color: UM.Theme.getColor("lining") - font: UM.Theme.getFont("default") wrapMode: Text.WordWrap width: parent.width - renderType: Text.NativeRendering } ToolboxProgressButton @@ -47,16 +43,12 @@ Column visible: canUpdate } - Label + UM.Label { wrapMode: Text.WordWrap text: catalog.i18nc("@label:The string between and is the highlighted link", "Log in is required to update") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") visible: loginRequired width: updateButton.width - renderType: Text.NativeRendering MouseArea { From 8195b9be28d1d8fd05b45605accffee6e45ca64d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 10 Nov 2021 17:30:42 +0100 Subject: [PATCH 006/377] Remove more references to old controls --- plugins/ModelChecker/ModelChecker.qml | 31 +++---------------- plugins/PrepareStage/PrepareMain.qml | 5 +-- plugins/PreviewStage/PreviewMain.qml | 6 +--- .../resources/qml/MonitorStage.qml | 2 -- .../resources/qml/PrinterVideoStream.qml | 2 -- 5 files changed, 6 insertions(+), 40 deletions(-) diff --git a/plugins/ModelChecker/ModelChecker.qml b/plugins/ModelChecker/ModelChecker.qml index ddeed063b1..41c49c9a25 100644 --- a/plugins/ModelChecker/ModelChecker.qml +++ b/plugins/ModelChecker/ModelChecker.qml @@ -2,43 +2,20 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 - import UM 1.2 as UM -Button +UM.SimpleButton { id: modelCheckerButton - UM.I18nCatalog - { - id: catalog - name: "cura" - } - visible: manager.hasWarnings - tooltip: catalog.i18nc("@info:tooltip", "Some things could be problematic in this print. Click to see tips for adjustment.") onClicked: manager.showWarnings() width: UM.Theme.getSize("save_button_specs_icons").width height: UM.Theme.getSize("save_button_specs_icons").height - + iconSource: "model_checker.svg" anchors.verticalCenter: parent ? parent.verticalCenter : undefined - - style: ButtonStyle - { - background: Item - { - UM.RecolorImage - { - width: UM.Theme.getSize("save_button_specs_icons").width; - height: UM.Theme.getSize("save_button_specs_icons").height; - sourceSize.height: width; - color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene"); - source: "model_checker.svg" - } - } - } + color: UM.Theme.getColor("text_scene") + hoverColor: UM.Theme.getColor("text_scene_hover") } diff --git a/plugins/PrepareStage/PrepareMain.qml b/plugins/PrepareStage/PrepareMain.qml index ab3cf0e07c..1347be674d 100644 --- a/plugins/PrepareStage/PrepareMain.qml +++ b/plugins/PrepareStage/PrepareMain.qml @@ -1,10 +1,7 @@ -//Copyright (c) 2020 Ultimaker B.V. +//Copyright (c) 2021 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.4 -import QtQuick.Controls 1.2 -import QtQuick.Layouts 1.1 -import QtQuick.Controls.Styles 1.1 import UM 1.0 as UM import Cura 1.0 as Cura diff --git a/plugins/PreviewStage/PreviewMain.qml b/plugins/PreviewStage/PreviewMain.qml index 2926f0d012..25e53318dc 100644 --- a/plugins/PreviewStage/PreviewMain.qml +++ b/plugins/PreviewStage/PreviewMain.qml @@ -1,11 +1,7 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.4 -import QtQuick.Controls 1.2 -import QtQuick.Layouts 1.1 -import QtQuick.Controls.Styles 1.1 - import UM 1.0 as UM import Cura 1.0 as Cura diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 5d5b3ceab4..9e73662e1d 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -2,8 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.3 as UM import Cura 1.0 as Cura diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterVideoStream.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterVideoStream.qml index 291e2a14f5..7fce1478a1 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterVideoStream.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrinterVideoStream.qml @@ -2,8 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.3 as UM import Cura 1.0 as Cura From a68584cda10bbf9db869d80c316a7039af77b4ea Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 10 Nov 2021 17:42:23 +0100 Subject: [PATCH 007/377] Replace more instances of label with UM.Label --- .../resources/qml/pages/ToolboxDetailPage.qml | 40 +++++-------------- resources/qml/LabelBar.qml | 7 +--- .../ConfigurationMenu/ConfigurationMenu.qml | 25 +++--------- resources/qml/Preferences/MachinesPage.qml | 4 +- .../Materials/MaterialsSyncDialog.qml | 39 +++++++----------- resources/qml/Settings/SettingTextField.qml | 6 +-- 6 files changed, 35 insertions(+), 86 deletions(-) diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml index 645b77a8c9..28091779a2 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml @@ -55,7 +55,7 @@ Item } } - Label + UM.Label { id: title anchors @@ -66,10 +66,8 @@ Item } text: details === null ? "" : (details.name || "") font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") width: contentWidth height: contentHeight - renderType: Text.NativeRendering } Column @@ -84,33 +82,26 @@ Item spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) width: childrenRect.width height: childrenRect.height - Label + UM.Label { text: catalog.i18nc("@label", "Version") + ":" - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } - Label + UM.Label { text: catalog.i18nc("@label", "Last updated") + ":" - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } - Label + UM.Label { text: catalog.i18nc("@label", "Brand") + ":" - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") renderType: Text.NativeRendering } - Label + UM.Label { text: catalog.i18nc("@label", "Downloads") + ":" - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } } Column @@ -125,14 +116,11 @@ Item } spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) height: childrenRect.height - Label + UM.Label { text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { text: { @@ -143,11 +131,8 @@ Item var date = new Date(details.last_updated) return date.toLocaleString(UM.Preferences.getValue("general/language")) } - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { text: { @@ -160,18 +145,11 @@ Item return "" + details.author_name + "" } } - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"]) - renderType: Text.NativeRendering } - Label + UM.Label { text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown")) - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } } } diff --git a/resources/qml/LabelBar.qml b/resources/qml/LabelBar.qml index 007c5f1f54..1a4c891954 100644 --- a/resources/qml/LabelBar.qml +++ b/resources/qml/LabelBar.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.2 as UM +import UM 1.5 as UM // The labelBar shows a set of labels that are evenly spaced from one another. // The first item is aligned to the left, the last is aligned to the right. @@ -34,13 +34,10 @@ Item Layout.maximumWidth: Math.round(index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1)) height: label.height - Label + UM.Label { id: label text: model[modelKey] - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering height: contentHeight anchors { diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index b23a8c0811..08564a57ba 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -77,46 +77,37 @@ Cura.ExpandablePopup rightMargin: UM.Theme.getSize("default_margin").width } // Label for the brand of the material - Label + UM.Label { id: materialBrandNameLabel text: model.material_brand + " " + model.material_name elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering width: parent.width visible: !truncated } - Label + UM.Label { id: materialNameLabel text: model.material_name elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering width: parent.width visible: !materialBrandNameLabel.visible && !truncated } - Label + UM.Label { id: materialTypeLabel text: model.material_type elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering width: parent.width visible: !materialBrandNameLabel.visible && !materialNameLabel.visible } // Label that shows the name of the variant - Label + UM.Label { id: variantLabel @@ -125,8 +116,6 @@ Cura.ExpandablePopup text: model.variant elide: Text.ElideRight font: UM.Theme.getFont("default_bold") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering Layout.preferredWidth: parent.width } } @@ -135,13 +124,11 @@ Cura.ExpandablePopup } // Placeholder text if there is a configuration to select but no materials (so we can't show the materials per extruder). - Label + UM.Label { text: catalog.i18nc("@label", "Select configuration") elide: Text.ElideRight font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering visible: Cura.MachineManager.activeMachine ? !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates) : false diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index a8b64f94a4..a6acfa0566 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Window 2.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -72,7 +72,7 @@ UM.ManagementPage visible: base.currentItem != null anchors.fill: parent - Label + UM.Label { id: machineName text: base.currentItem && base.currentItem.name ? base.currentItem.name : "" diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index d0cf9fafd6..5bdf1887e9 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -7,7 +7,7 @@ import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.15 import QtQuick.Window 2.1 import Cura 1.1 as Cura -import UM 1.4 as UM +import UM 1.5 as UM Window { @@ -42,17 +42,15 @@ Window anchors.fill: parent anchors.margins: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@title:header", "Sync materials with printers") font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") } - Label + UM.Label { text: catalog.i18nc("@text", "Following a few simple steps, you will be able to synchronize all your material profiles with your printers.") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") wrapMode: Text.Wrap width: parent.width } @@ -125,18 +123,16 @@ Window anchors.fill: parent anchors.margins: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@title:header", "Sign in") font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") Layout.preferredHeight: height } - Label + UM.Label { text: catalog.i18nc("@text", "To automatically sync the material profiles with all your printers connected to Digital Factory you need to be signed in in Cura.") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") wrapMode: Text.Wrap width: parent.width Layout.maximumWidth: width @@ -223,13 +219,12 @@ Window height: width anchors.verticalCenter: parent.verticalCenter } - Label + UM.Label { id: printerListHeader anchors.verticalCenter: parent.verticalCenter //Text is always defined by the states above. font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") } } Row @@ -237,7 +232,7 @@ Window Layout.preferredWidth: parent.width Layout.preferredHeight: childrenRect.height - Label + UM.Label { id: syncStatusLabel @@ -247,7 +242,6 @@ Window elide: Text.ElideRight visible: text !== "" text: "" - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") } Cura.TertiaryButton @@ -426,14 +420,13 @@ Window spacing: UM.Theme.getSize("default_margin").height - Label + UM.Label { id: printersMissingText text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") + "\n" + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") elide: Text.ElideRight } Cura.TertiaryButton @@ -540,7 +533,7 @@ Window running: true } } - Label + UM.Label { id: syncingLabel anchors.left: syncingIcon.right @@ -561,11 +554,10 @@ Window anchors.margins: UM.Theme.getSize("default_margin").width visible: cloudPrinterList.count == 0 - Label + UM.Label { text: catalog.i18nc("@title:header", "No printers found") font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") Layout.preferredWidth: width Layout.preferredHeight: height } @@ -577,7 +569,7 @@ Window Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: parent.width / 3 } - Label + UM.Label { text: catalog.i18nc("@text", "It seems like you don't have access to any printers connected to Digital Factory.") width: parent.width @@ -642,18 +634,16 @@ Window anchors.fill: parent anchors.margins: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@title:header", "Sync material profiles via USB") font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") Layout.preferredHeight: height } - Label + UM.Label { text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") wrapMode: Text.Wrap width: parent.width Layout.maximumWidth: width @@ -674,13 +664,12 @@ Window anchors.verticalCenter: parent.verticalCenter sourceSize.width: width } - Label + UM.Label { text: "1. " + catalog.i18nc("@text", "Click the export material archive button.") + "\n2. " + catalog.i18nc("@text", "Save the .umm file on a USB stick.") + "\n3. " + catalog.i18nc("@text", "Insert the USB stick into your printer and launch the procedure to load new material profiles.") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") wrapMode: Text.Wrap width: parent.width * 2 / 3 - UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index a5647e2d3a..9a2930e703 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 -import UM 1.1 as UM +import UM 1.5 as UM SettingItem { @@ -90,7 +90,7 @@ SettingItem opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35 } - Label + UM.Label { anchors { @@ -105,9 +105,7 @@ SettingItem //However the setting value is aligned, align the unit opposite. That way it stays readable with right-to-left languages. horizontalAlignment: (input.effectiveHorizontalAlignment == Text.AlignLeft) ? Text.AlignRight : Text.AlignLeft textFormat: Text.PlainText - renderType: Text.NativeRendering color: UM.Theme.getColor("setting_unit") - font: UM.Theme.getFont("default") } TextInput From 0cc46b514c831b803aea2ec9790c935a13b2eb18 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Nov 2021 15:51:42 +0100 Subject: [PATCH 008/377] Convert workspace summary dialog to Controls 2 --- resources/qml/Dialogs/WorkspaceSummaryDialog.qml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 9e0e972361..1e03a35d0a 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -2,8 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.0 as Controls2 +import QtQuick.Controls 2.9 import QtQuick.Layouts 1.3 import QtQuick.Window 2.2 @@ -82,7 +81,6 @@ UM.Dialog bottom: controls.top bottomMargin: UM.Theme.getSize("default_margin").height } - style: UM.Theme.styles.scrollview ColumnLayout { spacing: UM.Theme.getSize("default_margin").height @@ -282,7 +280,7 @@ UM.Dialog text: catalog.i18nc("@action:label", "Don't show project summary on save again") checked: dontShowAgain } - Controls2.Button + Button { id: cancel_button anchors @@ -294,7 +292,7 @@ UM.Dialog enabled: true onClicked: close() } - Controls2.Button + Button { id: ok_button anchors.right: parent.right From 54b52b6d4dd093a010426762715791fd94563881 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Nov 2021 15:53:24 +0100 Subject: [PATCH 009/377] Convert AboutDialog to controls 2 --- resources/qml/Dialogs/AboutDialog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index 1ee0b31040..c44b2bf38e 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -2,7 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.9 import QtQuick.Window 2.1 import UM 1.1 as UM @@ -97,7 +97,7 @@ UM.Dialog width: parent.width height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height) - + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ListView { id: projectsList From 980ac986df49d931e156e048a221c78807e32a4d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Nov 2021 15:59:51 +0100 Subject: [PATCH 010/377] Let DiscoverUM3Action use controls 2 --- .../resources/qml/DiscoverUM3Action.qml | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 2843e32da4..a690a1b2cb 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -5,7 +5,7 @@ import UM 1.2 as UM import Cura 1.5 as Cura import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.9 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 import QtQuick.Dialogs 1.2 @@ -112,17 +112,10 @@ Cura.MachineAction ScrollView { id: objectListContainer - frameVisible: true + width: parent.width height: base.height - contentRow.y - discoveryTip.height - - Rectangle - { - parent: viewport - anchors.fill: parent - color: palette.light - } - + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ListView { id: listview @@ -138,11 +131,13 @@ Cura.MachineAction Component.onCompleted: manager.startDiscovery() delegate: Rectangle { - height: childrenRect.height + height: printNameLabel.height color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase - width: parent.width + width: listview.width Label { + id: printNameLabel + height: contentHeight anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.right: parent.right @@ -385,7 +380,6 @@ Cura.MachineAction manualPrinterDialog.hide() } enabled: manualPrinterDialog.addressText.trim() != "" - isDefault: true } ] } From c22db1e654bfc483cb250b1f9e180b9da7aebf63 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Nov 2021 16:25:25 +0100 Subject: [PATCH 011/377] Convert FW updater to controls2 --- plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index b5b6c15f50..eb12acce88 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -2,7 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 import QtQuick.Dialogs 1.2 // For filedialog @@ -160,9 +160,7 @@ Cura.MachineAction ProgressBar { id: prog - value: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareProgress : 0 - minimumValue: 0 - maximumValue: 100 + value: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareProgress / 100 : 0 indeterminate: { if(manager.firmwareUpdater == null) From 99a5aa363f3414b65a63a81352ebaa91f1138e93 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Nov 2021 16:28:20 +0100 Subject: [PATCH 012/377] Remove unused controls imports --- plugins/SimulationView/LayerSlider.qml | 4 +--- plugins/SimulationView/PathSlider.qml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/SimulationView/LayerSlider.qml b/plugins/SimulationView/LayerSlider.qml index d2a22755ae..0a24ca9023 100644 --- a/plugins/SimulationView/LayerSlider.qml +++ b/plugins/SimulationView/LayerSlider.qml @@ -1,10 +1,8 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.2 import QtQuick.Layouts 1.1 -import QtQuick.Controls.Styles 1.1 import UM 1.0 as UM import Cura 1.0 as Cura diff --git a/plugins/SimulationView/PathSlider.qml b/plugins/SimulationView/PathSlider.qml index facdbb6a53..70e5acc4f1 100644 --- a/plugins/SimulationView/PathSlider.qml +++ b/plugins/SimulationView/PathSlider.qml @@ -1,10 +1,8 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.2 import QtQuick.Layouts 1.1 -import QtQuick.Controls.Styles 1.1 import UM 1.0 as UM import Cura 1.0 as Cura From 75cd792b002436d91ccd0fe56486817fc3284405 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Nov 2021 16:51:03 +0100 Subject: [PATCH 013/377] Convert Layerview component to controls 2 --- .../SimulationView/SimulationSliderLabel.qml | 55 +++++++++---------- .../SimulationViewMainComponent.qml | 1 - .../SimulationViewMenuComponent.qml | 1 - 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/plugins/SimulationView/SimulationSliderLabel.qml b/plugins/SimulationView/SimulationSliderLabel.qml index afd02069eb..850fff7440 100644 --- a/plugins/SimulationView/SimulationSliderLabel.qml +++ b/plugins/SimulationView/SimulationSliderLabel.qml @@ -1,14 +1,14 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.5 -import QtQuick.Controls 1.2 +import QtQuick.Controls 2.2 import QtQuick.Layouts 1.1 -import QtQuick.Controls.Styles 1.1 import UM 1.0 as UM import Cura 1.0 as Cura -UM.PointingRectangle { +UM.PointingRectangle +{ id: sliderLabelRoot // custom properties @@ -28,47 +28,40 @@ UM.PointingRectangle { borderColor: UM.Theme.getColor("lining") borderWidth: UM.Theme.getSize("default_lining").width - Behavior on height { - NumberAnimation { - duration: 50 - } - } + Behavior on height { NumberAnimation { duration: 50 } } // catch all mouse events so they're not handled by underlying 3D scene - MouseArea { + MouseArea + { anchors.fill: parent } - TextMetrics { + TextMetrics + { id: maxValueMetrics font: valueLabel.font text: maximumValue + 1 // layers are 0 based, add 1 for display value - } - TextField { + TextField + { id: valueLabel - anchors { - verticalCenter: parent.verticalCenter - horizontalCenter: parent.horizontalCenter - alignWhenCentered: false - } + anchors.centerIn: parent - width: maxValueMetrics.width + UM.Theme.getSize("default_margin").width + //width: maxValueMetrics.contentWidth + 2 * UM.Theme.getSize("default_margin").width text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array horizontalAlignment: TextInput.AlignHCenter + leftPadding: UM.Theme.getSize("narrow_margin").width + rightPadding: UM.Theme.getSize("narrow_margin").width // key bindings, work when label is currently focused (active handle in LayerSlider) Keys.onUpPressed: sliderLabelRoot.setValue(sliderLabelRoot.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1)) Keys.onDownPressed: sliderLabelRoot.setValue(sliderLabelRoot.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1)) - - style: TextFieldStyle { - textColor: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering - background: Item { } - } + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + background: Item {} onEditingFinished: { @@ -84,16 +77,18 @@ UM.PointingRectangle { } } - validator: IntValidator { + validator: IntValidator + { bottom: startFrom top: sliderLabelRoot.maximumValue + startFrom // +startFrom because maybe we want to start in a different value rather than 0 } } - - BusyIndicator { + BusyIndicator + { id: busyIndicator - anchors { + anchors + { left: parent.right leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) verticalCenter: parent.verticalCenter diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml index af60692273..aaea15025e 100644 --- a/plugins/SimulationView/SimulationViewMainComponent.qml +++ b/plugins/SimulationView/SimulationViewMainComponent.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.4 -import QtQuick.Controls 1.2 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 379da63c28..1e58fb23bb 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.4 -import QtQuick.Controls 1.2 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.1 import QtGraphicalEffects 1.0 From ef9b5506cec21261b877fe4dc3ec951412f37852 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Nov 2021 10:07:58 +0100 Subject: [PATCH 014/377] Convert postprocessing plugin to controls 2 --- .../PostProcessingPlugin.qml | 111 +++++++----------- 1 file changed, 44 insertions(+), 67 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index bbba2e7621..afafa432b5 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -2,9 +2,7 @@ // The PostProcessingPlugin is released under the terms of the AGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls 2.15 as QQC2 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.15 import QtQml.Models 2.15 as Models import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 @@ -42,7 +40,7 @@ UM.Dialog SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled } anchors.fill: parent - ExclusiveGroup + ButtonGroup { id: selectedScriptGroup } @@ -90,7 +88,7 @@ UM.Dialog { id: activeScriptButton text: manager.getScriptLabelByKey(modelData.toString()) - exclusiveGroup: selectedScriptGroup + ButtonGroup.group: selectedScriptGroup width: parent.width height: UM.Theme.getSize("setting").height checkable: true @@ -114,22 +112,18 @@ UM.Dialog base.activeScriptName = manager.getScriptLabelByKey(modelData.toString()) } - style: ButtonStyle + background: Rectangle { - background: Rectangle - { - color: activeScriptButton.checked ? palette.highlight : "transparent" - width: parent.width - height: parent.height - } - label: Label - { - wrapMode: Text.Wrap - text: control.text - elide: Text.ElideRight - color: activeScriptButton.checked ? palette.highlightedText : palette.text - } + color: activeScriptButton.checked ? palette.highlight : "transparent" } + contentItem: Label + { + wrapMode: Text.Wrap + text: activeScriptButton.text + elide: Text.ElideRight + color: activeScriptButton.checked ? palette.highlightedText : palette.text + } + } Button @@ -142,22 +136,20 @@ UM.Dialog anchors.rightMargin: base.textMargin anchors.verticalCenter: parent.verticalCenter onClicked: manager.removeScriptByIndex(index) - style: ButtonStyle + contentItem: Item { - label: Item + UM.RecolorImage { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(control.width / 2.7) - height: Math.round(control.height / 2.7) - sourceSize.height: width - color: palette.text - source: UM.Theme.getIcon("Cancel") - } + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: Math.round(removeButton.width / 2.7) + height: Math.round(removeButton.height / 2.7) + sourceSize.height: width + color: palette.text + source: UM.Theme.getIcon("Cancel") } } + } Button { @@ -176,20 +168,17 @@ UM.Dialog } return manager.moveScript(index, index + 1) } - style: ButtonStyle + contentItem: Item { - label: Item + UM.RecolorImage { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(control.width / 2.5) - height: Math.round(control.height / 2.5) - sourceSize.height: width - color: control.enabled ? palette.text : disabledPalette.text - source: UM.Theme.getIcon("ChevronSingleDown") - } + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: Math.round(downButton.width / 2.5) + height: Math.round(downButton.height / 2.5) + sourceSize.height: width + color: downButton.enabled ? palette.text : disabledPalette.text + source: UM.Theme.getIcon("ChevronSingleDown") } } } @@ -210,20 +199,17 @@ UM.Dialog } return manager.moveScript(index, index - 1) } - style: ButtonStyle + contentItem: Item { - label: Item - { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(control.width / 2.5) - height: Math.round(control.height / 2.5) - sourceSize.height: width - color: control.enabled ? palette.text : disabledPalette.text - source: UM.Theme.getIcon("ChevronSingleUp") - } + UM.RecolorImage + { + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: Math.round(upButton.width / 2.5) + height: Math.round(upButton.height / 2.5) + sourceSize.height: width + color: upButton.enabled ? palette.text : disabledPalette.text + source: UM.Theme.getIcon("ChevronSingleUp") } } } @@ -238,15 +224,8 @@ UM.Dialog anchors.top: activeScriptsList.bottom anchors.topMargin: base.textMargin onClicked: scriptsMenu.open() - style: ButtonStyle - { - label: Label - { - text: control.text - } - } } - QQC2.Menu + Menu { id: scriptsMenu width: parent.width @@ -255,7 +234,7 @@ UM.Dialog { model: manager.loadedScriptList - QQC2.MenuItem + MenuItem { text: manager.getScriptLabelByKey(modelData.toString()) onTriggered: manager.addScriptToList(modelData.toString()) @@ -310,7 +289,6 @@ UM.Dialog } visible: manager.selectedScriptDefinitionId != "" - style: UM.Theme.styles.scrollview; ListView { @@ -483,7 +461,6 @@ UM.Dialog rightButtons: Button { text: catalog.i18nc("@action:button", "Close") - iconName: "dialog-close" onClicked: dialog.accept() } From 82e2f038ac056e30c597f89d35ca416728c90dd0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Nov 2021 10:23:32 +0100 Subject: [PATCH 015/377] Convert more items to controls 2 for toolbox --- .../ToolboxConfirmUninstallResetDialog.qml | 5 ++-- .../resources/qml/pages/ToolboxAuthorPage.qml | 28 +++++-------------- .../resources/qml/pages/ToolboxDetailPage.qml | 16 ++--------- .../resources/qml/pages/ToolboxErrorPage.qml | 23 ++++----------- .../qml/pages/ToolboxLoadingPage.qml | 5 ++-- 5 files changed, 20 insertions(+), 57 deletions(-) diff --git a/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml b/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml index 1b5e4d1d46..7f37d8c187 100644 --- a/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml +++ b/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml index 2fa4224388..e84ea6012c 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml @@ -2,8 +2,7 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import UM 1.5 as UM import "../components" @@ -44,7 +43,7 @@ Item } } - Label + UM.Label { id: title anchors @@ -62,13 +61,11 @@ Item wrapMode: Text.WordWrap width: parent.width height: UM.Theme.getSize("toolbox_property_label").height - renderType: Text.NativeRendering } - Label + UM.Label { id: description text: details && details.description ? details.description : "" - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") anchors { @@ -76,7 +73,6 @@ Item left: title.left topMargin: UM.Theme.getSize("default_margin").height } - renderType: Text.NativeRendering } Column { @@ -90,19 +86,17 @@ Item spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) width: childrenRect.width - Label + UM.Label { text: catalog.i18nc("@label", "Website") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } - Label + UM.Label { text: catalog.i18nc("@label", "Email") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } } Column @@ -119,7 +113,7 @@ Item } spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) - Label + UM.Label { text: { @@ -131,14 +125,10 @@ Item } width: parent.width elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") onLinkActivated: UM.UrlUtil.openUrl(link, ["https", "http"]) - renderType: Text.NativeRendering } - Label + UM.Label { text: { @@ -148,11 +138,7 @@ Item } return "" } - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) - renderType: Text.NativeRendering } } Rectangle diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml index 28091779a2..06c361abe1 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml @@ -2,8 +2,7 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import UM 1.5 as UM import Cura 1.1 as Cura @@ -120,6 +119,7 @@ Item { text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) } + UM.Label { text: @@ -134,17 +134,7 @@ Item } UM.Label { - text: - { - if (details === null) - { - return "" - } - else - { - return "" + details.author_name + "" - } - } + text: details === null ? "" : "" + details.author_name + "" onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"]) } UM.Label diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml index e57e63dbb9..01428d039b 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml @@ -1,23 +1,12 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 +import UM 1.5 as UM -Rectangle +UM.Label { - id: page - width: parent.width - height: parent.height - color: "transparent" - Label - { - text: catalog.i18nc("@info", "Could not connect to the Cura Package database. Please check your connection.") - anchors - { - centerIn: parent - } - renderType: Text.NativeRendering - } + text: catalog.i18nc("@info", "Could not connect to the Cura Package database. Please check your connection.") + anchors.centerIn: parent } diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml index a30af6b335..77147e9ba9 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import UM 1.3 as UM Rectangle From e1d6c89cf25f4fc4221d87c4840fa8a9243d33fa Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Nov 2021 14:45:44 +0100 Subject: [PATCH 016/377] Replace toolbutton with simplebutton --- resources/qml/Settings/SettingView.qml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index cb96728973..c9f0f1119e 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -151,7 +151,7 @@ Item } } - ToolButton + UM.SimpleButton { id: settingVisibilityMenu @@ -164,25 +164,9 @@ Item } width: UM.Theme.getSize("medium_button_icon").width height: UM.Theme.getSize("medium_button_icon").height - - style: ButtonStyle - { - background: Item - { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: UM.Theme.getSize("medium_button_icon").width - height: UM.Theme.getSize("medium_button_icon").height - sourceSize.width: width - sourceSize.height: height - color: control.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") - source: UM.Theme.getIcon("Hamburger") - } - } - label: Label {} - } + iconSource: UM.Theme.getIcon("Hamburger") + hoverColor: UM.Theme.getColor("small_button_text_hover") + color: UM.Theme.getColor("small_button_text") onClicked: { From 439ba6671aee63b77225fab09c56dd8e22039cdc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Nov 2021 15:07:33 +0100 Subject: [PATCH 017/377] Removed unused imports in print monitor --- resources/qml/PrintMonitor.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 19c2562874..5be4bba6a4 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -2,8 +2,6 @@ // 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 QtQuick.Layouts 1.1 import UM 1.2 as UM From cefffe62cd617b419e77dd6e3a6f2bfb94516540 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Nov 2021 15:26:23 +0100 Subject: [PATCH 018/377] Remove most of controls 1 references from networking plugin --- .../resources/qml/CameraButton.qml | 1 - .../resources/qml/GenericPopUp.qml | 1 - .../qml/MonitorConfigOverrideDialog.qml | 2 +- .../qml/MonitorPrintJobProgressBar.qml | 2 - .../resources/qml/MonitorPrinterPill.qml | 12 +++--- .../resources/qml/MonitorQueue.qml | 40 +++++-------------- .../resources/qml/PrintJobContextMenuItem.qml | 1 - .../resources/qml/PrintWindow.qml | 5 +-- 8 files changed, 18 insertions(+), 46 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml index fde4a5ea3d..cfd9801b97 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml @@ -3,7 +3,6 @@ import QtQuick 2.3 import QtQuick.Controls 2.4 -import QtQuick.Controls.Styles 1.3 import UM 1.3 as UM import Cura 1.0 as Cura diff --git a/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml b/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml index 61981dab2c..6b03072e04 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.4 import QtQuick.Dialogs 1.1 import QtGraphicalEffects 1.0 import UM 1.3 as UM diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 46497cc389..690c50c275 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -2,7 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.3 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 import UM 1.5 as UM diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index c78e4ca1b8..be5efe6e76 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -2,8 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.3 -import QtQuick.Controls.Styles 1.3 -import QtQuick.Controls 1.4 import UM 1.5 as UM /** diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml index 4cd9d58cae..d2c9251bec 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml @@ -2,8 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.4 -import UM 1.2 as UM +import UM 1.5 as UM /** * A MonitorPrinterPill is a blue-colored tag indicating which printers a print @@ -17,20 +16,19 @@ Item implicitHeight: 18 * screenScaleFactor // TODO: Theme! implicitWidth: Math.max(printerNameLabel.contentWidth + 12 * screenScaleFactor, 36 * screenScaleFactor) // TODO: Theme! - Rectangle { + Rectangle + { id: background anchors.fill: parent color: printerNameLabel.visible ? UM.Theme.getColor("monitor_printer_family_tag") : UM.Theme.getColor("monitor_skeleton_loading") radius: 2 * screenScaleFactor // TODO: Theme! } - Label { + UM.Label + { id: printerNameLabel anchors.centerIn: parent - color: UM.Theme.getColor("text") text: monitorPrinterPill.text - font.pointSize: 10 // TODO: Theme! visible: monitorPrinterPill.text !== "" - renderType: Text.NativeRendering } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index 1b94625bf0..0ed67c2f33 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -4,7 +4,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura /** @@ -18,7 +18,7 @@ Item // they might not need to though. property bool cloudConnection: Cura.MachineManager.activeMachineIsUsingCloudConnection - Label + UM.Label { id: queuedLabel anchors @@ -26,10 +26,8 @@ Item left: queuedPrintJobs.left top: parent.top } - color: UM.Theme.getColor("text") font: UM.Theme.getFont("large") text: catalog.i18nc("@label", "Queued") - renderType: Text.NativeRendering } Item @@ -52,7 +50,7 @@ Item width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) } - Label + UM.Label { id: manageQueueText anchors @@ -64,7 +62,6 @@ Item color: UM.Theme.getColor("text_link") font: UM.Theme.getFont("medium") // 14pt, regular text: catalog.i18nc("@label link to connect manager", "Manage in browser") - renderType: Text.NativeRendering } } @@ -72,14 +69,9 @@ Item { anchors.fill: manageQueueLabel onClicked: OutputDevice.openPrintJobControlPanel() - onEntered: - { - manageQueueText.font.underline = true - } - onExited: - { - manageQueueText.font.underline = false - } + onEntered: manageQueueText.font.underline = true + + onExited: manageQueueText.font.underline = false } Row @@ -94,50 +86,38 @@ Item } spacing: 18 * screenScaleFactor // TODO: Theme! - Label + UM.Label { text: catalog.i18nc("@label", "There are no print jobs in the queue. Slice and send a job to add one.") - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") anchors.verticalCenter: parent.verticalCenter - - renderType: Text.NativeRendering visible: printJobList.count === 0 } - Label + UM.Label { text: catalog.i18nc("@label", "Print jobs") - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") // 14pt, regular anchors.verticalCenter: parent.verticalCenter width: 284 * screenScaleFactor // TODO: Theme! (Should match column size) - - renderType: Text.NativeRendering visible: printJobList.count > 0 } - Label + UM.Label { text: catalog.i18nc("@label", "Total print time") - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") // 14pt, regular anchors.verticalCenter: parent.verticalCenter width: UM.Theme.getSize("monitor_column").width - - renderType: Text.NativeRendering visible: printJobList.count > 0 } - Label + UM.Label { text: catalog.i18nc("@label", "Waiting for") - color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") // 14pt, regular anchors.verticalCenter: parent.verticalCenter width: UM.Theme.getSize("monitor_column").width - - renderType: Text.NativeRendering visible: printJobList.count > 0 } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml index 3cedc17360..c7ebf803d5 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenuItem.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM Button diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml index dcfed2f7b4..441766a8e7 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintWindow.qml @@ -2,8 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 import QtQuick.Window 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls 2.15 as NewControls +import QtQuick.Controls 2.15 import UM 1.1 as UM @@ -84,7 +83,7 @@ UM.Dialog { renderType: Text.NativeRendering; } - NewControls.ComboBox { + ComboBox { id: printerComboBox; currentIndex: 0; Behavior on height { NumberAnimation { duration: 100 } } From 752cf2d5aac47c6e58a7110fc0ecdb70be50f938 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 3 Jan 2022 16:44:42 +0100 Subject: [PATCH 019/377] Remove unused styles --- resources/themes/cura-light/styles.qml | 90 -------------------------- 1 file changed, 90 deletions(-) diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 5d9981d164..857f066c39 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -373,40 +373,6 @@ QtObject } } - property Component text_field: Component - { - TextFieldStyle - { - textColor: UM.Theme.getColor("setting_control_text") - placeholderTextColor: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") - - background: Rectangle - { - implicitHeight: control.height; - implicitWidth: control.width; - - border.width: UM.Theme.getSize("default_lining").width; - border.color: control.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border"); - radius: UM.Theme.getSize("setting_control_radius").width - - color: UM.Theme.getColor("setting_validation_ok"); - - Label - { - anchors.right: parent.right; - anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width; - anchors.verticalCenter: parent.verticalCenter; - - text: control.unit ? control.unit : "" - color: UM.Theme.getColor("setting_unit"); - font: UM.Theme.getFont("default"); - renderType: Text.NativeRendering - } - } - } - } - property Component print_setup_action_button: Component { ButtonStyle @@ -487,62 +453,6 @@ QtObject } } - property Component toolbox_action_button: Component - { - ButtonStyle - { - background: Rectangle - { - implicitWidth: UM.Theme.getSize("toolbox_action_button").width - implicitHeight: UM.Theme.getSize("toolbox_action_button").height - color: - { - if (control.installed) - { - return UM.Theme.getColor("action_button_disabled"); - } - else - { - if (control.hovered) - { - return UM.Theme.getColor("primary_hover"); - } - else - { - return UM.Theme.getColor("primary"); - } - } - - } - } - label: Label - { - text: control.text - color: - { - if (control.installed) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else - { - if (control.hovered) - { - return UM.Theme.getColor("button_text_hover"); - } - else - { - return UM.Theme.getColor("button_text"); - } - } - } - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - font: UM.Theme.getFont("default_bold") - } - } - } - property Component monitor_button_style: Component { ButtonStyle From 2aa931cbca6452c29ebdf84be6cfd899deaad895 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Jan 2022 09:48:02 +0100 Subject: [PATCH 020/377] Remove unneded styles import --- plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml | 1 - .../DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml | 1 - .../DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml | 1 - plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml | 1 - plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml | 1 - plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml | 1 - plugins/PerObjectSettingsTool/PerObjectItem.qml | 3 +-- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 1 - plugins/SimulationView/SimulationViewMainComponent.qml | 2 -- plugins/Toolbox/resources/qml/dialogs/ToolboxLicenseDialog.qml | 1 - plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml | 1 - resources/qml/Cura.qml | 1 - resources/qml/MainWindow/ApplicationMenu.qml | 1 - resources/qml/Preferences/GeneralPage.qml | 1 - resources/qml/Preferences/Materials/MaterialsList.qml | 1 - .../Recommended/RecommendedAdhesionSelector.qml | 1 - .../PrintSetupSelector/Recommended/RecommendedPrintSetup.qml | 1 - .../Recommended/RecommendedQualityProfileSelector.qml | 1 - .../Recommended/RecommendedSupportSelector.qml | 1 - 19 files changed, 1 insertion(+), 21 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml b/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml index a7297c12fb..ee40c55356 100644 --- a/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml +++ b/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.6 as Cura diff --git a/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml b/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml index 58958e0069..435e8d3f86 100644 --- a/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml +++ b/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.6 as Cura diff --git a/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml b/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml index 6d870d0c78..5271db3174 100644 --- a/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml +++ b/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.6 as Cura diff --git a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml index 5b237a3e48..0e55efeb39 100644 --- a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.6 as Cura diff --git a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml index d8ae78d96d..139333c150 100644 --- a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.6 as Cura diff --git a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml index 50d3cb61c5..46cf7e3875 100644 --- a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml @@ -5,7 +5,6 @@ import QtQuick 2.10 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.1 import UM 1.2 as UM diff --git a/plugins/PerObjectSettingsTool/PerObjectItem.qml b/plugins/PerObjectSettingsTool/PerObjectItem.qml index bb1c31e1f3..dd74721464 100644 --- a/plugins/PerObjectSettingsTool/PerObjectItem.qml +++ b/plugins/PerObjectSettingsTool/PerObjectItem.qml @@ -3,8 +3,7 @@ import QtQuick 2.1 import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.1 import UM 1.2 as UM diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 1bba094e49..18f36b2651 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -1,6 +1,5 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml index aaea15025e..4fb238f6da 100644 --- a/plugins/SimulationView/SimulationViewMainComponent.qml +++ b/plugins/SimulationView/SimulationViewMainComponent.qml @@ -2,8 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import QtQuick.Controls.Styles 1.1 import UM 1.4 as UM import Cura 1.0 as Cura diff --git a/plugins/Toolbox/resources/qml/dialogs/ToolboxLicenseDialog.qml b/plugins/Toolbox/resources/qml/dialogs/ToolboxLicenseDialog.qml index 9219f4ed32..7bbfb9bb98 100644 --- a/plugins/Toolbox/resources/qml/dialogs/ToolboxLicenseDialog.qml +++ b/plugins/Toolbox/resources/qml/dialogs/ToolboxLicenseDialog.qml @@ -6,7 +6,6 @@ import QtQuick.Dialogs 1.1 import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM import Cura 1.6 as Cura diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index 0ed67c2f33..44d8f80bb3 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index eb78240d64..f1fa4ed506 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.2 import QtGraphicalEffects 1.0 diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 62b3a71ee8..5e1c80cd17 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.2 diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index f7744e1e13..db0c8e2d23 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 -import QtQuick.Controls.Styles 1.1 import QtQuick.Controls 2.3 as NewControls diff --git a/resources/qml/Preferences/Materials/MaterialsList.qml b/resources/qml/Preferences/Materials/MaterialsList.qml index 3173fbd680..2e09ad58d9 100644 --- a/resources/qml/Preferences/Materials/MaterialsList.qml +++ b/resources/qml/Preferences/Materials/MaterialsList.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml index 0aae9280e6..08993b80a6 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index 22c4039063..b91832cbbc 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index 0823b5cb62..1d924a9223 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls 2.3 as Controls2 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.6 as Cura diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 4331363fbb..24732a31d4 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Controls 2.3 as Controls2 import UM 1.5 as UM From 722f928d12682ccc293566e8a5adaddfc695e58a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Jan 2022 10:30:07 +0100 Subject: [PATCH 021/377] Remove style from settingview --- resources/qml/Settings/SettingView.qml | 617 ++++++++++++------------- 1 file changed, 304 insertions(+), 313 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index c9f0f1119e..2b0f2a5452 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -2,9 +2,7 @@ // 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 QtQuick.Layouts 1.2 +import QtQuick.Controls 2.1 import UM 1.2 as UM import Cura 1.0 as Cura @@ -16,7 +14,7 @@ Item id: settingsView property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel() - property Action configureSettings + //property Action configureSettings property bool findingSettings Item @@ -181,14 +179,15 @@ Item // Mouse area that gathers the scroll events to not propagate it to the main view. MouseArea { - anchors.fill: scrollView + anchors.fill: contents acceptedButtons: Qt.AllButtons onWheel: wheel.accepted = true } - ScrollView + ListView { - id: scrollView + id: contents + anchors { top: filterContainer.bottom @@ -197,340 +196,332 @@ Item right: parent.right left: parent.left } + clip: true + cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item. - style: UM.Theme.styles.scrollview - flickableItem.flickableDirection: Flickable.VerticalFlick - __wheelAreaScrollSpeed: 75 // Scroll three lines in one scroll event - - ListView + model: UM.SettingDefinitionsModel { - id: contents - cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item. - - model: UM.SettingDefinitionsModel + id: definitionsModel + containerId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.id: "" + visibilityHandler: UM.SettingPreferenceVisibilityHandler { } + exclude: ["machine_settings", "command_line_settings", "infill_mesh", "infill_mesh_order", "cutting_mesh", "support_mesh", "anti_overhang_mesh"] // TODO: infill_mesh settings are excluded hardcoded, but should be based on the fact that settable_globally, settable_per_meshgroup and settable_per_extruder are false. + expanded: CuraApplication.expandedCategories + onExpandedChanged: { - id: definitionsModel - containerId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.id: "" - visibilityHandler: UM.SettingPreferenceVisibilityHandler { } - exclude: ["machine_settings", "command_line_settings", "infill_mesh", "infill_mesh_order", "cutting_mesh", "support_mesh", "anti_overhang_mesh"] // TODO: infill_mesh settings are excluded hardcoded, but should be based on the fact that settable_globally, settable_per_meshgroup and settable_per_extruder are false. - expanded: CuraApplication.expandedCategories - onExpandedChanged: + if (!findingSettings) { - if (!findingSettings) - { - // Do not change expandedCategories preference while filtering settings - // because all categories are expanded while filtering - CuraApplication.setExpandedCategories(expanded) - } + // Do not change expandedCategories preference while filtering settings + // because all categories are expanded while filtering + CuraApplication.setExpandedCategories(expanded) + } + } + onVisibilityChanged: Cura.SettingInheritanceManager.scheduleUpdate() + } + + property int indexWithFocus: -1 + property double delegateHeight: UM.Theme.getSize("section").height + 2 * UM.Theme.getSize("default_lining").height + property string activeMachineId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id : "" + delegate: Loader + { + id: delegate + + width: contents.width + height: enabled ? contents.delegateHeight: 0 + Behavior on height { NumberAnimation { duration: 100 } } + opacity: enabled ? 1 : 0 + Behavior on opacity { NumberAnimation { duration: 100 } } + enabled: provider.properties.enabled === "True" + + property var definition: model + property var settingDefinitionsModel: definitionsModel + property var propertyProvider: provider + property var globalPropertyProvider: inheritStackProvider + property bool externalResetHandler: false + + //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 + //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, + //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely. + asynchronous: model.type !== "enum" && model.type !== "extruder" && model.type !== "optional_extruder" + active: model.type !== undefined + + source: + { + switch(model.type) + { + case "int": + return "SettingTextField.qml" + case "[int]": + return "SettingTextField.qml" + case "float": + return "SettingTextField.qml" + case "enum": + return "SettingComboBox.qml" + case "extruder": + return "SettingExtruder.qml" + case "bool": + return "SettingCheckBox.qml" + case "str": + return "SettingTextField.qml" + case "category": + return "SettingCategory.qml" + case "optional_extruder": + return "SettingOptionalExtruder.qml" + default: + return "SettingUnknown.qml" } - onVisibilityChanged: Cura.SettingInheritanceManager.scheduleUpdate() } - property int indexWithFocus: -1 - property double delegateHeight: UM.Theme.getSize("section").height + 2 * UM.Theme.getSize("default_lining").height - property string activeMachineId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id : "" - delegate: Loader + // Binding to ensure that the right containerstack ID is set for the provider. + // This ensures that if a setting has a limit_to_extruder id (for instance; Support speed points to the + // extruder that actually prints the support, as that is the setting we need to use to calculate the value) + Binding { - id: delegate - - width: scrollView.width - height: enabled ? contents.delegateHeight: 0 - Behavior on height { NumberAnimation { duration: 100 } } - opacity: enabled ? 1 : 0 - Behavior on opacity { NumberAnimation { duration: 100 } } - enabled: provider.properties.enabled === "True" - - property var definition: model - property var settingDefinitionsModel: definitionsModel - property var propertyProvider: provider - property var globalPropertyProvider: inheritStackProvider - property bool externalResetHandler: false - - //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 - //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, - //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely. - asynchronous: model.type !== "enum" && model.type !== "extruder" && model.type !== "optional_extruder" - active: model.type !== undefined - - source: + target: provider + property: "containerStackId" + when: model.settable_per_extruder || (inheritStackProvider.properties.limit_to_extruder !== undefined && inheritStackProvider.properties.limit_to_extruder >= 0); + value: { - switch(model.type) - { - case "int": - return "SettingTextField.qml" - case "[int]": - return "SettingTextField.qml" - case "float": - return "SettingTextField.qml" - case "enum": - return "SettingComboBox.qml" - case "extruder": - return "SettingExtruder.qml" - case "bool": - return "SettingCheckBox.qml" - case "str": - return "SettingTextField.qml" - case "category": - return "SettingCategory.qml" - case "optional_extruder": - return "SettingOptionalExtruder.qml" - default: - return "SettingUnknown.qml" - } - } + // Associate this binding with Cura.MachineManager.activeMachine.id in the beginning so this + // binding will be triggered when activeMachineId is changed too. + // Otherwise, if this value only depends on the extruderIds, it won't get updated when the + // machine gets changed. - // Binding to ensure that the right containerstack ID is set for the provider. - // This ensures that if a setting has a limit_to_extruder id (for instance; Support speed points to the - // extruder that actually prints the support, as that is the setting we need to use to calculate the value) - Binding - { - target: provider - property: "containerStackId" - when: model.settable_per_extruder || (inheritStackProvider.properties.limit_to_extruder !== undefined && inheritStackProvider.properties.limit_to_extruder >= 0); - value: + if (!model.settable_per_extruder) { - // Associate this binding with Cura.MachineManager.activeMachine.id in the beginning so this - // binding will be triggered when activeMachineId is changed too. - // Otherwise, if this value only depends on the extruderIds, it won't get updated when the - // machine gets changed. - - if (!model.settable_per_extruder) - { - //Not settable per extruder or there only is global, so we must pick global. - return contents.activeMachineId - } - if (inheritStackProvider.properties.limit_to_extruder !== undefined && inheritStackProvider.properties.limit_to_extruder >= 0) - { - //We have limit_to_extruder, so pick that stack. - return Cura.ExtruderManager.extruderIds[inheritStackProvider.properties.limit_to_extruder]; - } - if (Cura.ExtruderManager.activeExtruderStackId) - { - //We're on an extruder tab. Pick the current extruder. - return Cura.ExtruderManager.activeExtruderStackId; - } - //No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab. + //Not settable per extruder or there only is global, so we must pick global. return contents.activeMachineId } - } - - // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events - // so we bypass that to make a dedicated provider). - UM.SettingPropertyProvider - { - id: inheritStackProvider - containerStackId: contents.activeMachineId - key: model.key - watchedProperties: [ "limit_to_extruder" ] - } - - UM.SettingPropertyProvider - { - id: provider - - containerStackId: contents.activeMachineId - key: model.key - watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder", "resolve" ] - storeIndex: 0 - removeUnusedValue: model.resolve === undefined - } - - Connections - { - target: item - function onContextMenuRequested() + if (inheritStackProvider.properties.limit_to_extruder !== undefined && inheritStackProvider.properties.limit_to_extruder >= 0) { - contextMenu.key = model.key; - contextMenu.settingVisible = model.visible; - contextMenu.provider = provider - contextMenu.popup(); + //We have limit_to_extruder, so pick that stack. + return Cura.ExtruderManager.extruderIds[inheritStackProvider.properties.limit_to_extruder]; } - function onShowTooltip(text) { base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) } - function onHideTooltip() { base.hideTooltip() } - function onShowAllHiddenInheritedSettings() + if (Cura.ExtruderManager.activeExtruderStackId) { - var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(category_id) - for(var i = 0; i < children_with_override.length; i++) - { - definitionsModel.setVisible(children_with_override[i], true) - } - Cura.SettingInheritanceManager.manualRemoveOverride(category_id) - } - function onFocusReceived() - { - contents.indexWithFocus = index; - animateContentY.from = contents.contentY; - contents.positionViewAtIndex(index, ListView.Contain); - animateContentY.to = contents.contentY; - animateContentY.running = true; - } - function onSetActiveFocusToNextSetting(forward) - { - if (forward == undefined || forward) - { - contents.currentIndex = contents.indexWithFocus + 1; - while(contents.currentItem && contents.currentItem.height <= 0) - { - contents.currentIndex++; - } - if (contents.currentItem) - { - contents.currentItem.item.focusItem.forceActiveFocus(); - } - } - else - { - contents.currentIndex = contents.indexWithFocus - 1; - while(contents.currentItem && contents.currentItem.height <= 0) - { - contents.currentIndex--; - } - if (contents.currentItem) - { - contents.currentItem.item.focusItem.forceActiveFocus(); - } - } + //We're on an extruder tab. Pick the current extruder. + return Cura.ExtruderManager.activeExtruderStackId; } + //No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab. + return contents.activeMachineId } } - NumberAnimation { - id: animateContentY - target: contents - property: "contentY" - duration: 50 - } - - add: Transition { - SequentialAnimation { - NumberAnimation { properties: "height"; from: 0; duration: 100 } - NumberAnimation { properties: "opacity"; from: 0; duration: 100 } - } - } - remove: Transition { - SequentialAnimation { - NumberAnimation { properties: "opacity"; to: 0; duration: 100 } - NumberAnimation { properties: "height"; to: 0; duration: 100 } - } - } - addDisplaced: Transition { - NumberAnimation { properties: "x,y"; duration: 100 } - } - removeDisplaced: Transition { - SequentialAnimation { - PauseAnimation { duration: 100; } - NumberAnimation { properties: "x,y"; duration: 100 } - } - } - - Menu + // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events + // so we bypass that to make a dedicated provider). + UM.SettingPropertyProvider { - id: contextMenu - - property string key - property var provider - property bool settingVisible - - MenuItem - { - //: Settings context menu action - text: catalog.i18nc("@action:menu", "Copy value to all extruders") - visible: machineExtruderCount.properties.value > 1 - enabled: contextMenu.provider !== undefined && contextMenu.provider.properties.settable_per_extruder !== "False" - onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key) - } - - MenuItem - { - //: Settings context menu action - text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders") - visible: machineExtruderCount.properties.value > 1 - enabled: contextMenu.provider !== undefined - onTriggered: Cura.MachineManager.copyAllValuesToExtruders() - } - - MenuSeparator - { - visible: machineExtruderCount.properties.value > 1 - } - - Instantiator - { - id: customMenuItems - model: Cura.SidebarCustomMenuItemsModel { } - MenuItem - { - text: model.name - iconName: model.icon_name - onTriggered: - { - customMenuItems.model.callMenuItemMethod(name, model.actions, {"key": contextMenu.key}) - } - } - onObjectAdded: contextMenu.insertItem(index, object) - onObjectRemoved: contextMenu.removeItem(object) - } - - MenuSeparator - { - visible: customMenuItems.count > 0 - } - - MenuItem - { - //: Settings context menu action - visible: !findingSettings - text: catalog.i18nc("@action:menu", "Hide this setting"); - onTriggered: - { - definitionsModel.hide(contextMenu.key) - } - } - MenuItem - { - //: Settings context menu action - text: - { - if (contextMenu.settingVisible) - { - return catalog.i18nc("@action:menu", "Don't show this setting"); - } - else - { - return catalog.i18nc("@action:menu", "Keep this setting visible"); - } - } - visible: findingSettings - onTriggered: - { - if (contextMenu.settingVisible) - { - definitionsModel.hide(contextMenu.key); - } - else - { - definitionsModel.show(contextMenu.key); - } - } - } - MenuItem - { - //: Settings context menu action - text: catalog.i18nc("@action:menu", "Configure setting visibility..."); - - onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu); - } + id: inheritStackProvider + containerStackId: contents.activeMachineId + key: model.key + watchedProperties: [ "limit_to_extruder" ] } UM.SettingPropertyProvider { - id: machineExtruderCount + id: provider - containerStackId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id : "" - key: "machine_extruder_count" - watchedProperties: [ "value" ] + containerStackId: contents.activeMachineId + key: model.key + watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder", "resolve" ] storeIndex: 0 + removeUnusedValue: model.resolve === undefined } + + Connections + { + target: item + function onContextMenuRequested() + { + contextMenu.key = model.key; + contextMenu.settingVisible = model.visible; + contextMenu.provider = provider + contextMenu.popup(); + } + function onShowTooltip(text) { base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) } + function onHideTooltip() { base.hideTooltip() } + function onShowAllHiddenInheritedSettings() + { + var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(category_id) + for(var i = 0; i < children_with_override.length; i++) + { + definitionsModel.setVisible(children_with_override[i], true) + } + Cura.SettingInheritanceManager.manualRemoveOverride(category_id) + } + function onFocusReceived() + { + contents.indexWithFocus = index; + animateContentY.from = contents.contentY; + contents.positionViewAtIndex(index, ListView.Contain); + animateContentY.to = contents.contentY; + animateContentY.running = true; + } + function onSetActiveFocusToNextSetting(forward) + { + if (forward == undefined || forward) + { + contents.currentIndex = contents.indexWithFocus + 1; + while(contents.currentItem && contents.currentItem.height <= 0) + { + contents.currentIndex++; + } + if (contents.currentItem) + { + contents.currentItem.item.focusItem.forceActiveFocus(); + } + } + else + { + contents.currentIndex = contents.indexWithFocus - 1; + while(contents.currentItem && contents.currentItem.height <= 0) + { + contents.currentIndex--; + } + if (contents.currentItem) + { + contents.currentItem.item.focusItem.forceActiveFocus(); + } + } + } + } + } + + NumberAnimation { + id: animateContentY + target: contents + property: "contentY" + duration: 50 + } + + add: Transition { + SequentialAnimation { + NumberAnimation { properties: "height"; from: 0; duration: 100 } + NumberAnimation { properties: "opacity"; from: 0; duration: 100 } + } + } + remove: Transition { + SequentialAnimation { + NumberAnimation { properties: "opacity"; to: 0; duration: 100 } + NumberAnimation { properties: "height"; to: 0; duration: 100 } + } + } + addDisplaced: Transition { + NumberAnimation { properties: "x,y"; duration: 100 } + } + removeDisplaced: Transition { + SequentialAnimation { + PauseAnimation { duration: 100; } + NumberAnimation { properties: "x,y"; duration: 100 } + } + } + + Menu + { + id: contextMenu + + property string key + property var provider + property bool settingVisible + + MenuItem + { + //: Settings context menu action + text: catalog.i18nc("@action:menu", "Copy value to all extruders") + visible: machineExtruderCount.properties.value > 1 + enabled: contextMenu.provider !== undefined && contextMenu.provider.properties.settable_per_extruder !== "False" + onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key) + } + + MenuItem + { + //: Settings context menu action + text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders") + visible: machineExtruderCount.properties.value > 1 + enabled: contextMenu.provider !== undefined + onTriggered: Cura.MachineManager.copyAllValuesToExtruders() + } + + MenuSeparator + { + visible: machineExtruderCount.properties.value > 1 + } + + Instantiator + { + id: customMenuItems + model: Cura.SidebarCustomMenuItemsModel { } + MenuItem + { + text: model.name + //iconName: model.icon_name + onTriggered: + { + customMenuItems.model.callMenuItemMethod(name, model.actions, {"key": contextMenu.key}) + } + } + onObjectAdded: contextMenu.insertItem(index, object) + onObjectRemoved: contextMenu.removeItem(object) + } + + MenuSeparator + { + visible: customMenuItems.count > 0 + } + + MenuItem + { + //: Settings context menu action + visible: !findingSettings + text: catalog.i18nc("@action:menu", "Hide this setting"); + onTriggered: + { + definitionsModel.hide(contextMenu.key) + } + } + MenuItem + { + //: Settings context menu action + text: + { + if (contextMenu.settingVisible) + { + return catalog.i18nc("@action:menu", "Don't show this setting"); + } + else + { + return catalog.i18nc("@action:menu", "Keep this setting visible"); + } + } + visible: findingSettings + onTriggered: + { + if (contextMenu.settingVisible) + { + definitionsModel.hide(contextMenu.key); + } + else + { + definitionsModel.show(contextMenu.key); + } + } + } + MenuItem + { + //: Settings context menu action + text: catalog.i18nc("@action:menu", "Configure setting visibility..."); + + onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu); + } + } + + UM.SettingPropertyProvider + { + id: machineExtruderCount + + containerStackId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id : "" + key: "machine_extruder_count" + watchedProperties: [ "value" ] + storeIndex: 0 } } } From 58a3aef8d477e24f71257f0db3a776e541421cde Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Jan 2022 10:36:55 +0100 Subject: [PATCH 022/377] Remove styles --- resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml | 7 ------- resources/qml/Menus/PrinterMenu.qml | 1 - resources/qml/Preferences/Materials/MaterialsSlot.qml | 6 +----- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index ba0d3fb6ca..4890f79210 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 @@ -97,12 +96,6 @@ UM.Dialog id: rememberChoiceCheckBox text: catalog.i18nc("@text:window", "Remember my choice") checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask" - style: CheckBoxStyle { - label: Label { - text: control.text - font: UM.Theme.getFont("default") - } - } } // Buttons diff --git a/resources/qml/Menus/PrinterMenu.qml b/resources/qml/Menus/PrinterMenu.qml index 741d927c13..98f72c128d 100644 --- a/resources/qml/Menus/PrinterMenu.qml +++ b/resources/qml/Menus/PrinterMenu.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Preferences/Materials/MaterialsSlot.qml b/resources/qml/Preferences/Materials/MaterialsSlot.qml index 840c636196..c80d2f2093 100644 --- a/resources/qml/Preferences/Materials/MaterialsSlot.qml +++ b/resources/qml/Preferences/Materials/MaterialsSlot.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 @@ -91,10 +90,7 @@ Rectangle CuraApplication.getMaterialManagementModel().addFavorite(material.root_material_id) } } - style: ButtonStyle - { - background: Item { } - } + UM.RecolorImage { anchors From 052898ce21084117e644b35a85f4799e0e3b08b4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Jan 2022 16:55:28 +0100 Subject: [PATCH 023/377] Switch out the file, view and edit menu for controls 2 CURA-8683 --- resources/qml/Actions.qml | 329 +++++++++---------- resources/qml/Cura.qml | 5 +- resources/qml/MainWindow/ApplicationMenu.qml | 53 ++- resources/qml/Menus/EditMenu.qml | 28 ++ resources/qml/Menus/FileMenu.qml | 31 +- resources/qml/Menus/OpenFilesMenu.qml | 10 +- resources/qml/Menus/RecentFilesMenu.qml | 6 +- resources/qml/Menus/SaveProjectMenu.qml | 8 +- resources/qml/Menus/ViewMenu.qml | 66 +--- 9 files changed, 285 insertions(+), 251 deletions(-) create mode 100644 resources/qml/Menus/EditMenu.qml diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index aa88c9176d..6e7dd6b85f 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -4,69 +4,68 @@ pragma Singleton import QtQuick 2.10 -import QtQuick.Controls 1.1 -import QtQuick.Controls 2.3 as Controls2 +import QtQuick.Controls 2.4 import UM 1.1 as UM import Cura 1.0 as Cura Item { - property alias newProject: newProjectAction; - property alias open: openAction; - property alias quit: quitAction; + property alias newProject: newProjectAction + property alias open: openAction + property alias quit: quitAction - property alias undo: undoAction; - property alias redo: redoAction; + property alias undo: undoAction + property alias redo: redoAction - property alias view3DCamera: view3DCameraAction; - property alias viewFrontCamera: viewFrontCameraAction; - property alias viewTopCamera: viewTopCameraAction; - property alias viewBottomCamera: viewBottomCameraAction; - property alias viewLeftSideCamera: viewLeftSideCameraAction; - property alias viewRightSideCamera: viewRightSideCameraAction; + property alias view3DCamera: view3DCameraAction + property alias viewFrontCamera: viewFrontCameraAction + property alias viewTopCamera: viewTopCameraAction + property alias viewBottomCamera: viewBottomCameraAction + property alias viewLeftSideCamera: viewLeftSideCameraAction + property alias viewRightSideCamera: viewRightSideCameraAction - property alias deleteSelection: deleteSelectionAction; - property alias centerSelection: centerSelectionAction; - property alias multiplySelection: multiplySelectionAction; + property alias deleteSelection: deleteSelectionAction + property alias centerSelection: centerSelectionAction + property alias multiplySelection: multiplySelectionAction - property alias deleteObject: deleteObjectAction; - property alias centerObject: centerObjectAction; - property alias groupObjects: groupObjectsAction; - property alias unGroupObjects:unGroupObjectsAction; - property alias mergeObjects: mergeObjectsAction; - //property alias unMergeObjects: unMergeObjectsAction; + property alias deleteObject: deleteObjectAction + property alias centerObject: centerObjectAction + property alias groupObjects: groupObjectsAction + property alias unGroupObjects:unGroupObjectsAction + property alias mergeObjects: mergeObjectsAction + //property alias unMergeObjects: unMergeObjectsAction - property alias multiplyObject: multiplyObjectAction; + property alias multiplyObject: multiplyObjectAction - property alias selectAll: selectAllAction; - property alias deleteAll: deleteAllAction; - property alias reloadAll: reloadAllAction; - property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction; - property alias arrangeAll: arrangeAllAction; - property alias arrangeSelection: arrangeSelectionAction; - property alias resetAllTranslation: resetAllTranslationAction; - property alias resetAll: resetAllAction; + property alias selectAll: selectAllAction + property alias deleteAll: deleteAllAction + property alias reloadAll: reloadAllAction + property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction + property alias arrangeAll: arrangeAllAction + property alias arrangeSelection: arrangeSelectionAction + property alias resetAllTranslation: resetAllTranslationAction + property alias resetAll: resetAllAction - property alias addMachine: addMachineAction; - property alias configureMachines: settingsAction; - property alias addProfile: addProfileAction; - property alias updateProfile: updateProfileAction; - property alias resetProfile: resetProfileAction; - property alias manageProfiles: manageProfilesAction; + property alias addMachine: addMachineAction + property alias configureMachines: settingsAction + property alias addProfile: addProfileAction + property alias updateProfile: updateProfileAction + property alias resetProfile: resetProfileAction + property alias manageProfiles: manageProfilesAction - property alias manageMaterials: manageMaterialsAction; - property alias marketplaceMaterials: marketplaceMaterialsAction; + property alias manageMaterials: manageMaterialsAction + property alias marketplaceMaterials: marketplaceMaterialsAction - property alias preferences: preferencesAction; + property alias preferences: preferencesAction - property alias showProfileFolder: showProfileFolderAction; - property alias documentation: documentationAction; + property alias showProfileFolder: showProfileFolderAction + property alias documentation: documentationAction property alias showTroubleshooting: showTroubleShootingAction - property alias reportBug: reportBugAction; + property alias reportBug: reportBugAction property alias whatsNew: whatsNewAction - property alias about: aboutAction; + property alias about: aboutAction - property alias toggleFullScreen: toggleFullScreenAction; + property alias toggleFullScreen: toggleFullScreenAction property alias exitFullScreen: exitFullScreenAction property alias configureSettingVisibility: configureSettingVisibilityAction @@ -80,7 +79,7 @@ Item { id: showTroubleShootingAction onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting") - text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide"); + text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide") } Action @@ -88,7 +87,7 @@ Item id: toggleFullScreenAction shortcut: StandardKey.FullScreen text: catalog.i18nc("@action:inmenu", "Toggle Full Screen") - iconName: "view-fullscreen" + icon.name: "view-fullscreen" } Action @@ -96,27 +95,27 @@ Item id: exitFullScreenAction shortcut: StandardKey.Cancel text: catalog.i18nc("@action:inmenu", "Exit Full Screen") - iconName: "view-fullscreen" + icon.name: "view-fullscreen" } Action { - id: undoAction; - text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo"); - iconName: "edit-undo"; - shortcut: StandardKey.Undo; - onTriggered: UM.OperationStack.undo(); - enabled: UM.OperationStack.canUndo; + id: undoAction + text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo") + icon.name: "edit-undo" + shortcut: StandardKey.Undo + onTriggered: UM.OperationStack.undo() + enabled: UM.OperationStack.canUndo } Action { - id: redoAction; - text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo"); - iconName: "edit-redo"; - shortcut: StandardKey.Redo; - onTriggered: UM.OperationStack.redo(); - enabled: UM.OperationStack.canRedo; + id: redoAction + text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo") + icon.name: "edit-redo" + shortcut: StandardKey.Redo + onTriggered: UM.OperationStack.redo() + enabled: UM.OperationStack.canRedo } Action @@ -131,7 +130,7 @@ Item //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar text: (Qt.platform.os == "osx") ? "&Quit" : catalog.i18nc("@action:inmenu menubar:file", "&Quit") - iconName: "application-exit" + icon.name: "application-exit" shortcut: StandardKey.Quit } @@ -188,7 +187,7 @@ Item //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar text: (Qt.platform.os == "osx") ? "Configure Cura..." : catalog.i18nc("@action:inmenu", "Configure Cura...") - iconName: "configure" + icon.name: "configure" } Action @@ -201,14 +200,14 @@ Item { id: settingsAction text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...") - iconName: "configure" + icon.name: "configure" } Action { id: manageMaterialsAction text: catalog.i18nc("@action:inmenu", "Manage Materials...") - iconName: "configure" + icon.name: "configure" shortcut: "Ctrl+K" } @@ -220,64 +219,64 @@ Item Action { - id: updateProfileAction; + id: updateProfileAction enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null - text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides"); - onTriggered: Cura.ContainerManager.updateQualityChanges(); + text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides") + onTriggered: Cura.ContainerManager.updateQualityChanges() } Action { - id: resetProfileAction; + id: resetProfileAction enabled: Cura.MachineManager.hasUserSettings - text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes"); + text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes") onTriggered: { - forceActiveFocus(); - Cura.ContainerManager.clearUserContainers(); + forceActiveFocus() + Cura.ContainerManager.clearUserContainers() } } Action { - id: addProfileAction; + id: addProfileAction enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings - text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides..."); + text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides...") } Action { id: manageProfilesAction text: catalog.i18nc("@action:inmenu menubar:profile", "Manage Profiles...") - iconName: "configure" + icon.name: "configure" shortcut: "Ctrl+J" } Action { - id: documentationAction; - text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation"); - iconName: "help-contents"; - shortcut: StandardKey.Help; - onTriggered: CuraActions.openDocumentation(); + id: documentationAction + text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation") + icon.name: "help-contents" + shortcut: StandardKey.Help + onTriggered: CuraActions.openDocumentation() } Action { - id: reportBugAction; - text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug"); - iconName: "tools-report-bug"; - onTriggered: CuraActions.openBugReportPage(); + id: reportBugAction + text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug") + icon.name: "tools-report-bug" + onTriggered: CuraActions.openBugReportPage() } Action { - id: whatsNewAction; - text: catalog.i18nc("@action:inmenu menubar:help", "What's New"); + id: whatsNewAction + text: catalog.i18nc("@action:inmenu menubar:help", "What's New") } Action { - id: aboutAction; + id: aboutAction //On MacOS, don't translate the "About" word. //Qt moves the "about" entry to a different place, and if it got renamed can't find it again when it @@ -286,60 +285,60 @@ Item //For more information, see: //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar - text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About..."); - iconName: "help-about"; + text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About...") + icon.name: "help-about" } Action { - id: deleteSelectionAction; - text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected"); - enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; - iconName: "edit-delete"; + id: deleteSelectionAction + text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected") + enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection + icon.name: "edit-delete" shortcut: StandardKey.Delete | "Backspace" - onTriggered: CuraActions.deleteSelection(); + onTriggered: CuraActions.deleteSelection() } Action { - id: centerSelectionAction; - text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected"); - enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; - iconName: "align-vertical-center"; - onTriggered: CuraActions.centerSelection(); + id: centerSelectionAction + text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected") + enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection + icon.name: "align-vertical-center" + onTriggered: CuraActions.centerSelection() } Action { - id: multiplySelectionAction; - text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected"); - enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; - iconName: "edit-duplicate"; + id: multiplySelectionAction + text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected") + enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection + icon.name: "edit-duplicate" shortcut: "Ctrl+M" } Action { - id: deleteObjectAction; - text: catalog.i18nc("@action:inmenu","Delete Model"); - enabled: UM.Controller.toolsEnabled; - iconName: "edit-delete"; + id: deleteObjectAction + text: catalog.i18nc("@action:inmenu","Delete Model") + enabled: UM.Controller.toolsEnabled + icon.name: "edit-delete" } Action { - id: centerObjectAction; - text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform"); + id: centerObjectAction + text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform") } Action { id: groupObjectsAction - text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models"); + text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models") enabled: UM.Selection.selectionCount > 1 ? true: false - iconName: "object-group" - shortcut: "Ctrl+G"; - onTriggered: CuraApplication.groupSelected(); + icon.name: "object-group" + shortcut: "Ctrl+G" + onTriggered: CuraApplication.groupSelected() } Action @@ -355,132 +354,132 @@ Item Action { id: unGroupObjectsAction - text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models"); + text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models") enabled: UM.Selection.isGroupSelected - iconName: "object-ungroup" - shortcut: "Ctrl+Shift+G"; - onTriggered: CuraApplication.ungroupSelected(); + icon.name: "object-ungroup" + shortcut: "Ctrl+Shift+G" + onTriggered: CuraApplication.ungroupSelected() } Action { id: mergeObjectsAction - text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models"); + text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models") enabled: UM.Selection.selectionCount > 1 ? true: false - iconName: "merge"; - shortcut: "Ctrl+Alt+G"; - onTriggered: CuraApplication.mergeSelected(); + icon.name: "merge" + shortcut: "Ctrl+Alt+G" + onTriggered: CuraApplication.mergeSelected() } Action { - id: multiplyObjectAction; - text: catalog.i18nc("@action:inmenu","&Multiply Model..."); - iconName: "edit-duplicate" + id: multiplyObjectAction + text: catalog.i18nc("@action:inmenu","&Multiply Model...") + icon.name: "edit-duplicate" } Action { - id: selectAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models"); - enabled: UM.Controller.toolsEnabled; - iconName: "edit-select-all"; - shortcut: "Ctrl+A"; - onTriggered: CuraApplication.selectAll(); + id: selectAllAction + text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models") + enabled: UM.Controller.toolsEnabled + icon.name: "edit-select-all" + shortcut: "Ctrl+A" + onTriggered: CuraApplication.selectAll() } Action { - id: deleteAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate"); - enabled: UM.Controller.toolsEnabled; - iconName: "edit-delete"; - shortcut: "Ctrl+D"; - onTriggered: CuraApplication.deleteAll(); + id: deleteAllAction + text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate") + enabled: UM.Controller.toolsEnabled + icon.name: "edit-delete" + shortcut: "Ctrl+D" + onTriggered: CuraApplication.deleteAll() } Action { - id: reloadAllAction; - text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models"); - iconName: "document-revert"; + id: reloadAllAction + text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models") + icon.name: "document-revert" shortcut: "F5" - onTriggered: CuraApplication.reloadAll(); + onTriggered: CuraApplication.reloadAll() } Action { - id: arrangeAllBuildPlatesAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates"); - onTriggered: Printer.arrangeObjectsToAllBuildPlates(); + id: arrangeAllBuildPlatesAction + text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates") + onTriggered: Printer.arrangeObjectsToAllBuildPlates() } Action { - id: arrangeAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models"); - onTriggered: Printer.arrangeAll(); - shortcut: "Ctrl+R"; + id: arrangeAllAction + text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models") + onTriggered: Printer.arrangeAll() + shortcut: "Ctrl+R" } Action { - id: arrangeSelectionAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection"); - onTriggered: Printer.arrangeSelection(); + id: arrangeSelectionAction + text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection") + onTriggered: Printer.arrangeSelection() } Action { - id: resetAllTranslationAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions"); - onTriggered: CuraApplication.resetAllTranslation(); + id: resetAllTranslationAction + text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions") + onTriggered: CuraApplication.resetAllTranslation() } Action { - id: resetAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations"); - onTriggered: CuraApplication.resetAll(); + id: resetAllAction + text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations") + onTriggered: CuraApplication.resetAll() } Action { - id: openAction; + id: openAction property var fileProviderModel: CuraApplication.getFileProviderModel() - text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)..."); - iconName: "document-open"; + text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)...") + icon.name: "document-open" // Unassign the shortcut when there are more than one file providers, since then the file provider's shortcut is // enabled instead, and Ctrl+O is assigned to the local file provider - shortcut: fileProviderModel.count == 1 ? StandardKey.Open : ""; + shortcut: fileProviderModel.count == 1 ? StandardKey.Open : "" } Action { id: newProjectAction - text: catalog.i18nc("@action:inmenu menubar:file","&New Project..."); + text: catalog.i18nc("@action:inmenu menubar:file","&New Project...") shortcut: StandardKey.New } Action { - id: showProfileFolderAction; - text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder"); + id: showProfileFolderAction + text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder") } Action { id: configureSettingVisibilityAction - text: catalog.i18nc("@action:menu", "Configure setting visibility..."); - iconName: "configure" + text: catalog.i18nc("@action:menu", "Configure setting visibility...") + icon.name: "configure" } Action { id: browsePackagesAction text: catalog.i18nc("@action:menu", "&Marketplace") - iconName: "plugins_browse" + icon.name: "plugins_browse" } } diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index f1fa4ed506..f959e62977 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -6,8 +6,8 @@ import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.2 import QtGraphicalEffects 1.0 - -import UM 1.3 as UM +import QtQuick.Controls 2.15 as NewControls +import UM 1.5 as UM import Cura 1.1 as Cura import "Dialogs" @@ -160,7 +160,6 @@ UM.MainWindow ApplicationMenu { id: applicationMenu - window: base } Item diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 5e1c80cd17..cb84e8be37 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -2,11 +2,10 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.2 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura import "../Menus" @@ -17,13 +16,48 @@ Item id: menu width: applicationMenu.width height: applicationMenu.height - property alias window: applicationMenu.window - UM.ApplicationMenu + Component + { + id: menuBarComponent + MenuBarItem + { + id: menuBarItem + + function replaceText(txt) + { + var index = txt.indexOf("&") + if(index >= 0) + { + txt = txt.replace(txt.substr(index, 2), ("" + txt.substr(index + 1, 1) +"")) + } + return txt + } + + contentItem: Label { + text: replaceText(menuBarItem.text) + color: "white" + verticalAlignment: Text.AlignVCenter + textFormat: Text.RichText + } + } + } + + MenuBar + { + id: applicationMenu + delegate: menuBarComponent + FileMenu {} + + EditMenu {} + ViewMenu {} + } + + /*UM.ApplicationMenu { id: applicationMenu - FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") } + //FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") } Menu { @@ -126,9 +160,10 @@ Item MenuItem { action: Cura.Actions.whatsNew } MenuItem { action: Cura.Actions.about } } - } + }*/ - Component + + /*Component { id: extensionsMenuItem @@ -214,5 +249,5 @@ Item curaExtensions.callExtensionMethod("Toolbox", "launch") curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") } - } + }*/ } \ No newline at end of file diff --git a/resources/qml/Menus/EditMenu.qml b/resources/qml/Menus/EditMenu.qml new file mode 100644 index 0000000000..813b000aa6 --- /dev/null +++ b/resources/qml/Menus/EditMenu.qml @@ -0,0 +1,28 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.2 +import QtQuick.Controls 2.1 + +import UM 1.6 as UM +import Cura 1.0 as Cura + +Menu +{ + title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit") + + UM.MenuItem { action: Cura.Actions.undo } + UM.MenuItem { action: Cura.Actions.redo } + MenuSeparator { } + UM.MenuItem { action: Cura.Actions.selectAll } + UM.MenuItem { action: Cura.Actions.arrangeAll } + UM.MenuItem { action: Cura.Actions.multiplySelection } + UM.MenuItem { action: Cura.Actions.deleteSelection } + UM.MenuItem { action: Cura.Actions.deleteAll } + UM.MenuItem { action: Cura.Actions.resetAllTranslation } + UM.MenuItem { action: Cura.Actions.resetAll } + MenuSeparator { } + UM.MenuItem { action: Cura.Actions.groupObjects } + UM.MenuItem { action: Cura.Actions.mergeObjects } + UM.MenuItem { action: Cura.Actions.unGroupObjects } +} \ No newline at end of file diff --git a/resources/qml/Menus/FileMenu.qml b/resources/qml/Menus/FileMenu.qml index 681e0b06ce..a1a2d1aaec 100644 --- a/resources/qml/Menus/FileMenu.qml +++ b/resources/qml/Menus/FileMenu.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import UM 1.6 as UM import Cura 1.0 as Cura @@ -13,31 +13,34 @@ Menu title: catalog.i18nc("@title:menu menubar:toplevel", "&File") property var fileProviderModel: CuraApplication.getFileProviderModel() - MenuItem + + UM.MenuItem { id: newProjectMenu action: Cura.Actions.newProject } - MenuItem + UM.MenuItem { id: openMenu action: Cura.Actions.open - visible: (base.fileProviderModel.count == 1) + visible: base.fileProviderModel.count == 1 + height: visible ? implicitHeight: 0 } OpenFilesMenu { id: openFilesMenu - visible: (base.fileProviderModel.count > 1) + + shouldBeVisible: base.fileProviderModel.count > 1 } RecentFilesMenu { } - MenuItem + UM.MenuItem { id: saveWorkspaceMenu - shortcut: visible ? StandardKey.Save : "" + shortcut: StandardKey.Save text: catalog.i18nc("@title:menu menubar:file", "&Save Project...") visible: saveProjectMenu.model.count == 1 enabled: UM.WorkspaceFileHandler.enabled @@ -62,13 +65,13 @@ Menu { id: saveProjectMenu model: projectOutputDevicesModel - visible: model.count > 1 + shouldBeVisible: model.count > 1 enabled: UM.WorkspaceFileHandler.enabled } MenuSeparator { } - MenuItem + UM.MenuItem { id: saveAsMenu text: catalog.i18nc("@title:menu menubar:file", "&Export...") @@ -79,18 +82,18 @@ Menu } } - MenuItem + UM.MenuItem { id: exportSelectionMenu text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...") enabled: UM.Selection.hasSelection - iconName: "document-save-as" + icon.name: "document-save-as" onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"}) } MenuSeparator { } - MenuItem + UM.MenuItem { id: reloadAllMenu action: Cura.Actions.reloadAll @@ -98,5 +101,5 @@ Menu MenuSeparator { } - MenuItem { action: Cura.Actions.quit } + UM.MenuItem { action: Cura.Actions.quit } } diff --git a/resources/qml/Menus/OpenFilesMenu.qml b/resources/qml/Menus/OpenFilesMenu.qml index 25f474c1d6..0b6019c18d 100644 --- a/resources/qml/Menus/OpenFilesMenu.qml +++ b/resources/qml/Menus/OpenFilesMenu.qml @@ -1,25 +1,24 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import UM 1.6 as UM import Cura 1.0 as Cura import "../Dialogs" -Menu +UM.Menu { id: openFilesMenu title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...") - iconName: "document-open-recent"; Instantiator { id: fileProviders model: CuraApplication.getFileProviderModel() - MenuItem + UM.MenuItem { text: { @@ -39,6 +38,7 @@ Menu // Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts. // When there is a single file provider, the openAction is assigned with the Ctrl+O shortcut instead. shortcut: openFilesMenu.visible ? model.shortcut : "" + visible: openFilesMenu.visible } onObjectAdded: openFilesMenu.insertItem(index, object) onObjectRemoved: openFilesMenu.removeItem(object) diff --git a/resources/qml/Menus/RecentFilesMenu.qml b/resources/qml/Menus/RecentFilesMenu.qml index de6d2e3817..24874c4365 100644 --- a/resources/qml/Menus/RecentFilesMenu.qml +++ b/resources/qml/Menus/RecentFilesMenu.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import UM 1.3 as UM import Cura 1.0 as Cura @@ -13,7 +13,7 @@ Menu { id: menu title: catalog.i18nc("@title:menu menubar:file", "Open &Recent") - iconName: "document-open-recent"; + //iconName: "document-open-recent"; enabled: CuraApplication.recentFiles.length > 0; diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index afc6008717..3b7c3b9c01 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -1,15 +1,15 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import UM 1.6 as UM import Cura 1.1 as Cura import "../Dialogs" -Menu +UM.Menu { id: saveProjectMenu title: catalog.i18nc("@title:menu menubar:file", "Save Project...") @@ -18,7 +18,7 @@ Menu Instantiator { id: projectOutputDevices - MenuItem + UM.MenuItem { text: model.name onTriggered: diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index c46e9a9f08..f382958c1f 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -2,33 +2,34 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Menu { - title: catalog.i18nc("@title:menu menubar:toplevel", "&View") id: base - - property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel() + title: catalog.i18nc("@title:menu menubar:toplevel", "&View") Menu { - title: catalog.i18nc("@action:inmenu menubar:view","&Camera position"); - MenuItem { action: Cura.Actions.view3DCamera; } - MenuItem { action: Cura.Actions.viewFrontCamera; } - MenuItem { action: Cura.Actions.viewTopCamera; } - MenuItem { action: Cura.Actions.viewBottomCamera; } - MenuItem { action: Cura.Actions.viewLeftSideCamera; } - MenuItem { action: Cura.Actions.viewRightSideCamera; } + title: catalog.i18nc("@action:inmenu menubar:view", "&Camera position") + UM.MenuItem { action: Cura.Actions.view3DCamera } + UM.MenuItem { action: Cura.Actions.viewFrontCamera } + UM.MenuItem { action: Cura.Actions.viewTopCamera } + UM.MenuItem { action: Cura.Actions.viewBottomCamera } + UM.MenuItem { action: Cura.Actions.viewLeftSideCamera } + UM.MenuItem { action: Cura.Actions.viewRightSideCamera } } Menu { id: cameraViewMenu + + title: catalog.i18nc("@action:inmenu menubar:view","Camera view") property string cameraMode: UM.Preferences.getValue("general/camera_perspective_mode") + Connections { target: UM.Preferences @@ -42,7 +43,6 @@ Menu } } - title: catalog.i18nc("@action:inmenu menubar:view","Camera view") MenuItem { text: catalog.i18nc("@action:inmenu menubar:view", "Perspective") @@ -52,8 +52,9 @@ Menu { UM.Preferences.setValue("general/camera_perspective_mode", "perspective") } - exclusiveGroup: group + //exclusiveGroup: group } + MenuItem { text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic") @@ -63,45 +64,14 @@ Menu { UM.Preferences.setValue("general/camera_perspective_mode", "orthographic") } - exclusiveGroup: group - } - ExclusiveGroup { id: group } - } - - MenuSeparator - { - visible: UM.Preferences.getValue("cura/use_multi_build_plate") - } - - Menu - { - id: buildPlateMenu; - title: catalog.i18nc("@action:inmenu menubar:view","&Build plate") - visible: UM.Preferences.getValue("cura/use_multi_build_plate") - Instantiator - { - model: base.multiBuildPlateModel - MenuItem - { - text: base.multiBuildPlateModel.getItem(index).name; - onTriggered: Cura.SceneController.setActiveBuildPlate(base.multiBuildPlateModel.getItem(index).buildPlateNumber) - checkable: true - checked: base.multiBuildPlateModel.getItem(index).buildPlateNumber == base.multiBuildPlateModel.activeBuildPlate - exclusiveGroup: buildPlateGroup - visible: UM.Preferences.getValue("cura/use_multi_build_plate") - } - onObjectAdded: buildPlateMenu.insertItem(index, object) - onObjectRemoved: buildPlateMenu.removeItem(object) - } - ExclusiveGroup - { - id: buildPlateGroup + //exclusiveGroup: group } + //ExclusiveGroup { id: group } } MenuSeparator {} - MenuItem + UM.MenuItem { action: Cura.Actions.toggleFullScreen } From 770f6f94c93a5742c7fa9a08ea2140b5bb75c837 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Jan 2022 17:00:26 +0100 Subject: [PATCH 024/377] Remove exclusive group comments CURA-8683 --- resources/qml/Menus/ViewMenu.qml | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index f382958c1f..0b6489bf9a 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -52,7 +52,6 @@ Menu { UM.Preferences.setValue("general/camera_perspective_mode", "perspective") } - //exclusiveGroup: group } MenuItem @@ -64,9 +63,7 @@ Menu { UM.Preferences.setValue("general/camera_perspective_mode", "orthographic") } - //exclusiveGroup: group } - //ExclusiveGroup { id: group } } MenuSeparator {} From 2bad5c5cd32f400ab017f55d6b9c114505eabf59 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 10:31:39 +0100 Subject: [PATCH 025/377] Update the settings menu to controls 2 CURA-8683 --- resources/qml/MainWindow/ApplicationMenu.qml | 13 +++ resources/qml/Menus/LocalPrinterMenu.qml | 25 ------ resources/qml/Menus/MaterialMenu.qml | 46 +++++------ resources/qml/Menus/NetworkPrinterMenu.qml | 32 -------- resources/qml/Menus/NozzleMenu.qml | 31 ++++--- resources/qml/Menus/PrinterMenu.qml | 85 +++++++++++++------- resources/qml/Menus/SettingsMenu.qml | 28 ++++--- resources/qml/Widgets/MenuItem.qml | 1 + 8 files changed, 121 insertions(+), 140 deletions(-) delete mode 100644 resources/qml/Menus/LocalPrinterMenu.qml delete mode 100644 resources/qml/Menus/NetworkPrinterMenu.qml diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index cb84e8be37..3689c0c457 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -51,6 +51,19 @@ Item EditMenu {} ViewMenu {} + + SettingsMenu + { + //On MacOS, don't translate the "Settings" word. + //Qt moves the "settings" entry to a different place, and if it got renamed can't find it again when it + //attempts to delete the item upon closing the application, causing a crash. + //In the new location, these items are translated automatically according to the system's language. + //For more information, see: + //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar + //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar + title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") + } + } /*UM.ApplicationMenu diff --git a/resources/qml/Menus/LocalPrinterMenu.qml b/resources/qml/Menus/LocalPrinterMenu.qml deleted file mode 100644 index bd6c57d744..0000000000 --- a/resources/qml/Menus/LocalPrinterMenu.qml +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.2 -import QtQuick.Controls 1.4 - -import UM 1.2 as UM -import Cura 1.0 as Cura - -Instantiator -{ - model: Cura.GlobalStacksModel {} - - MenuItem - { - text: model.name - checkable: true - checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false - exclusiveGroup: group - visible: !model.hasRemoteConnection - onTriggered: Cura.MachineManager.setActiveMachine(model.id) - } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) -} diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index b4f15fad00..b21cbbdafd 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -1,13 +1,13 @@ -//Copyright (c) 2020 Ultimaker B.V. +//Copyright (c) 2022 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 2.4 -import UM 1.2 as UM +import UM 1.6 as UM import Cura 1.0 as Cura -Menu +UM.Menu { id: menu title: catalog.i18nc("@label:category menu label", "Material") @@ -49,23 +49,24 @@ Menu enabled: updateModels } - MenuItem + UM.MenuItem { text: catalog.i18nc("@label:category menu label", "Favorites") enabled: false visible: favoriteMaterialsModel.items.length > 0 + height: visible ? implicitHeight: 0 } + Instantiator { model: favoriteMaterialsModel - delegate: MenuItem + delegate: UM.MenuItem { text: model.brand + " " + model.name checkable: true enabled: isActiveExtruderEnabled checked: model.root_material_id === menu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) - exclusiveGroup: favoriteGroup // One favorite and one item from the others can be active at the same time. } onObjectAdded: menu.insertItem(index, object) onObjectRemoved: menu.removeItem(index) @@ -81,13 +82,12 @@ Menu Instantiator { model: genericMaterialsModel - delegate: MenuItem + delegate: UM.MenuItem { text: model.name checkable: true enabled: isActiveExtruderEnabled checked: model.root_material_id === menu.currentRootMaterialId - exclusiveGroup: group onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } onObjectAdded: genericMenu.insertItem(index, object) @@ -100,7 +100,7 @@ Menu Instantiator { model: brandModel - Menu + UM.Menu { id: brandMenu title: brandName @@ -120,47 +120,37 @@ Menu Instantiator { model: brandMaterialColors - delegate: MenuItem + delegate: UM.MenuItem { text: model.name checkable: true enabled: isActiveExtruderEnabled checked: model.id === menu.activeMaterialId - exclusiveGroup: group + onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } onObjectAdded: brandMaterialsMenu.insertItem(index, object) onObjectRemoved: brandMaterialsMenu.removeItem(object) } } - onObjectAdded: brandMenu.insertItem(index, object) - onObjectRemoved: brandMenu.removeItem(object) + onObjectAdded: brandMenu.insertMenu(index, object) + onObjectRemoved: brandMenu.removeMenu(object) } } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) - } - - ExclusiveGroup - { - id: group - } - - ExclusiveGroup - { - id: favoriteGroup + onObjectAdded: menu.insertMenu(index, object) + onObjectRemoved: menu.removeMenu(object) } MenuSeparator {} - MenuItem + UM.MenuItem { action: Cura.Actions.manageMaterials } MenuSeparator {} - MenuItem + UM.MenuItem { action: Cura.Actions.marketplaceMaterials } diff --git a/resources/qml/Menus/NetworkPrinterMenu.qml b/resources/qml/Menus/NetworkPrinterMenu.qml deleted file mode 100644 index 845159f3b2..0000000000 --- a/resources/qml/Menus/NetworkPrinterMenu.qml +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.2 -import QtQuick.Controls 1.4 - -import UM 1.2 as UM -import Cura 1.0 as Cura - -Instantiator -{ - model: Cura.GlobalStacksModel {} - MenuItem - { - property string connectGroupName: - { - if("group_name" in model.metadata) - { - return model.metadata["group_name"] - } - return "" - } - text: connectGroupName - checkable: true - visible: model.hasRemoteConnection - checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName - exclusiveGroup: group - onTriggered: Cura.MachineManager.setActiveMachine(model.id) - } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) -} diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index 3ec48ab302..e2c5199211 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -1,15 +1,15 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.4 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura -Menu +UM.Menu { - id: menu + id: nozzleMenu title: "Nozzle" property int extruderIndex: 0 @@ -23,12 +23,13 @@ Menu { model: nozzleModel - MenuItem + UM.MenuItem { text: model.hotend_name checkable: true - checked: { - var activeMachine = Cura.MachineManager.activeMachine + property var activeMachine: Cura.MachineManager.activeMachine + checked: + { if (activeMachine === null) { return false @@ -36,10 +37,8 @@ Menu var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name) } - exclusiveGroup: group enabled: { - var activeMachine = Cura.MachineManager.activeMachine if (activeMachine === null) { return false @@ -47,14 +46,14 @@ Menu var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] return (extruder === undefined) ? false : extruder.isEnabled } - onTriggered: { - Cura.MachineManager.setVariant(menu.extruderIndex, model.container_node); - } + onTriggered:Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node) } - onObjectAdded: menu.insertItem(index, object); - onObjectRemoved: menu.removeItem(object); + onObjectAdded: + { + nozzleMenu.insertItem(index, object) + } + onObjectRemoved: nozzleMenu.removeItem(object) } - ExclusiveGroup { id: group } } diff --git a/resources/qml/Menus/PrinterMenu.qml b/resources/qml/Menus/PrinterMenu.qml index 98f72c128d..58c15201a2 100644 --- a/resources/qml/Menus/PrinterMenu.qml +++ b/resources/qml/Menus/PrinterMenu.qml @@ -1,60 +1,89 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.4 -import UM 1.2 as UM +import UM 1.6 as UM import Cura 1.0 as Cura Menu { id: menu -// TODO Enable custom style to the menu -// style: MenuStyle -// { -// frame: Rectangle -// { -// color: "white" -// } -// } - MenuItem + UM.MenuItem { + id: networkEnabledPrinterItem text: catalog.i18nc("@label:category menu label", "Network enabled printers") enabled: false - visible: networkPrinterMenu.count > 0 + visible: networKPrinterInstantiator.count > 0 } - NetworkPrinterMenu + Instantiator { - id: networkPrinterMenu + id: networKPrinterInstantiator + model: Cura.GlobalStacksModel {filterOnlineOnly: true} + UM.MenuItem + { + property string connectGroupName: + { + if("group_name" in model.metadata) + { + return model.metadata["group_name"] + } + return "" + } + text: connectGroupName + checkable: true + checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName + onTriggered: + { + print(typeof(model.id)) + Cura.MachineManager.someFunction("YAY") + Cura.MachineManager.setActiveMachine(model.id) + } + } + onObjectAdded: menu.insertItem(2, object) + onObjectRemoved: menu.removeItem(object) } MenuSeparator { - visible: networkPrinterMenu.count > 0 + visible: networKPrinterInstantiator.count > 0 } - MenuItem - { - text: catalog.i18nc("@label:category menu label", "Local printers") - enabled: false - visible: localPrinterMenu.count > 0 - } - - LocalPrinterMenu + UM.MenuItem { id: localPrinterMenu + text: catalog.i18nc("@label:category menu label", "Local printers") + enabled: false + visible: localPrinterInstantiator.count > 0 } - ExclusiveGroup { id: group; } + Instantiator + { + id: localPrinterInstantiator + model: Cura.GlobalStacksModel {} + + UM.MenuItem + { + text: model.name + checkable: true + checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false + visible: !model.hasRemoteConnection + height: visible ? implicitHeight: 0 + onTriggered: Cura.MachineManager.setActiveMachine(model.id) + } + // A bit hackish, but we have 2 items at the end, put them before that + onObjectAdded: menu.insertItem(menu.count - 2, object) + onObjectRemoved: menu.removeItem(object) + } MenuSeparator { - visible: localPrinterMenu.count > 0 + visible: localPrinterInstantiator.count > 0 } - MenuItem { action: Cura.Actions.addMachine; } - MenuItem { action: Cura.Actions.configureMachines; } + UM.MenuItem { action: Cura.Actions.addMachine } + UM.MenuItem { action: Cura.Actions.configureMachines } } diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 939ade5847..e25686f601 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -2,9 +2,9 @@ //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.4 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Menu @@ -23,11 +23,16 @@ Menu { title: modelData.name property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index] - NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.activeMachine.hasVariants; extruderIndex: index } + NozzleMenu + { + title: Cura.MachineManager.activeDefinitionVariantsName + shouldBeVisible: activeMachine.hasVariants + extruderIndex: index + } MaterialMenu { title: catalog.i18nc("@title:menu", "&Material") - visible: Cura.MachineManager.activeMachine.hasMaterials + shouldBeVisible: activeMachine.hasMaterials extruderIndex: index updateModels: false onAboutToShow: updateModels = true @@ -39,33 +44,34 @@ Menu visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials } - MenuItem + UM.MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder") onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index) } - MenuItem + UM.MenuItem { text: catalog.i18nc("@action:inmenu", "Enable Extruder") onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true) visible: (extruder === null || extruder === undefined) ? false : !extruder.isEnabled + height: visible ? implicitHeight: 0 } - MenuItem + UM.MenuItem { text: catalog.i18nc("@action:inmenu", "Disable Extruder") onTriggered: Cura.MachineManager.setExtruderEnabled(index, false) visible: (extruder === null || extruder === undefined) ? false : extruder.isEnabled enabled: Cura.MachineManager.numberExtrudersEnabled > 1 + height: visible ? implicitHeight: 0 } - } - onObjectAdded: base.insertItem(index, object) - onObjectRemoved: base.removeItem(object) + onObjectAdded: base.insertMenu(index, object) + onObjectRemoved: base.removeMenu(object) } MenuSeparator { } - MenuItem { action: Cura.Actions.configureSettingVisibility } + UM.MenuItem { action: Cura.Actions.configureSettingVisibility } } \ No newline at end of file diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index f0824b4d98..8861da1eac 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -15,6 +15,7 @@ MenuItem implicitHeight: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("narrow_margin").height opacity: enabled ? 1.0 : 0.5 + height: visible ? implicitHeight: 0 arrow: UM.RecolorImage { From d1461c5d7f49889f1e13c60b6c41fe8579cd7bad Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:07:12 +0100 Subject: [PATCH 026/377] Add extension menu to application menu CURA-8683 --- resources/qml/MainWindow/ApplicationMenu.qml | 2 + resources/qml/Menus/ExtensionMenu.qml | 64 ++++++++++++++++++++ resources/qml/Menus/MaterialMenu.qml | 6 +- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 resources/qml/Menus/ExtensionMenu.qml diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 3689c0c457..aa6fb803c3 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -64,6 +64,8 @@ Item title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") } + ExtensionMenu {} + } /*UM.ApplicationMenu diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml new file mode 100644 index 0000000000..0d4bc7c6e7 --- /dev/null +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -0,0 +1,64 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.4 + +import UM 1.5 as UM +import Cura 1.0 as Cura + +UM.Menu +{ + id: extensionMenu + title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions") + + Component + { + id: extensionsMenuItem + + UM.MenuItem + { + text: modelText + onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText) + } + } + + Component + { + id: extensionsMenuSeparator + + MenuSeparator {} + } + + Instantiator + { + id: extensions + model: UM.ExtensionModel { } + + UM.Menu + { + id: sub_menu + title: model.name + shouldBeVisible: actions !== undefined + enabled: actions != null + Instantiator + { + model: actions + Loader + { + property var extensionsModel: extensions.model + property var modelText: model.text + property var extensionName: name + + sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem + } + + onObjectAdded: sub_menu.insertItem(index, object.item) + onObjectRemoved: sub_menu.removeItem(object.item) + } + } + + onObjectAdded: extensionMenu.insertMenu(index, object) + onObjectRemoved: extensionMenu.removeMenu(object) + } +} \ No newline at end of file diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index b21cbbdafd..9a0c8e2c77 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -1,10 +1,10 @@ -//Copyright (c) 2022 Ultimaker B.V. -//Cura is released under the terms of the LGPLv3 or higher. +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 2.4 -import UM 1.6 as UM +import UM 1.5 as UM import Cura 1.0 as Cura UM.Menu From 6cde2d028b796c203e58eb7c12d71ae33e7dd075 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:10:12 +0100 Subject: [PATCH 027/377] Convert preferences & help menu to controls 2 CURA-8683 --- resources/qml/MainWindow/ApplicationMenu.qml | 133 +------------------ resources/qml/Menus/HelpMenu.qml | 23 ++++ resources/qml/Menus/PreferencesMenu.qml | 25 ++++ 3 files changed, 53 insertions(+), 128 deletions(-) create mode 100644 resources/qml/Menus/HelpMenu.qml create mode 100644 resources/qml/Menus/PreferencesMenu.qml diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index aa6fb803c3..7d52a1c588 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -66,142 +66,19 @@ Item ExtensionMenu {} + PreferencesMenu {} + + HelpMenu {} + } - /*UM.ApplicationMenu - { - id: applicationMenu - - //FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") } - - Menu - { - title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit") - - MenuItem { action: Cura.Actions.undo } - MenuItem { action: Cura.Actions.redo } - MenuSeparator { } - MenuItem { action: Cura.Actions.selectAll } - MenuItem { action: Cura.Actions.arrangeAll } - MenuItem { action: Cura.Actions.multiplySelection } - MenuItem { action: Cura.Actions.deleteSelection } - MenuItem { action: Cura.Actions.deleteAll } - MenuItem { action: Cura.Actions.resetAllTranslation } - MenuItem { action: Cura.Actions.resetAll } - MenuSeparator { } - MenuItem { action: Cura.Actions.groupObjects } - MenuItem { action: Cura.Actions.mergeObjects } - MenuItem { action: Cura.Actions.unGroupObjects } - } - - ViewMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&View") } - - SettingsMenu - { - //On MacOS, don't translate the "Settings" word. - //Qt moves the "settings" entry to a different place, and if it got renamed can't find it again when it - //attempts to delete the item upon closing the application, causing a crash. - //In the new location, these items are translated automatically according to the system's language. - //For more information, see: - //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar - //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar - title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") - } - - Menu - { - id: extensionMenu - title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions") - - Instantiator - { - id: extensions - model: UM.ExtensionModel { } - - Menu - { - id: sub_menu - title: model.name; - visible: actions != null - enabled: actions != null - Instantiator - { - model: actions - Loader - { - property var extensionsModel: extensions.model - property var modelText: model.text - property var extensionName: name - - sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem - } - - onObjectAdded: sub_menu.insertItem(index, object.item) - onObjectRemoved: sub_menu.removeItem(object.item) - } - } - - onObjectAdded: extensionMenu.insertItem(index, object) - onObjectRemoved: extensionMenu.removeItem(object) - } - } - - Menu - { - id: preferencesMenu - - //On MacOS, don't translate the "Preferences" word. - //Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it - //attempts to delete the item upon closing the application, causing a crash. - //In the new location, these items are translated automatically according to the system's language. - //For more information, see: - //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar - //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar - title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references") - - MenuItem { action: Cura.Actions.preferences } - } - - Menu - { - id: helpMenu - title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") - - MenuItem { action: Cura.Actions.showProfileFolder } - MenuItem { action: Cura.Actions.showTroubleshooting} - MenuItem { action: Cura.Actions.documentation } - MenuItem { action: Cura.Actions.reportBug } - MenuSeparator { } - MenuItem { action: Cura.Actions.whatsNew } - MenuItem { action: Cura.Actions.about } - } - }*/ - - - /*Component - { - id: extensionsMenuItem - - MenuItem - { - text: modelText - onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText) - } - } - - Component - { - id: extensionsMenuSeparator - - MenuSeparator {} - } // ############################################################################################### // Definition of other components that are linked to the menus // ############################################################################################### - WorkspaceSummaryDialog + /*WorkspaceSummaryDialog { id: saveWorkspaceDialog property var args diff --git a/resources/qml/Menus/HelpMenu.qml b/resources/qml/Menus/HelpMenu.qml new file mode 100644 index 0000000000..d90fec57bc --- /dev/null +++ b/resources/qml/Menus/HelpMenu.qml @@ -0,0 +1,23 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.4 + +import UM 1.5 as UM +import Cura 1.0 as Cura + + +Menu +{ + id: helpMenu + title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") + + UM.MenuItem { action: Cura.Actions.showProfileFolder } + UM.MenuItem { action: Cura.Actions.showTroubleshooting} + UM.MenuItem { action: Cura.Actions.documentation } + UM.MenuItem { action: Cura.Actions.reportBug } + MenuSeparator { } + UM.MenuItem { action: Cura.Actions.whatsNew } + UM.MenuItem { action: Cura.Actions.about } +} \ No newline at end of file diff --git a/resources/qml/Menus/PreferencesMenu.qml b/resources/qml/Menus/PreferencesMenu.qml new file mode 100644 index 0000000000..8b5e8fbcd5 --- /dev/null +++ b/resources/qml/Menus/PreferencesMenu.qml @@ -0,0 +1,25 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.4 + +import UM 1.5 as UM +import Cura 1.0 as Cura + +Menu +{ + id: preferencesMenu + + //On MacOS, don't translate the "Preferences" word. + //Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it + //attempts to delete the item upon closing the application, causing a crash. + //In the new location, these items are translated automatically according to the system's language. + //For more information, see: + //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar + //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar + title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references") + + UM.MenuItem { action: Cura.Actions.preferences } +} + From 29c9322fc8068d0cf09a0fd00bc42b15f119f00e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:16:40 +0100 Subject: [PATCH 028/377] Add background to application menu CURA-8683 --- resources/qml/MainWindow/ApplicationMenu.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 7d52a1c588..20a7e774f9 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -14,7 +14,7 @@ import "../Dialogs" Item { id: menu - width: applicationMenu.width + width: parent.width height: applicationMenu.height Component @@ -46,12 +46,15 @@ Item MenuBar { id: applicationMenu + width: parent.width delegate: menuBarComponent FileMenu {} EditMenu {} ViewMenu {} + background: Rectangle {} + SettingsMenu { //On MacOS, don't translate the "Settings" word. @@ -78,7 +81,7 @@ Item // Definition of other components that are linked to the menus // ############################################################################################### - /*WorkspaceSummaryDialog + WorkspaceSummaryDialog { id: saveWorkspaceDialog property var args @@ -101,11 +104,6 @@ Item } } - UM.ExtensionModel - { - id: curaExtensions - } - // ############################################################################################### // Definition of all the connections // ############################################################################################### @@ -141,5 +139,5 @@ Item curaExtensions.callExtensionMethod("Toolbox", "launch") curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") } - }*/ + } } \ No newline at end of file From 0bd0f094375fb115d6b6894a7513e0019a393483 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:26:05 +0100 Subject: [PATCH 029/377] Remove unused component CURA-8683 --- resources/qml/MainWindow/ApplicationMenu.qml | 27 -------------------- 1 file changed, 27 deletions(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 20a7e774f9..06fbc7a47a 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -17,37 +17,10 @@ Item width: parent.width height: applicationMenu.height - Component - { - id: menuBarComponent - MenuBarItem - { - id: menuBarItem - - function replaceText(txt) - { - var index = txt.indexOf("&") - if(index >= 0) - { - txt = txt.replace(txt.substr(index, 2), ("" + txt.substr(index + 1, 1) +"")) - } - return txt - } - - contentItem: Label { - text: replaceText(menuBarItem.text) - color: "white" - verticalAlignment: Text.AlignVCenter - textFormat: Text.RichText - } - } - } - MenuBar { id: applicationMenu width: parent.width - delegate: menuBarComponent FileMenu {} EditMenu {} From 70209aa7286d19a75acbe3594c1ccf48e9feff8c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:26:26 +0100 Subject: [PATCH 030/377] Use the regular menu for extensions It seems that the extra logic doesn't play well with a menu bar. Since we don't need to make this menu invisible ever, there is no need for the extra logic to hide it. As such we can just use the regular menu CURA-8683 --- resources/qml/Menus/ExtensionMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml index 0d4bc7c6e7..2504c7a9e1 100644 --- a/resources/qml/Menus/ExtensionMenu.qml +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -UM.Menu +Menu { id: extensionMenu title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions") From b30ad58f916cb57113a93f01810d812821813b98 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:36:34 +0100 Subject: [PATCH 031/377] Update context menu to controls 2 CURA-8683 --- resources/qml/Menus/ContextMenu.qml | 103 ++++++++-------------------- 1 file changed, 30 insertions(+), 73 deletions(-) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 1709d70ab5..41dfafbe2f 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -2,11 +2,11 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Menu @@ -18,79 +18,58 @@ Menu property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel() // Selection-related actions. - MenuItem { action: Cura.Actions.centerSelection; } - MenuItem { action: Cura.Actions.deleteSelection; } - MenuItem { action: Cura.Actions.multiplySelection; } + UM.MenuItem { action: Cura.Actions.centerSelection; } + UM.MenuItem { action: Cura.Actions.deleteSelection; } + UM.MenuItem { action: Cura.Actions.multiplySelection; } // Extruder selection - only visible if there is more than 1 extruder MenuSeparator { visible: base.shouldShowExtruders } - MenuItem { id: extruderHeader; text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount); enabled: false; visible: base.shouldShowExtruders } + UM.MenuItem + { + id: extruderHeader + text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount) + enabled: false + visible: base.shouldShowExtruders + height: visible ? implicitHeight: 0 + } + Instantiator { model: CuraApplication.getExtrudersModel() - MenuItem { + UM.MenuItem + { text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant) visible: base.shouldShowExtruders + height: visible ? implicitHeight: 0 enabled: UM.Selection.hasSelection && model.enabled checkable: true checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(model.id) != -1 onTriggered: CuraActions.setExtruderForSelection(model.id) shortcut: "Ctrl+" + (model.index + 1) } - onObjectAdded: base.insertItem(index, object) + onObjectAdded: base.insertItem(index + 5, object) onObjectRemoved: base.removeItem(object) } - MenuSeparator { - visible: UM.Preferences.getValue("cura/use_multi_build_plate") - } - - Instantiator - { - model: base.multiBuildPlateModel - MenuItem { - enabled: UM.Selection.hasSelection - text: base.multiBuildPlateModel.getItem(index).name; - onTriggered: CuraActions.setBuildPlateForSelection(base.multiBuildPlateModel.getItem(index).buildPlateNumber); - checkable: true - checked: base.multiBuildPlateModel.selectionBuildPlates.indexOf(base.multiBuildPlateModel.getItem(index).buildPlateNumber) != -1; - visible: UM.Preferences.getValue("cura/use_multi_build_plate") - } - onObjectAdded: base.insertItem(index, object); - onObjectRemoved: base.removeItem(object); - } - - MenuItem { - enabled: UM.Selection.hasSelection - text: "New build plate"; - onTriggered: { - CuraActions.setBuildPlateForSelection(base.multiBuildPlateModel.maxBuildPlate + 1); - checked = false; - } - checkable: true - checked: false - visible: UM.Preferences.getValue("cura/use_multi_build_plate") - } - // Global actions MenuSeparator {} - MenuItem { action: Cura.Actions.selectAll; } - MenuItem { action: Cura.Actions.arrangeAll; } - MenuItem { action: Cura.Actions.deleteAll; } - MenuItem { action: Cura.Actions.reloadAll; } - MenuItem { action: Cura.Actions.resetAllTranslation; } - MenuItem { action: Cura.Actions.resetAll; } + UM.MenuItem { action: Cura.Actions.selectAll } + UM.MenuItem { action: Cura.Actions.arrangeAll } + UM.MenuItem { action: Cura.Actions.deleteAll } + UM.MenuItem { action: Cura.Actions.reloadAll } + UM.MenuItem { action: Cura.Actions.resetAllTranslation } + UM.MenuItem { action: Cura.Actions.resetAll } // Group actions MenuSeparator {} - MenuItem { action: Cura.Actions.groupObjects; } - MenuItem { action: Cura.Actions.mergeObjects; } - MenuItem { action: Cura.Actions.unGroupObjects; } + UM.MenuItem { action: Cura.Actions.groupObjects } + UM.MenuItem { action: Cura.Actions.mergeObjects } + UM.MenuItem { action: Cura.Actions.unGroupObjects } Connections { target: UM.Controller - function onContextMenuRequested() { base.popup(); } + function onContextMenuRequested() { base.popup() } } Connections @@ -146,31 +125,9 @@ Menu { id: copiesField focus: true - minimumValue: 1 - maximumValue: 99 + from: 1 + to: 99 } } } - - // Find the index of an item in the list of child items of this menu. - // - // This is primarily intended as a helper function so we do not have to - // hard-code the position of the extruder selection actions. - // - // \param item The item to find the index of. - // - // \return The index of the item or -1 if it was not found. - function findItemIndex(item) - { - for(var i in base.items) - { - if(base.items[i] == item) - { - return i; - } - } - return -1; - } - - UM.I18nCatalog { id: catalog; name: "cura" } } From f8906597e596f81e1dfcd0dbe03203f799fca8e9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:43:01 +0100 Subject: [PATCH 032/377] Update menu for PrinterType button CURA-8683 --- .../Menus/ConfigurationMenu/CustomConfiguration.qml | 11 ++++++----- resources/qml/Menus/PrinterTypeMenu.qml | 9 +++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 10bd5624d7..bacee0bc24 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -35,7 +35,7 @@ Item } } - //Printer type selector. + // Printer type selector. Item { id: printerTypeSelectorRow @@ -64,17 +64,18 @@ Item anchors.left: parent.left } - OldControls.ToolButton + Button { id: printerTypeSelector text: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.name: "" - tooltip: text + height: UM.Theme.getSize("print_setup_big_item").height width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width anchors.right: parent.right - style: UM.Theme.styles.print_setup_header_button + onClicked: menu.open() + //style: UM.Theme.styles.print_setup_header_button - menu: Cura.PrinterTypeMenu { } + Cura.PrinterTypeMenu { id: menu} } } diff --git a/resources/qml/Menus/PrinterTypeMenu.qml b/resources/qml/Menus/PrinterTypeMenu.qml index c2a09e0efd..9a6c066b4d 100644 --- a/resources/qml/Menus/PrinterTypeMenu.qml +++ b/resources/qml/Menus/PrinterTypeMenu.qml @@ -2,9 +2,9 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.4 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Menu @@ -18,12 +18,11 @@ Menu id: printerTypeInstantiator model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : [] - MenuItem + UM.MenuItem { text: modelData.machine_type checkable: true checked: Cura.MachineManager.activeMachine.definition.name == modelData.machine_type - exclusiveGroup: group onTriggered: { Cura.MachineManager.switchPrinterType(modelData.machine_type) @@ -32,6 +31,4 @@ Menu onObjectAdded: menu.insertItem(index, object) onObjectRemoved: menu.removeItem(object) } - - ExclusiveGroup { id: group } } From 3d0e71fe7e8abe4e345381a838109c8289379dea Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:44:59 +0100 Subject: [PATCH 033/377] Remove unused import --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 0d4d5e9aed..69d938d977 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.5 as UM From 6644bff2be3ea05e9912fffc11d8f9570fe198fb Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 11:52:43 +0100 Subject: [PATCH 034/377] Fix some QML warnings on closing Cura CURA-8683 --- .../ConfigurationMenu/ConfigurationMenu.qml | 16 ++++++++-------- resources/qml/Menus/NozzleMenu.qml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 69d938d977..9860a522e5 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -18,7 +18,7 @@ Cura.ExpandablePopup id: base property var extrudersModel: CuraApplication.getExtrudersModel() - + property var activeMachine: Cura.MachineManager.activeMachine UM.I18nCatalog { id: catalog @@ -32,7 +32,7 @@ Cura.ExpandablePopup } contentPadding: UM.Theme.getSize("default_lining").width - enabled: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials || Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change. + enabled: activeMachine ? activeMachine.hasMaterials || activeMachine.hasVariants || activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change. headerItem: Item { @@ -43,7 +43,7 @@ Cura.ExpandablePopup anchors.bottom: parent.bottom anchors.left: parent.left width: parent.width - UM.Theme.getSize("standard_arrow").width - visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false + visible: activeMachine ? activeMachine.hasMaterials : false Repeater { model: extrudersModel @@ -55,9 +55,9 @@ Cura.ExpandablePopup Layout.maximumWidth: Math.round(parent.width / extrudersModel.count) Layout.fillHeight: true - property var extruderStack: Cura.MachineManager.activeMachine.extruders[model.index] + property var extruderStack: activeMachine ? activeMachine.extruders[model.index]: null property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack) - property bool valueError: Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" + property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" : false // Extruder icon. Shows extruder index and has the same color as the active material. Cura.ExtruderIcon @@ -223,7 +223,7 @@ Cura.ExpandablePopup { id: variantLabel - visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false + visible: activeMachine ? activeMachine.hasVariants : false text: model.variant elide: Text.ElideRight @@ -242,7 +242,7 @@ Cura.ExpandablePopup elide: Text.ElideRight font: UM.Theme.getFont("medium") - visible: Cura.MachineManager.activeMachine ? !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates) : false + visible: activeMachine ? !activeMachine.hasMaterials && (activeMachine.hasVariants || activeMachine.hasVariantBuildplates) : false anchors { @@ -267,7 +267,7 @@ Cura.ExpandablePopup onVisibleChanged: { - is_connected = Cura.MachineManager.activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate. + is_connected = activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate. // If the printer is not connected or does not have configurations, we switch always to the custom mode. If is connected instead, the auto mode // or the previous state is selected diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index e2c5199211..973cf1fb09 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -34,7 +34,7 @@ UM.Menu { return false } - var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] + var extruder = activeMachine.extruderList[extruderIndex] return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name) } enabled: @@ -43,7 +43,7 @@ UM.Menu { return false } - var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] + var extruder = activeMachine.extruderList[extruderIndex] return (extruder === undefined) ? false : extruder.isEnabled } onTriggered:Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node) From 59479ee223b28e97c2dc47fcbb8f2a0e18bb457f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Jan 2022 12:09:24 +0100 Subject: [PATCH 035/377] Fix checked property for materials menu CURA-8683 --- resources/qml/Menus/MaterialMenu.qml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index 9a0c8e2c77..5d02a2dd90 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -9,7 +9,7 @@ import Cura 1.0 as Cura UM.Menu { - id: menu + id: materialMenu title: catalog.i18nc("@label:category menu label", "Material") property int extruderIndex: 0 @@ -25,27 +25,26 @@ UM.Menu } property bool isActiveExtruderEnabled: (activeExtruder === null || activeExtruder === undefined) ? false : activeExtruder.isEnabled - property string activeMaterialId: (activeExtruder === null || activeExtruder === undefined) ? false : activeExtruder.material.id - + property string activeMaterialId: (activeExtruder === null || activeExtruder === undefined) ? "" : activeExtruder.material.id property bool updateModels: true Cura.FavoriteMaterialsModel { id: favoriteMaterialsModel - extruderPosition: menu.extruderIndex + extruderPosition: materialMenu.extruderIndex enabled: updateModels } Cura.GenericMaterialsModel { id: genericMaterialsModel - extruderPosition: menu.extruderIndex + extruderPosition: materialMenu.extruderIndex enabled: updateModels } Cura.MaterialBrandsModel { id: brandModel - extruderPosition: menu.extruderIndex + extruderPosition: materialMenu.extruderIndex enabled: updateModels } @@ -65,11 +64,11 @@ UM.Menu text: model.brand + " " + model.name checkable: true enabled: isActiveExtruderEnabled - checked: model.root_material_id === menu.currentRootMaterialId + checked: model.root_material_id === materialMenu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(index) + onObjectAdded: materialMenu.insertItem(index, object) + onObjectRemoved: materialMenu.removeItem(index) } MenuSeparator {} @@ -87,7 +86,7 @@ UM.Menu text: model.name checkable: true enabled: isActiveExtruderEnabled - checked: model.root_material_id === menu.currentRootMaterialId + checked: model.root_material_id === materialMenu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } onObjectAdded: genericMenu.insertItem(index, object) @@ -125,7 +124,7 @@ UM.Menu text: model.name checkable: true enabled: isActiveExtruderEnabled - checked: model.id === menu.activeMaterialId + checked: model.id === materialMenu.activeMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } @@ -137,8 +136,8 @@ UM.Menu onObjectRemoved: brandMenu.removeMenu(object) } } - onObjectAdded: menu.insertMenu(index, object) - onObjectRemoved: menu.removeMenu(object) + onObjectAdded: materialMenu.insertMenu(index, object) + onObjectRemoved: materialMenu.removeMenu(object) } MenuSeparator {} From f44d4d341f50b0c96e3a3ccf57d360c9c6908a6e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Jan 2022 15:57:20 +0100 Subject: [PATCH 036/377] Apply suggestions from code review Minor codestyle issues CURA-8683 Co-authored-by: Casper Lamboo --- resources/qml/Menus/NozzleMenu.qml | 7 ++----- resources/qml/Menus/ViewMenu.qml | 2 +- resources/qml/Widgets/MenuItem.qml | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index 973cf1fb09..7afe2b48bc 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -46,13 +46,10 @@ UM.Menu var extruder = activeMachine.extruderList[extruderIndex] return (extruder === undefined) ? false : extruder.isEnabled } - onTriggered:Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node) + onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node) } - onObjectAdded: - { - nozzleMenu.insertItem(index, object) - } + onObjectAdded: nozzleMenu.insertItem(index, object) onObjectRemoved: nozzleMenu.removeItem(object) } diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index 0b6489bf9a..d38bf536b0 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -27,7 +27,7 @@ Menu { id: cameraViewMenu - title: catalog.i18nc("@action:inmenu menubar:view","Camera view") + title: catalog.i18nc("@action:inmenu menubar:view", "Camera view") property string cameraMode: UM.Preferences.getValue("general/camera_perspective_mode") Connections diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index 8861da1eac..dd3f40b49a 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -15,7 +15,7 @@ MenuItem implicitHeight: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("narrow_margin").height opacity: enabled ? 1.0 : 0.5 - height: visible ? implicitHeight: 0 + height: visible ? implicitHeight : 0 arrow: UM.RecolorImage { From 94c71704dbfe308f3704e7c1856a11e07b9f720f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Jan 2022 16:00:32 +0100 Subject: [PATCH 037/377] Add clarifying comment about why something is added at index 5> CURA-8683 --- resources/qml/Menus/ContextMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 41dfafbe2f..02ad5b6516 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -47,6 +47,7 @@ Menu onTriggered: CuraActions.setExtruderForSelection(model.id) shortcut: "Ctrl+" + (model.index + 1) } + // Add it to the fifth position (and above) as we want it to be added after the extruder header. onObjectAdded: base.insertItem(index + 5, object) onObjectRemoved: base.removeItem(object) } From 94c006009b8aa05a9ad52e8352752ab22f59af7f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Jan 2022 09:06:22 +0100 Subject: [PATCH 038/377] Remove debug code CURA-8683 --- resources/qml/Menus/PrinterMenu.qml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/resources/qml/Menus/PrinterMenu.qml b/resources/qml/Menus/PrinterMenu.qml index 58c15201a2..dcc9605bd7 100644 --- a/resources/qml/Menus/PrinterMenu.qml +++ b/resources/qml/Menus/PrinterMenu.qml @@ -36,12 +36,7 @@ Menu text: connectGroupName checkable: true checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName - onTriggered: - { - print(typeof(model.id)) - Cura.MachineManager.someFunction("YAY") - Cura.MachineManager.setActiveMachine(model.id) - } + onTriggered: Cura.MachineManager.setActiveMachine(model.id) } onObjectAdded: menu.insertItem(2, object) onObjectRemoved: menu.removeItem(object) From 13af43b76cd51b85fe0aa79423a6be23c83ddb71 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Jan 2022 09:19:47 +0100 Subject: [PATCH 039/377] Fix context menu visibility for settingview CURA-8683 --- resources/qml/Settings/SettingView.qml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 2b0f2a5452..6547687b51 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import "../Menus" @@ -423,20 +423,22 @@ Item property var provider property bool settingVisible - MenuItem + UM.MenuItem { //: Settings context menu action text: catalog.i18nc("@action:menu", "Copy value to all extruders") visible: machineExtruderCount.properties.value > 1 + height: visible ? implicitHeight : 0 enabled: contextMenu.provider !== undefined && contextMenu.provider.properties.settable_per_extruder !== "False" onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key) } - MenuItem + UM.MenuItem { //: Settings context menu action text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders") visible: machineExtruderCount.properties.value > 1 + height: visible ? implicitHeight : 0 enabled: contextMenu.provider !== undefined onTriggered: Cura.MachineManager.copyAllValuesToExtruders() } @@ -444,13 +446,14 @@ Item MenuSeparator { visible: machineExtruderCount.properties.value > 1 + height: visible ? implicitHeight : 0 } Instantiator { id: customMenuItems model: Cura.SidebarCustomMenuItemsModel { } - MenuItem + UM.MenuItem { text: model.name //iconName: model.icon_name @@ -466,19 +469,21 @@ Item MenuSeparator { visible: customMenuItems.count > 0 + height: visible ? implicitHeight : 0 } - MenuItem + UM.MenuItem { //: Settings context menu action visible: !findingSettings - text: catalog.i18nc("@action:menu", "Hide this setting"); + text: catalog.i18nc("@action:menu", "Hide this setting") + height: visible ? implicitHeight : 0 onTriggered: { definitionsModel.hide(contextMenu.key) } } - MenuItem + UM.MenuItem { //: Settings context menu action text: @@ -493,6 +498,7 @@ Item } } visible: findingSettings + height: visible ? implicitHeight : 0 onTriggered: { if (contextMenu.settingVisible) @@ -505,7 +511,7 @@ Item } } } - MenuItem + UM.MenuItem { //: Settings context menu action text: catalog.i18nc("@action:menu", "Configure setting visibility..."); From 313c10801dfc8aa6d9c9ea5f84317c00bf3151df Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Jan 2022 09:23:13 +0100 Subject: [PATCH 040/377] Codestyle fixes --- resources/qml/Settings/SettingView.qml | 58 +++++++++++--------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 6547687b51..5092345a1d 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -14,7 +14,6 @@ Item id: settingsView property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel() - //property Action configureSettings property bool findingSettings Item @@ -46,7 +45,7 @@ Item anchors.left: parent.left anchors.right: parent.right leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2 - placeholderText: catalog.i18nc("@label:textbox", "Search settings") + placeholderText: catalog.i18nc("@label:textbox", "Search settings") font.italic: true property var expandedCategories @@ -68,10 +67,7 @@ Item color: UM.Theme.getColor("text") } - onTextChanged: - { - settingsSearchTimer.restart() - } + onTextChanged: settingsSearchTimer.restart() onEditingFinished: { @@ -84,10 +80,7 @@ Item } } - Keys.onEscapePressed: - { - filter.text = "" - } + Keys.onEscapePressed: filter.text = "" function updateDefinitionModel() { @@ -294,12 +287,12 @@ Item if (inheritStackProvider.properties.limit_to_extruder !== undefined && inheritStackProvider.properties.limit_to_extruder >= 0) { //We have limit_to_extruder, so pick that stack. - return Cura.ExtruderManager.extruderIds[inheritStackProvider.properties.limit_to_extruder]; + return Cura.ExtruderManager.extruderIds[inheritStackProvider.properties.limit_to_extruder] } if (Cura.ExtruderManager.activeExtruderStackId) { //We're on an extruder tab. Pick the current extruder. - return Cura.ExtruderManager.activeExtruderStackId; + return Cura.ExtruderManager.activeExtruderStackId } //No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab. return contents.activeMachineId @@ -332,10 +325,10 @@ Item target: item function onContextMenuRequested() { - contextMenu.key = model.key; - contextMenu.settingVisible = model.visible; + contextMenu.key = model.key + contextMenu.settingVisible = model.visible contextMenu.provider = provider - contextMenu.popup(); + contextMenu.popup() //iconName: model.icon_name } function onShowTooltip(text) { base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) } function onHideTooltip() { base.hideTooltip() } @@ -350,36 +343,36 @@ Item } function onFocusReceived() { - contents.indexWithFocus = index; - animateContentY.from = contents.contentY; - contents.positionViewAtIndex(index, ListView.Contain); - animateContentY.to = contents.contentY; - animateContentY.running = true; + contents.indexWithFocus = index + animateContentY.from = contents.contentY + contents.positionViewAtIndex(index, ListView.Contain) + animateContentY.to = contents.contentY + animateContentY.running = true } function onSetActiveFocusToNextSetting(forward) { if (forward == undefined || forward) { - contents.currentIndex = contents.indexWithFocus + 1; + contents.currentIndex = contents.indexWithFocus + 1 while(contents.currentItem && contents.currentItem.height <= 0) { - contents.currentIndex++; + contents.currentIndex++ } if (contents.currentItem) { - contents.currentItem.item.focusItem.forceActiveFocus(); + contents.currentItem.item.focusItem.forceActiveFocus() } } else { - contents.currentIndex = contents.indexWithFocus - 1; + contents.currentIndex = contents.indexWithFocus - 1 while(contents.currentItem && contents.currentItem.height <= 0) { - contents.currentIndex--; + contents.currentIndex-- } if (contents.currentItem) { - contents.currentItem.item.focusItem.forceActiveFocus(); + contents.currentItem.item.focusItem.forceActiveFocus() } } } @@ -456,7 +449,6 @@ Item UM.MenuItem { text: model.name - //iconName: model.icon_name onTriggered: { customMenuItems.model.callMenuItemMethod(name, model.actions, {"key": contextMenu.key}) @@ -490,11 +482,11 @@ Item { if (contextMenu.settingVisible) { - return catalog.i18nc("@action:menu", "Don't show this setting"); + return catalog.i18nc("@action:menu", "Don't show this setting") } else { - return catalog.i18nc("@action:menu", "Keep this setting visible"); + return catalog.i18nc("@action:menu", "Keep this setting visible") } } visible: findingSettings @@ -503,20 +495,20 @@ Item { if (contextMenu.settingVisible) { - definitionsModel.hide(contextMenu.key); + definitionsModel.hide(contextMenu.key) } else { - definitionsModel.show(contextMenu.key); + definitionsModel.show(contextMenu.key) } } } UM.MenuItem { //: Settings context menu action - text: catalog.i18nc("@action:menu", "Configure setting visibility..."); + text: catalog.i18nc("@action:menu", "Configure setting visibility...") - onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu); + onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu) } } From b614cabae6c05dacfa160aeb6680a15570a651c3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Jan 2022 13:05:07 +0100 Subject: [PATCH 041/377] Put back import --- plugins/SimulationView/SimulationViewMenuComponent.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 1e58fb23bb..6addaa6dc5 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -3,6 +3,7 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 +import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.1 import QtGraphicalEffects 1.0 @@ -284,7 +285,7 @@ Cura.ExpandableComponent visible: viewSettings.show_legend } - Label + UM.Label { text: label font: UM.Theme.getFont("default") From 38e20fd90b5644d1819069102e36de3a25ccb6c5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Jan 2022 13:08:03 +0100 Subject: [PATCH 042/377] Fix menuItem not hiding correctly CURA-8693 --- resources/qml/Menus/FileMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/FileMenu.qml b/resources/qml/Menus/FileMenu.qml index a1a2d1aaec..ca0fb2fa47 100644 --- a/resources/qml/Menus/FileMenu.qml +++ b/resources/qml/Menus/FileMenu.qml @@ -43,6 +43,7 @@ Menu shortcut: StandardKey.Save text: catalog.i18nc("@title:menu menubar:file", "&Save Project...") visible: saveProjectMenu.model.count == 1 + height: visible ? implicitHeight : 0 enabled: UM.WorkspaceFileHandler.enabled onTriggered: { From bab931128467a955a95c2efd180eb5700050f11e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Jan 2022 13:14:15 +0100 Subject: [PATCH 043/377] Fix opening of marketplace button CURA-8684 --- resources/qml/MainWindow/ApplicationMenu.qml | 8 ++++---- resources/qml/Menus/ExtensionMenu.qml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 06fbc7a47a..269f918ad2 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -40,7 +40,7 @@ Item title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") } - ExtensionMenu {} + ExtensionMenu { id: extensionMenu } PreferencesMenu {} @@ -99,7 +99,7 @@ Item target: Cura.Actions.browsePackages function onTriggered() { - curaExtensions.callExtensionMethod("Toolbox", "launch") + extensionMenu.extensionModel.callExtensionMethod("Toolbox", "launch") } } @@ -109,8 +109,8 @@ Item target: Cura.Actions.marketplaceMaterials function onTriggered() { - curaExtensions.callExtensionMethod("Toolbox", "launch") - curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") + extensionMenu.extensionModel.callExtensionMethod("Toolbox", "launch") + extensionMenu.extensionModel.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") } } } \ No newline at end of file diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml index 2504c7a9e1..4cde8158cc 100644 --- a/resources/qml/Menus/ExtensionMenu.qml +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -11,7 +11,7 @@ Menu { id: extensionMenu title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions") - + property var extensionModel: UM.ExtensionModel { } Component { id: extensionsMenuItem @@ -33,7 +33,7 @@ Menu Instantiator { id: extensions - model: UM.ExtensionModel { } + model: extensionModel UM.Menu { From 3130ea0f7443a57dd2817abd03e867a765711650 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Jan 2022 13:46:05 +0100 Subject: [PATCH 044/377] Use Cura.MenuItem instead of UM.MenuItem I didn't realise that Cura already had a menu item. To prevent Confusion, i've changed Cura.MenuItem to use UM.MenuItem and let all other menus use Cura.MenuItem --- resources/qml/Menus/ContextMenu.qml | 36 ++++++++++++------------- resources/qml/Menus/EditMenu.qml | 24 ++++++++--------- resources/qml/Menus/ExtensionMenu.qml | 2 +- resources/qml/Menus/FileMenu.qml | 16 +++++------ resources/qml/Menus/HelpMenu.qml | 14 +++++----- resources/qml/Menus/MaterialMenu.qml | 21 +++++++-------- resources/qml/Menus/NozzleMenu.qml | 2 +- resources/qml/Menus/OpenFilesMenu.qml | 2 +- resources/qml/Menus/PreferencesMenu.qml | 2 +- resources/qml/Menus/PrinterMenu.qml | 25 +++++++---------- resources/qml/Menus/PrinterTypeMenu.qml | 2 +- resources/qml/Menus/SaveProjectMenu.qml | 4 +-- resources/qml/Menus/SettingsMenu.qml | 10 +++---- resources/qml/Menus/ViewMenu.qml | 20 +++++++------- resources/qml/Settings/SettingView.qml | 22 ++++++--------- resources/qml/Widgets/MenuItem.qml | 21 +++------------ resources/qml/Widgets/MenuSeparator.qml | 1 - 17 files changed, 96 insertions(+), 128 deletions(-) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 02ad5b6516..4ca51c0974 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -18,29 +18,27 @@ Menu property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel() // Selection-related actions. - UM.MenuItem { action: Cura.Actions.centerSelection; } - UM.MenuItem { action: Cura.Actions.deleteSelection; } - UM.MenuItem { action: Cura.Actions.multiplySelection; } + Cura.MenuItem { action: Cura.Actions.centerSelection; } + Cura.MenuItem { action: Cura.Actions.deleteSelection; } + Cura.MenuItem { action: Cura.Actions.multiplySelection; } // Extruder selection - only visible if there is more than 1 extruder - MenuSeparator { visible: base.shouldShowExtruders } - UM.MenuItem + Cura.MenuSeparator { visible: base.shouldShowExtruders } + Cura.MenuItem { id: extruderHeader text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount) enabled: false visible: base.shouldShowExtruders - height: visible ? implicitHeight: 0 } Instantiator { model: CuraApplication.getExtrudersModel() - UM.MenuItem + Cura.MenuItem { text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant) visible: base.shouldShowExtruders - height: visible ? implicitHeight: 0 enabled: UM.Selection.hasSelection && model.enabled checkable: true checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(model.id) != -1 @@ -53,19 +51,19 @@ Menu } // Global actions - MenuSeparator {} - UM.MenuItem { action: Cura.Actions.selectAll } - UM.MenuItem { action: Cura.Actions.arrangeAll } - UM.MenuItem { action: Cura.Actions.deleteAll } - UM.MenuItem { action: Cura.Actions.reloadAll } - UM.MenuItem { action: Cura.Actions.resetAllTranslation } - UM.MenuItem { action: Cura.Actions.resetAll } + Cura.MenuSeparator {} + Cura.MenuItem { action: Cura.Actions.selectAll } + Cura.MenuItem { action: Cura.Actions.arrangeAll } + Cura.MenuItem { action: Cura.Actions.deleteAll } + Cura.MenuItem { action: Cura.Actions.reloadAll } + Cura.MenuItem { action: Cura.Actions.resetAllTranslation } + Cura.MenuItem { action: Cura.Actions.resetAll } // Group actions - MenuSeparator {} - UM.MenuItem { action: Cura.Actions.groupObjects } - UM.MenuItem { action: Cura.Actions.mergeObjects } - UM.MenuItem { action: Cura.Actions.unGroupObjects } + Cura.MenuSeparator {} + Cura.MenuItem { action: Cura.Actions.groupObjects } + Cura.MenuItem { action: Cura.Actions.mergeObjects } + Cura.MenuItem { action: Cura.Actions.unGroupObjects } Connections { diff --git a/resources/qml/Menus/EditMenu.qml b/resources/qml/Menus/EditMenu.qml index 813b000aa6..c2ec9903f2 100644 --- a/resources/qml/Menus/EditMenu.qml +++ b/resources/qml/Menus/EditMenu.qml @@ -11,18 +11,18 @@ Menu { title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit") - UM.MenuItem { action: Cura.Actions.undo } - UM.MenuItem { action: Cura.Actions.redo } + Cura.MenuItem { action: Cura.Actions.undo } + Cura.MenuItem { action: Cura.Actions.redo } MenuSeparator { } - UM.MenuItem { action: Cura.Actions.selectAll } - UM.MenuItem { action: Cura.Actions.arrangeAll } - UM.MenuItem { action: Cura.Actions.multiplySelection } - UM.MenuItem { action: Cura.Actions.deleteSelection } - UM.MenuItem { action: Cura.Actions.deleteAll } - UM.MenuItem { action: Cura.Actions.resetAllTranslation } - UM.MenuItem { action: Cura.Actions.resetAll } + Cura.MenuItem { action: Cura.Actions.selectAll } + Cura.MenuItem { action: Cura.Actions.arrangeAll } + Cura.MenuItem { action: Cura.Actions.multiplySelection } + Cura.MenuItem { action: Cura.Actions.deleteSelection } + Cura.MenuItem { action: Cura.Actions.deleteAll } + Cura.MenuItem { action: Cura.Actions.resetAllTranslation } + Cura.MenuItem { action: Cura.Actions.resetAll } MenuSeparator { } - UM.MenuItem { action: Cura.Actions.groupObjects } - UM.MenuItem { action: Cura.Actions.mergeObjects } - UM.MenuItem { action: Cura.Actions.unGroupObjects } + Cura.MenuItem { action: Cura.Actions.groupObjects } + Cura.MenuItem { action: Cura.Actions.mergeObjects } + Cura.MenuItem { action: Cura.Actions.unGroupObjects } } \ No newline at end of file diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml index 4cde8158cc..909513e8ba 100644 --- a/resources/qml/Menus/ExtensionMenu.qml +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -16,7 +16,7 @@ Menu { id: extensionsMenuItem - UM.MenuItem + Cura.MenuItem { text: modelText onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText) diff --git a/resources/qml/Menus/FileMenu.qml b/resources/qml/Menus/FileMenu.qml index ca0fb2fa47..f457220d96 100644 --- a/resources/qml/Menus/FileMenu.qml +++ b/resources/qml/Menus/FileMenu.qml @@ -14,18 +14,17 @@ Menu property var fileProviderModel: CuraApplication.getFileProviderModel() - UM.MenuItem + Cura.MenuItem { id: newProjectMenu action: Cura.Actions.newProject } - UM.MenuItem + Cura.MenuItem { id: openMenu action: Cura.Actions.open visible: base.fileProviderModel.count == 1 - height: visible ? implicitHeight: 0 } OpenFilesMenu @@ -37,13 +36,12 @@ Menu RecentFilesMenu { } - UM.MenuItem + Cura.MenuItem { id: saveWorkspaceMenu shortcut: StandardKey.Save text: catalog.i18nc("@title:menu menubar:file", "&Save Project...") visible: saveProjectMenu.model.count == 1 - height: visible ? implicitHeight : 0 enabled: UM.WorkspaceFileHandler.enabled onTriggered: { @@ -72,7 +70,7 @@ Menu MenuSeparator { } - UM.MenuItem + Cura.MenuItem { id: saveAsMenu text: catalog.i18nc("@title:menu menubar:file", "&Export...") @@ -83,7 +81,7 @@ Menu } } - UM.MenuItem + Cura.MenuItem { id: exportSelectionMenu text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...") @@ -94,7 +92,7 @@ Menu MenuSeparator { } - UM.MenuItem + Cura.MenuItem { id: reloadAllMenu action: Cura.Actions.reloadAll @@ -102,5 +100,5 @@ Menu MenuSeparator { } - UM.MenuItem { action: Cura.Actions.quit } + Cura.MenuItem { action: Cura.Actions.quit } } diff --git a/resources/qml/Menus/HelpMenu.qml b/resources/qml/Menus/HelpMenu.qml index d90fec57bc..e8a80eeced 100644 --- a/resources/qml/Menus/HelpMenu.qml +++ b/resources/qml/Menus/HelpMenu.qml @@ -13,11 +13,11 @@ Menu id: helpMenu title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") - UM.MenuItem { action: Cura.Actions.showProfileFolder } - UM.MenuItem { action: Cura.Actions.showTroubleshooting} - UM.MenuItem { action: Cura.Actions.documentation } - UM.MenuItem { action: Cura.Actions.reportBug } - MenuSeparator { } - UM.MenuItem { action: Cura.Actions.whatsNew } - UM.MenuItem { action: Cura.Actions.about } + Cura.MenuItem { action: Cura.Actions.showProfileFolder } + Cura.MenuItem { action: Cura.Actions.showTroubleshooting} + Cura.MenuItem { action: Cura.Actions.documentation } + Cura.MenuItem { action: Cura.Actions.reportBug } + Cura.MenuSeparator { } + Cura.MenuItem { action: Cura.Actions.whatsNew } + Cura.MenuItem { action: Cura.Actions.about } } \ No newline at end of file diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index 5d02a2dd90..751a2de1b4 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -48,18 +48,17 @@ UM.Menu enabled: updateModels } - UM.MenuItem + Cura.MenuItem { text: catalog.i18nc("@label:category menu label", "Favorites") enabled: false visible: favoriteMaterialsModel.items.length > 0 - height: visible ? implicitHeight: 0 } Instantiator { model: favoriteMaterialsModel - delegate: UM.MenuItem + delegate: Cura.MenuItem { text: model.brand + " " + model.name checkable: true @@ -81,7 +80,7 @@ UM.Menu Instantiator { model: genericMaterialsModel - delegate: UM.MenuItem + delegate: Cura.MenuItem { text: model.name checkable: true @@ -94,12 +93,12 @@ UM.Menu } } - MenuSeparator {} + Cura.MenuSeparator {} Instantiator { model: brandModel - UM.Menu + Cura.Menu { id: brandMenu title: brandName @@ -119,7 +118,7 @@ UM.Menu Instantiator { model: brandMaterialColors - delegate: UM.MenuItem + delegate: Cura.MenuItem { text: model.name checkable: true @@ -140,16 +139,16 @@ UM.Menu onObjectRemoved: materialMenu.removeMenu(object) } - MenuSeparator {} + Cura.MenuSeparator {} - UM.MenuItem + Cura.MenuItem { action: Cura.Actions.manageMaterials } - MenuSeparator {} + Cura.MenuSeparator {} - UM.MenuItem + Cura.MenuItem { action: Cura.Actions.marketplaceMaterials } diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index 7afe2b48bc..9699481db0 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -23,7 +23,7 @@ UM.Menu { model: nozzleModel - UM.MenuItem + Cura.MenuItem { text: model.hotend_name checkable: true diff --git a/resources/qml/Menus/OpenFilesMenu.qml b/resources/qml/Menus/OpenFilesMenu.qml index 0b6019c18d..87c518f34c 100644 --- a/resources/qml/Menus/OpenFilesMenu.qml +++ b/resources/qml/Menus/OpenFilesMenu.qml @@ -18,7 +18,7 @@ UM.Menu { id: fileProviders model: CuraApplication.getFileProviderModel() - UM.MenuItem + Cura.MenuItem { text: { diff --git a/resources/qml/Menus/PreferencesMenu.qml b/resources/qml/Menus/PreferencesMenu.qml index 8b5e8fbcd5..fd0b5d82c1 100644 --- a/resources/qml/Menus/PreferencesMenu.qml +++ b/resources/qml/Menus/PreferencesMenu.qml @@ -20,6 +20,6 @@ Menu //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references") - UM.MenuItem { action: Cura.Actions.preferences } + Cura.MenuItem { action: Cura.Actions.preferences } } diff --git a/resources/qml/Menus/PrinterMenu.qml b/resources/qml/Menus/PrinterMenu.qml index dcc9605bd7..3b14d9134f 100644 --- a/resources/qml/Menus/PrinterMenu.qml +++ b/resources/qml/Menus/PrinterMenu.qml @@ -11,7 +11,7 @@ Menu { id: menu - UM.MenuItem + Cura.MenuItem { id: networkEnabledPrinterItem text: catalog.i18nc("@label:category menu label", "Network enabled printers") @@ -22,8 +22,8 @@ Menu Instantiator { id: networKPrinterInstantiator - model: Cura.GlobalStacksModel {filterOnlineOnly: true} - UM.MenuItem + model: Cura.GlobalStacksModel {filterOnlineOnly: true } + Cura.MenuItem { property string connectGroupName: { @@ -42,12 +42,9 @@ Menu onObjectRemoved: menu.removeItem(object) } - MenuSeparator - { - visible: networKPrinterInstantiator.count > 0 - } + Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 } - UM.MenuItem + Cura.MenuItem { id: localPrinterMenu text: catalog.i18nc("@label:category menu label", "Local printers") @@ -60,13 +57,12 @@ Menu id: localPrinterInstantiator model: Cura.GlobalStacksModel {} - UM.MenuItem + Cura.MenuItem { text: model.name checkable: true checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false visible: !model.hasRemoteConnection - height: visible ? implicitHeight: 0 onTriggered: Cura.MachineManager.setActiveMachine(model.id) } // A bit hackish, but we have 2 items at the end, put them before that @@ -74,11 +70,8 @@ Menu onObjectRemoved: menu.removeItem(object) } - MenuSeparator - { - visible: localPrinterInstantiator.count > 0 - } + Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 } - UM.MenuItem { action: Cura.Actions.addMachine } - UM.MenuItem { action: Cura.Actions.configureMachines } + Cura.MenuItem { action: Cura.Actions.addMachine } + Cura.MenuItem { action: Cura.Actions.configureMachines } } diff --git a/resources/qml/Menus/PrinterTypeMenu.qml b/resources/qml/Menus/PrinterTypeMenu.qml index 9a6c066b4d..c959b97c5b 100644 --- a/resources/qml/Menus/PrinterTypeMenu.qml +++ b/resources/qml/Menus/PrinterTypeMenu.qml @@ -18,7 +18,7 @@ Menu id: printerTypeInstantiator model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : [] - UM.MenuItem + Cura.MenuItem { text: modelData.machine_type checkable: true diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index 3b7c3b9c01..46c767e33c 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -4,7 +4,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.1 -import UM 1.6 as UM +import UM 1.5 as UM import Cura 1.1 as Cura import "../Dialogs" @@ -18,7 +18,7 @@ UM.Menu Instantiator { id: projectOutputDevices - UM.MenuItem + Cura.MenuItem { text: model.name onTriggered: diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index e25686f601..44b329bbdf 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -44,13 +44,13 @@ Menu visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials } - UM.MenuItem + Cura.MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder") onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index) } - UM.MenuItem + Cura.MenuItem { text: catalog.i18nc("@action:inmenu", "Enable Extruder") onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true) @@ -58,7 +58,7 @@ Menu height: visible ? implicitHeight: 0 } - UM.MenuItem + Cura.MenuItem { text: catalog.i18nc("@action:inmenu", "Disable Extruder") onTriggered: Cura.MachineManager.setExtruderEnabled(index, false) @@ -71,7 +71,7 @@ Menu onObjectRemoved: base.removeMenu(object) } - MenuSeparator { } + Cura.MenuSeparator { } - UM.MenuItem { action: Cura.Actions.configureSettingVisibility } + Cura.MenuItem { action: Cura.Actions.configureSettingVisibility } } \ No newline at end of file diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index d38bf536b0..f9a89cbcb7 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -15,12 +15,12 @@ Menu Menu { title: catalog.i18nc("@action:inmenu menubar:view", "&Camera position") - UM.MenuItem { action: Cura.Actions.view3DCamera } - UM.MenuItem { action: Cura.Actions.viewFrontCamera } - UM.MenuItem { action: Cura.Actions.viewTopCamera } - UM.MenuItem { action: Cura.Actions.viewBottomCamera } - UM.MenuItem { action: Cura.Actions.viewLeftSideCamera } - UM.MenuItem { action: Cura.Actions.viewRightSideCamera } + Cura.MenuItem { action: Cura.Actions.view3DCamera } + Cura.MenuItem { action: Cura.Actions.viewFrontCamera } + Cura.MenuItem { action: Cura.Actions.viewTopCamera } + Cura.MenuItem { action: Cura.Actions.viewBottomCamera } + Cura.MenuItem { action: Cura.Actions.viewLeftSideCamera } + Cura.MenuItem { action: Cura.Actions.viewRightSideCamera } } Menu @@ -43,7 +43,7 @@ Menu } } - MenuItem + Cura.MenuItem { text: catalog.i18nc("@action:inmenu menubar:view", "Perspective") checkable: true @@ -54,7 +54,7 @@ Menu } } - MenuItem + Cura.MenuItem { text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic") checkable: true @@ -66,9 +66,9 @@ Menu } } - MenuSeparator {} + Cura.MenuSeparator {} - UM.MenuItem + Cura.MenuItem { action: Cura.Actions.toggleFullScreen } diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 5092345a1d..084d84e883 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -416,37 +416,34 @@ Item property var provider property bool settingVisible - UM.MenuItem + Cura.MenuItem { //: Settings context menu action text: catalog.i18nc("@action:menu", "Copy value to all extruders") visible: machineExtruderCount.properties.value > 1 - height: visible ? implicitHeight : 0 enabled: contextMenu.provider !== undefined && contextMenu.provider.properties.settable_per_extruder !== "False" onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key) } - UM.MenuItem + Cura.MenuItem { //: Settings context menu action text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders") visible: machineExtruderCount.properties.value > 1 - height: visible ? implicitHeight : 0 enabled: contextMenu.provider !== undefined onTriggered: Cura.MachineManager.copyAllValuesToExtruders() } - MenuSeparator + Cura.MenuSeparator { visible: machineExtruderCount.properties.value > 1 - height: visible ? implicitHeight : 0 } Instantiator { id: customMenuItems model: Cura.SidebarCustomMenuItemsModel { } - UM.MenuItem + Cura.MenuItem { text: model.name onTriggered: @@ -458,24 +455,22 @@ Item onObjectRemoved: contextMenu.removeItem(object) } - MenuSeparator + Cura.MenuSeparator { visible: customMenuItems.count > 0 - height: visible ? implicitHeight : 0 } - UM.MenuItem + Cura.MenuItem { //: Settings context menu action visible: !findingSettings text: catalog.i18nc("@action:menu", "Hide this setting") - height: visible ? implicitHeight : 0 onTriggered: { definitionsModel.hide(contextMenu.key) } } - UM.MenuItem + Cura.MenuItem { //: Settings context menu action text: @@ -490,7 +485,6 @@ Item } } visible: findingSettings - height: visible ? implicitHeight : 0 onTriggered: { if (contextMenu.settingVisible) @@ -503,7 +497,7 @@ Item } } } - UM.MenuItem + Cura.MenuItem { //: Settings context menu action text: catalog.i18nc("@action:menu", "Configure setting visibility...") diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index dd3f40b49a..201fd480ce 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -4,18 +4,17 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.1 as UM +import UM 1.5 as UM // // MenuItem with Cura styling. // -MenuItem +UM.MenuItem { id: menuItem implicitHeight: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("narrow_margin").height opacity: enabled ? 1.0 : 0.5 - height: visible ? implicitHeight : 0 arrow: UM.RecolorImage { @@ -42,20 +41,8 @@ MenuItem color: UM.Theme.getColor("setting_control_text") } - contentItem: Text { - leftPadding: menuItem.checkable ? menuItem.indicator.width + UM.Theme.getSize("default_margin").width : UM.Theme.getSize("thin_margin").width - rightPadding: menuItem.subMenu ? menuItem.arrow.width + UM.Theme.getSize("default_margin").width : UM.Theme.getSize("thin_margin").width - text: menuItem.text - - textFormat: Text.PlainText - renderType: Text.NativeRendering - color: UM.Theme.getColor("setting_control_text") - font: UM.Theme.getFont("default") - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - background: Rectangle { + background: Rectangle + { x: UM.Theme.getSize("default_lining").width y: UM.Theme.getSize("default_lining").width width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width diff --git a/resources/qml/Widgets/MenuSeparator.qml b/resources/qml/Widgets/MenuSeparator.qml index cfc696fbb3..04029844a2 100644 --- a/resources/qml/Widgets/MenuSeparator.qml +++ b/resources/qml/Widgets/MenuSeparator.qml @@ -12,7 +12,6 @@ import UM 1.1 as UM MenuSeparator { padding: 0 - contentItem: Rectangle { implicitHeight: UM.Theme.getSize("default_lining").height color: UM.Theme.getColor("setting_control_border") From babf3043f894aa1392437c7e30bb4c2296372c7b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Jan 2022 13:50:44 +0100 Subject: [PATCH 045/377] Use Cura.Menu instead of UM.Menu Same as the previous commit. Use the specialised variant provided by Cura instead of the generic one of UM CURA-8683 --- resources/qml/Menus/ExtensionMenu.qml | 4 ++-- resources/qml/Menus/MaterialMenu.qml | 2 +- resources/qml/Menus/NozzleMenu.qml | 2 +- resources/qml/Menus/OpenFilesMenu.qml | 2 +- resources/qml/Menus/SaveProjectMenu.qml | 2 +- resources/qml/Widgets/Menu.qml | 6 ++---- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml index 909513e8ba..fe40658e01 100644 --- a/resources/qml/Menus/ExtensionMenu.qml +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -27,7 +27,7 @@ Menu { id: extensionsMenuSeparator - MenuSeparator {} + Cura.MenuSeparator {} } Instantiator @@ -35,7 +35,7 @@ Menu id: extensions model: extensionModel - UM.Menu + Cura.Menu { id: sub_menu title: model.name diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index 751a2de1b4..ef2816ed87 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -UM.Menu +Cura.Menu { id: materialMenu title: catalog.i18nc("@label:category menu label", "Material") diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index 9699481db0..b320a02a5e 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -UM.Menu +Cura.Menu { id: nozzleMenu title: "Nozzle" diff --git a/resources/qml/Menus/OpenFilesMenu.qml b/resources/qml/Menus/OpenFilesMenu.qml index 87c518f34c..dcce902170 100644 --- a/resources/qml/Menus/OpenFilesMenu.qml +++ b/resources/qml/Menus/OpenFilesMenu.qml @@ -9,7 +9,7 @@ import Cura 1.0 as Cura import "../Dialogs" -UM.Menu +Cura.Menu { id: openFilesMenu title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...") diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index 46c767e33c..1b30546a89 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -9,7 +9,7 @@ import Cura 1.1 as Cura import "../Dialogs" -UM.Menu +Cura.Menu { id: saveProjectMenu title: catalog.i18nc("@title:menu menubar:file", "Save Project...") diff --git a/resources/qml/Widgets/Menu.qml b/resources/qml/Widgets/Menu.qml index 1c6a55c28a..b727adcb3a 100644 --- a/resources/qml/Widgets/Menu.qml +++ b/resources/qml/Widgets/Menu.qml @@ -2,20 +2,18 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 2.3 -import UM 1.1 as UM +import UM 1.5 as UM // // Menu with Cura styling. // -Menu +UM.Menu { id: menu padding: 0 implicitWidth: UM.Theme.getSize("setting_control").width - width: Math.max.apply(Math, Object.values(contentChildren).map(function(c) { return c.width })) background: Rectangle { color: UM.Theme.getColor("setting_control") From 4db8878317facaeef118c2af9176f37cf21d250b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Jan 2022 14:33:26 +0100 Subject: [PATCH 046/377] Fix ordering of material menu selection CURA-8683 --- resources/qml/Menus/MaterialMenu.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index ef2816ed87..0834d7b250 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -66,11 +66,11 @@ Cura.Menu checked: model.root_material_id === materialMenu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } - onObjectAdded: materialMenu.insertItem(index, object) + onObjectAdded: materialMenu.insertItem(index + 1, object) onObjectRemoved: materialMenu.removeItem(index) } - MenuSeparator {} + Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0} Menu { @@ -135,7 +135,7 @@ Cura.Menu onObjectRemoved: brandMenu.removeMenu(object) } } - onObjectAdded: materialMenu.insertMenu(index, object) + onObjectAdded: materialMenu.insertMenu(index + 4, object) onObjectRemoved: materialMenu.removeMenu(object) } From d7d6918ab73ef1aa51ec55b41efd1a92763b2c6c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Jan 2022 15:01:48 +0100 Subject: [PATCH 047/377] Use CuraMenu so that custom styling is used CURA-8683 --- resources/qml/Menus/ExtensionMenu.qml | 2 +- resources/qml/Menus/FileMenu.qml | 2 +- resources/qml/Menus/PrinterMenu.qml | 4 ++-- resources/qml/Menus/RecentFilesMenu.qml | 4 ++-- resources/qml/Menus/SettingsMenu.qml | 4 ++-- resources/qml/Menus/ViewMenu.qml | 6 +++--- resources/qml/Widgets/Menu.qml | 5 ++++- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml index fe40658e01..3c2d1a79c7 100644 --- a/resources/qml/Menus/ExtensionMenu.qml +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: extensionMenu title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions") diff --git a/resources/qml/Menus/FileMenu.qml b/resources/qml/Menus/FileMenu.qml index f457220d96..f247c91726 100644 --- a/resources/qml/Menus/FileMenu.qml +++ b/resources/qml/Menus/FileMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.1 import UM 1.6 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: base title: catalog.i18nc("@title:menu menubar:toplevel", "&File") diff --git a/resources/qml/Menus/PrinterMenu.qml b/resources/qml/Menus/PrinterMenu.qml index 3b14d9134f..9f0e0575b0 100644 --- a/resources/qml/Menus/PrinterMenu.qml +++ b/resources/qml/Menus/PrinterMenu.qml @@ -7,10 +7,10 @@ import QtQuick.Controls 2.4 import UM 1.6 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: menu - + title: catalog.i18nc("@title:menu menubar:settings", "&Printer") Cura.MenuItem { id: networkEnabledPrinterItem diff --git a/resources/qml/Menus/RecentFilesMenu.qml b/resources/qml/Menus/RecentFilesMenu.qml index 24874c4365..e0b3bfda0c 100644 --- a/resources/qml/Menus/RecentFilesMenu.qml +++ b/resources/qml/Menus/RecentFilesMenu.qml @@ -9,7 +9,7 @@ import Cura 1.0 as Cura import "../Dialogs" -Menu +Cura.Menu { id: menu title: catalog.i18nc("@title:menu menubar:file", "Open &Recent") @@ -20,7 +20,7 @@ Menu Instantiator { model: CuraApplication.recentFiles - MenuItem + Cura.MenuItem { text: { diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 44b329bbdf..e02d146296 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -7,12 +7,12 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: base title: catalog.i18nc("@title:menu menubar:toplevel", "&Settings") - PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") } + PrinterMenu { } property var activeMachine: Cura.MachineManager.activeMachine Instantiator diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index f9a89cbcb7..059455c72c 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -7,12 +7,12 @@ import QtQuick.Controls 2.1 import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: base title: catalog.i18nc("@title:menu menubar:toplevel", "&View") - Menu + Cura.Menu { title: catalog.i18nc("@action:inmenu menubar:view", "&Camera position") Cura.MenuItem { action: Cura.Actions.view3DCamera } @@ -23,7 +23,7 @@ Menu Cura.MenuItem { action: Cura.Actions.viewRightSideCamera } } - Menu + Cura.Menu { id: cameraViewMenu diff --git a/resources/qml/Widgets/Menu.qml b/resources/qml/Widgets/Menu.qml index b727adcb3a..1a6aeff602 100644 --- a/resources/qml/Widgets/Menu.qml +++ b/resources/qml/Widgets/Menu.qml @@ -4,6 +4,7 @@ import QtQuick 2.7 import UM 1.5 as UM +import Cura 1.0 as Cura // // Menu with Cura styling. @@ -15,7 +16,9 @@ UM.Menu implicitWidth: UM.Theme.getSize("setting_control").width - background: Rectangle { + delegate: Cura.MenuItem {} + background: Rectangle + { color: UM.Theme.getColor("setting_control") border.color: UM.Theme.getColor("setting_control_border") } From 3e4c17160370617143d25753c2a4ecbb9114e85c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Jan 2022 11:09:42 +0100 Subject: [PATCH 048/377] Simplify the OpenFilesMenu CURA-8683 --- resources/qml/Menus/OpenFilesMenu.qml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/qml/Menus/OpenFilesMenu.qml b/resources/qml/Menus/OpenFilesMenu.qml index dcce902170..de5ab00c76 100644 --- a/resources/qml/Menus/OpenFilesMenu.qml +++ b/resources/qml/Menus/OpenFilesMenu.qml @@ -20,10 +20,7 @@ Cura.Menu model: CuraApplication.getFileProviderModel() Cura.MenuItem { - text: - { - return model.displayText; - } + text: model.displayText onTriggered: { if (model.index == 0) // The 0th element is the "From Disk" option, which should activate the open local file dialog @@ -35,12 +32,10 @@ Cura.Menu CuraApplication.getFileProviderModel().trigger(model.name); } } - // Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts. - // When there is a single file provider, the openAction is assigned with the Ctrl+O shortcut instead. - shortcut: openFilesMenu.visible ? model.shortcut : "" - visible: openFilesMenu.visible + shortcut: model.shortcut } onObjectAdded: openFilesMenu.insertItem(index, object) + onObjectRemoved: openFilesMenu.removeItem(object) } } From 901f6c4b6318eb7e12c4fc826978eda941f7af0c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Jan 2022 15:06:32 +0100 Subject: [PATCH 049/377] Fix ctrl+shift+s shortcut --- resources/qml/Menus/SaveProjectMenu.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index 1b30546a89..2d59c593c0 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -40,9 +40,7 @@ Cura.Menu UM.OutputDeviceManager.requestWriteToDevice(model.id, PrintInformation.jobName, args) } } - // Unassign the shortcuts when the submenu is invisible (i.e. when there is only one project output device) to avoid ambiguous shortcuts. - // When there is only the LocalFileOutputDevice, the Ctrl+S shortcut is assigned to the saveWorkspaceMenu MenuItem - shortcut: saveProjectMenu.visible ? model.shortcut : "" + shortcut: model.shortcut } onObjectAdded: saveProjectMenu.insertItem(index, object) onObjectRemoved: saveProjectMenu.removeItem(object) From 288aeec2dbfa11f22a35adc5193a029c10d4a4d3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Jan 2022 15:32:27 +0100 Subject: [PATCH 050/377] Disable menuItems if they aren't visible This prevents the shortcuts from breaking --- resources/qml/Menus/FileMenu.qml | 3 ++- resources/qml/Menus/SaveProjectMenu.qml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/FileMenu.qml b/resources/qml/Menus/FileMenu.qml index f247c91726..de5c4bfb90 100644 --- a/resources/qml/Menus/FileMenu.qml +++ b/resources/qml/Menus/FileMenu.qml @@ -25,6 +25,7 @@ Cura.Menu id: openMenu action: Cura.Actions.open visible: base.fileProviderModel.count == 1 + enabled: base.fileProviderModel.count == 1 } OpenFilesMenu @@ -42,7 +43,7 @@ Cura.Menu shortcut: StandardKey.Save text: catalog.i18nc("@title:menu menubar:file", "&Save Project...") visible: saveProjectMenu.model.count == 1 - enabled: UM.WorkspaceFileHandler.enabled + enabled: UM.WorkspaceFileHandler.enabled && saveProjectMenu.model.count == 1 onTriggered: { var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" }; diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index 2d59c593c0..3f43289993 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -41,6 +41,7 @@ Cura.Menu } } shortcut: model.shortcut + enabled: saveProjectMenu.shouldBeVisible } onObjectAdded: saveProjectMenu.insertItem(index, object) onObjectRemoved: saveProjectMenu.removeItem(object) From 70a79c9b5cbea48327ce34fb76f7eec7d803bd1c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 17 Jan 2022 16:36:46 +0100 Subject: [PATCH 051/377] Use custom scroll bar for settings list This is necessary to get the same design working in Controls 2. Contributes to issue CURA-8686. --- resources/qml/Settings/SettingView.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 084d84e883..48c658e4e7 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 @@ -191,6 +191,7 @@ Item } clip: true cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item. + ScrollBar.vertical: UM.ScrollBar {} model: UM.SettingDefinitionsModel { From 10303c10f9c0419df13bd6e26e166eb3e8334c2c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 17 Jan 2022 17:15:23 +0100 Subject: [PATCH 052/377] Use new ScrollBar with controls 2 Contributes to issue CURA-8686. --- .../src/qml/components/BackupList.qml | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/plugins/CuraDrive/src/qml/components/BackupList.qml b/plugins/CuraDrive/src/qml/components/BackupList.qml index a4a460a885..8392792808 100644 --- a/plugins/CuraDrive/src/qml/components/BackupList.qml +++ b/plugins/CuraDrive/src/qml/components/BackupList.qml @@ -1,39 +1,34 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 -import UM 1.1 as UM +import UM 1.5 as UM -ScrollView +ListView { - property alias model: backupList.model - width: parent.width clip: true - ListView + ScrollBar.vertical: UM.ScrollBar {} + + delegate: Item { - id: backupList - width: parent.width - delegate: Item + // Add a margin, otherwise the scrollbar is on top of the right most component + width: parent.width - UM.Theme.getSize("scrollbar").width + height: childrenRect.height + + BackupListItem { - // Add a margin, otherwise the scrollbar is on top of the right most component - width: parent.width - UM.Theme.getSize("default_margin").width - height: childrenRect.height + id: backupListItem + width: parent.width + } - BackupListItem - { - id: backupListItem - width: parent.width - } - - Rectangle - { - id: divider - color: UM.Theme.getColor("lining") - height: UM.Theme.getSize("default_lining").height - } + Rectangle + { + id: divider + color: UM.Theme.getColor("lining") + height: UM.Theme.getSize("default_lining").height } } } From 7bda1336da7a33a9ce86f852165582c9208919f2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 17 Jan 2022 17:54:13 +0100 Subject: [PATCH 053/377] Use new scrollbar with QtControls 2 scroll view A bit confusing that you have to set the parent and position manually, but okay. Contributes to issue CURA-8686. --- resources/qml/Widgets/ScrollableTextArea.qml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml index 6becf75cb1..b9ccc4271b 100644 --- a/resources/qml/Widgets/ScrollableTextArea.qml +++ b/resources/qml/Widgets/ScrollableTextArea.qml @@ -1,10 +1,10 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -13,12 +13,26 @@ import Cura 1.1 as Cura // ScrollView { + id: scrollableTextAreaBase property alias textArea: _textArea property var back_color: UM.Theme.getColor("main_background") property var do_borders: true clip: true + ScrollBar.vertical: UM.ScrollBar + { + parent: scrollableTextAreaBase + anchors + { + right: parent.right + rightMargin: parent.background.border.width + top: parent.top + topMargin: rightMargin + bottom: parent.bottom + bottomMargin: rightMargin + } + } background: Rectangle // Border { From 7f0af55d1d5d6987a36ac4fdbe520759c9eb1e4d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 17 Jan 2022 17:59:45 +0100 Subject: [PATCH 054/377] Fix top and bottom margins These were undefined properties otherwise. Contributes to issue CURA-8686. --- resources/qml/Widgets/ScrollableTextArea.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml index b9ccc4271b..adf81628eb 100644 --- a/resources/qml/Widgets/ScrollableTextArea.qml +++ b/resources/qml/Widgets/ScrollableTextArea.qml @@ -28,9 +28,9 @@ ScrollView right: parent.right rightMargin: parent.background.border.width top: parent.top - topMargin: rightMargin + topMargin: anchors.rightMargin bottom: parent.bottom - bottomMargin: rightMargin + bottomMargin: anchors.rightMargin } } From d4381a6dd0e21bd80e884eea27066ec0f7a46c0f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 17 Jan 2022 19:21:14 +0100 Subject: [PATCH 055/377] Get rid of double scrollbar due to flickable in scrollview The tutorials say it should work, but it doesn't. Now we make the whole thing a flickable with an attached textarea property, which does seem to work. Contributes to issue CURA-8686. --- resources/qml/Widgets/ScrollableTextArea.qml | 51 ++++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml index adf81628eb..c0801651ea 100644 --- a/resources/qml/Widgets/ScrollableTextArea.qml +++ b/resources/qml/Widgets/ScrollableTextArea.qml @@ -11,39 +11,38 @@ import Cura 1.1 as Cura // // Cura-style TextArea with scrolls // -ScrollView +Flickable { id: scrollableTextAreaBase - property alias textArea: _textArea - + property bool do_borders: true property var back_color: UM.Theme.getColor("main_background") - property var do_borders: true + property alias textArea: flickableTextArea - clip: true - ScrollBar.vertical: UM.ScrollBar + ScrollBar.vertical: UM.ScrollBar {} + + TextArea.flickable: TextArea { - parent: scrollableTextAreaBase - anchors + id: flickableTextArea + + background: Rectangle //Providing the background color and border. { - right: parent.right - rightMargin: parent.background.border.width - top: parent.top - topMargin: anchors.rightMargin - bottom: parent.bottom - bottomMargin: anchors.rightMargin + anchors + { + top: parent.top + topMargin: -border.width + bottom: parent.bottom + bottomMargin: -border.width + left: parent.left + leftMargin: -border.width + right: parent.right + rightMargin: -border.width + } + + color: scrollableTextAreaBase.back_color + border.color: UM.Theme.getColor("thick_lining") + border.width: scrollableTextAreaBase.do_borders ? UM.Theme.getSize("default_lining").width : 0 } - } - background: Rectangle // Border - { - color: back_color - border.color: UM.Theme.getColor("thick_lining") - border.width: do_borders ? UM.Theme.getSize("default_lining").width : 0 - } - - TextArea - { - id: _textArea font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") textFormat: TextEdit.PlainText @@ -51,4 +50,4 @@ ScrollView wrapMode: Text.Wrap selectByMouse: true } -} +} \ No newline at end of file From f630b847886f60fffca4fe5c73c9927839f0da9d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 14:45:43 +0100 Subject: [PATCH 056/377] Replace ScrollView with QtControls2 ListView I can't update the buttons (not part of this ticket) so I kept those Controls1. The ScrollView is no longer necessary, just a ListView now with customised scroll bar. Contributes to issue CURA-8686. --- .../PerObjectSettingsPanel.qml | 321 +++++++++--------- 1 file changed, 160 insertions(+), 161 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index c97989c449..098876e368 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -1,9 +1,10 @@ -// Copyright (c) 2021 Ultimaker B.V. -// Uranium is released under the terms of the LGPLv3 or higher. +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 1.2 as OldControls import QtQuick.Controls.Styles 1.2 +import QtQuick.Controls 2.15 import UM 1.5 as UM import Cura 1.0 as Cura @@ -76,7 +77,7 @@ Item id: meshTypeButtons spacing: UM.Theme.getSize("default_margin").width - Button + OldControls.Button { id: normalButton text: catalog.i18nc("@label", "Normal model") @@ -88,7 +89,7 @@ Item z: 4 } - Button + OldControls.Button { id: supportMeshButton text: catalog.i18nc("@label", "Print as support") @@ -100,7 +101,7 @@ Item z: 3 } - Button + OldControls.Button { id: overlapMeshButton text: catalog.i18nc("@label", "Modify settings for overlaps") @@ -112,7 +113,7 @@ Item z: 2 } - Button + OldControls.Button { id: antiOverhangMeshButton text: catalog.i18nc("@label", "Don't support overlaps") @@ -179,189 +180,187 @@ Item height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight) visible: currentMeshType != "anti_overhang_mesh" - ScrollView + ListView { + id: contents height: parent.height width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width - style: UM.Theme.styles.scrollview - ListView + ScrollBar.vertical: UM.ScrollBar {} + clip: true + spacing: UM.Theme.getSize("default_lining").height + + model: UM.SettingDefinitionsModel { - id: contents - spacing: UM.Theme.getSize("default_lining").height - - model: UM.SettingDefinitionsModel + id: addedSettingsModel + containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" + expanded: [ "*" ] + filter: { - id: addedSettingsModel - containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" - expanded: [ "*" ] - filter: + if (printSequencePropertyProvider.properties.value == "one_at_a_time") { - if (printSequencePropertyProvider.properties.value == "one_at_a_time") + return {"settable_per_meshgroup": true} + } + return {"settable_per_mesh": true} + } + exclude: + { + var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ] + + if (currentMeshType == "support_mesh") + { + excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport) + } + return excluded_settings + } + + visibilityHandler: Cura.PerObjectSettingVisibilityHandler + { + id: visibility_handler + selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId") + } + + // For some reason the model object is updated after removing him from the memory and + // it happens only on Windows. For this reason, set the destroyed value manually. + Component.onDestruction: + { + setDestroyed(true) + } + } + + delegate: Row + { + spacing: - UM.Theme.getSize("default_margin").width + Loader + { + id: settingLoader + width: UM.Theme.getSize("setting").width + height: UM.Theme.getSize("section").height + enabled: provider.properties.enabled === "True" + property var definition: model + property var settingDefinitionsModel: addedSettingsModel + property var propertyProvider: provider + property var globalPropertyProvider: inheritStackProvider + property var externalResetHandler: false + + //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 + //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, + //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely. + asynchronous: model.type != "enum" && model.type != "extruder" + + onLoaded: + { + settingLoader.item.showRevertButton = false + settingLoader.item.showInheritButton = false + settingLoader.item.showLinkedSettingIcon = false + settingLoader.item.doDepthIndentation = false + settingLoader.item.doQualityUserSettingEmphasis = false + } + + sourceComponent: + { + switch(model.type) { - return {"settable_per_meshgroup": true} + case "int": + return settingTextField + case "[int]": + return settingTextField + case "float": + return settingTextField + case "enum": + return settingComboBox + case "extruder": + return settingExtruder + case "optional_extruder": + return settingOptionalExtruder + case "bool": + return settingCheckBox + case "str": + return settingTextField + case "category": + return settingCategory + default: + return settingUnknown } - return {"settable_per_mesh": true} - } - exclude: - { - var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ] - - if (currentMeshType == "support_mesh") - { - excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport) - } - return excluded_settings - } - - visibilityHandler: Cura.PerObjectSettingVisibilityHandler - { - id: visibility_handler - selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId") - } - - // For some reason the model object is updated after removing him from the memory and - // it happens only on Windows. For this reason, set the destroyed value manually. - Component.onDestruction: - { - setDestroyed(true) } } - delegate: Row + OldControls.Button { - spacing: - UM.Theme.getSize("default_margin").width - Loader + width: Math.round(UM.Theme.getSize("setting").height / 2) + height: UM.Theme.getSize("setting").height + + onClicked: addedSettingsModel.setVisible(model.key, false) + + style: ButtonStyle { - id: settingLoader - width: UM.Theme.getSize("setting").width - height: UM.Theme.getSize("section").height - enabled: provider.properties.enabled === "True" - property var definition: model - property var settingDefinitionsModel: addedSettingsModel - property var propertyProvider: provider - property var globalPropertyProvider: inheritStackProvider - property var externalResetHandler: false - - //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 - //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, - //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely. - asynchronous: model.type != "enum" && model.type != "extruder" - - onLoaded: + background: Item { - settingLoader.item.showRevertButton = false - settingLoader.item.showInheritButton = false - settingLoader.item.showLinkedSettingIcon = false - settingLoader.item.doDepthIndentation = false - settingLoader.item.doQualityUserSettingEmphasis = false - } - - sourceComponent: - { - switch(model.type) + UM.RecolorImage { - case "int": - return settingTextField - case "[int]": - return settingTextField - case "float": - return settingTextField - case "enum": - return settingComboBox - case "extruder": - return settingExtruder - case "optional_extruder": - return settingOptionalExtruder - case "bool": - return settingCheckBox - case "str": - return settingTextField - case "category": - return settingCategory - default: - return settingUnknown + anchors.verticalCenter: parent.verticalCenter + width: parent.width + height: 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") } } } + } - Button + // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events + // so we bypass that to make a dedicated provider). + UM.SettingPropertyProvider + { + id: provider + + containerStackId: UM.ActiveTool.properties.getValue("ContainerID") + key: model.key + watchedProperties: [ "value", "enabled", "validationState" ] + storeIndex: 0 + removeUnusedValue: false + } + + UM.SettingPropertyProvider + { + id: inheritStackProvider + containerStackId: UM.ActiveTool.properties.getValue("ContainerID") + key: model.key + watchedProperties: [ "limit_to_extruder" ] + } + + Connections + { + target: inheritStackProvider + function onPropertiesChanged() { provider.forcePropertiesChanged() } + } + + Connections + { + target: UM.ActiveTool + function onPropertiesChanged() { - width: Math.round(UM.Theme.getSize("setting").height / 2) - height: UM.Theme.getSize("setting").height - - onClicked: addedSettingsModel.setVisible(model.key, false) - - style: ButtonStyle + // the values cannot be bound with UM.ActiveTool.properties.getValue() calls, + // so here we connect to the signal and update the those values. + if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined") { - background: Item + const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId") + if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId) { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - width: parent.width - height: 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") - } + addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId } } - } - - // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events - // so we bypass that to make a dedicated provider). - UM.SettingPropertyProvider - { - id: provider - - containerStackId: UM.ActiveTool.properties.getValue("ContainerID") - key: model.key - watchedProperties: [ "value", "enabled", "validationState" ] - storeIndex: 0 - removeUnusedValue: false - } - - UM.SettingPropertyProvider - { - id: inheritStackProvider - containerStackId: UM.ActiveTool.properties.getValue("ContainerID") - key: model.key - watchedProperties: [ "limit_to_extruder" ] - } - - Connections - { - target: inheritStackProvider - function onPropertiesChanged() { provider.forcePropertiesChanged() } - } - - Connections - { - target: UM.ActiveTool - function onPropertiesChanged() + if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined") { - // the values cannot be bound with UM.ActiveTool.properties.getValue() calls, - // so here we connect to the signal and update the those values. - if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined") + const containerId = UM.ActiveTool.properties.getValue("ContainerID") + if (provider.containerStackId != containerId) { - const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId") - if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId) - { - addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId - } + provider.containerStackId = containerId } - if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined") + if (inheritStackProvider.containerStackId != containerId) { - const containerId = UM.ActiveTool.properties.getValue("ContainerID") - if (provider.containerStackId != containerId) - { - provider.containerStackId = containerId - } - if (inheritStackProvider.containerStackId != containerId) - { - inheritStackProvider.containerStackId = containerId - } + inheritStackProvider.containerStackId = containerId } } } From 954a3cb1db5c61ff5688286ee128bcb6f8fa8fea Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 14:54:36 +0100 Subject: [PATCH 057/377] Replace ScrollView by ListView in settings picking dialogue The ScrollView is no longer necessary in Controls2. Just have a ListView with customised scrollbar. Contributes to issue CURA-8686. --- .../SettingPickDialog.qml | 90 ++++++++++--------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 18f36b2651..8ea1a774a4 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -1,7 +1,10 @@ -import QtQuick 2.2 -import QtQuick.Controls 1.2 +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. -import UM 1.2 as UM +import QtQuick 2.2 +import QtQuick.Controls 2.2 + +import UM 1.5 as UM import Cura 1.0 as Cura import ".." @@ -67,10 +70,9 @@ UM.Dialog text: catalog.i18nc("@label:checkbox", "Show all") } - ScrollView - { - id: scrollView - + ListView + { + id: listview anchors { top: filterInput.bottom @@ -78,47 +80,47 @@ UM.Dialog right: parent.right bottom: parent.bottom } - ListView + + ScrollBar.vertical: UM.ScrollBar {} + clip: true + + model: UM.SettingDefinitionsModel { - id: listview - model: UM.SettingDefinitionsModel + id: definitionsModel + containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" + visibilityHandler: UM.SettingPreferenceVisibilityHandler {} + expanded: [ "*" ] + exclude: { - id: definitionsModel - containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" - visibilityHandler: UM.SettingPreferenceVisibilityHandler {} - expanded: [ "*" ] - exclude: - { - var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ] - excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings) - return excluded_settings - } - showAll: toggleShowAll.checked || filterInput.text !== "" + var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ] + excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings) + return excluded_settings } - delegate: Loader - { - id: loader - - width: listview.width - height: model.type != undefined ? UM.Theme.getSize("section").height : 0 - - property var definition: model - property var settingDefinitionsModel: definitionsModel - - asynchronous: true - source: - { - switch(model.type) - { - case "category": - return "PerObjectCategory.qml" - default: - return "PerObjectItem.qml" - } - } - } - Component.onCompleted: settingPickDialog.updateFilter() + showAll: toggleShowAll.checked || filterInput.text !== "" } + delegate: Loader + { + id: loader + + width: listview.width + height: model.type != undefined ? UM.Theme.getSize("section").height : 0 + + property var definition: model + property var settingDefinitionsModel: definitionsModel + + asynchronous: true + source: + { + switch(model.type) + { + case "category": + return "PerObjectCategory.qml" + default: + return "PerObjectItem.qml" + } + } + } + Component.onCompleted: settingPickDialog.updateFilter() } rightButtons: [ From ca3f29daf72fb35afa500961b4cb4155251afa93 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 15:14:29 +0100 Subject: [PATCH 058/377] Use ListView for settings list in post-processing scripts With the customised scroll bar. Contributes to issue CURA-8686. --- .../PostProcessingPlugin.qml | 208 +++++++++--------- 1 file changed, 103 insertions(+), 105 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index afafa432b5..489254e310 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2015 Jaime van Kessel, Ultimaker B.V. +// Copyright (c) 2022 Jaime van Kessel, Ultimaker B.V. // The PostProcessingPlugin is released under the terms of the AGPLv3 or higher. import QtQuick 2.2 @@ -8,7 +8,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura UM.Dialog @@ -275,9 +275,9 @@ UM.Dialog color: UM.Theme.getColor("text") } - ScrollView + ListView { - id: scrollView + id: listview anchors { top: scriptSpecsHeader.bottom @@ -288,123 +288,121 @@ UM.Dialog bottom: parent.bottom } + ScrollBar.vertical: UM.ScrollBar {} + clip: true visible: manager.selectedScriptDefinitionId != "" + spacing: UM.Theme.getSize("default_lining").height - ListView + model: UM.SettingDefinitionsModel { - id: listview - spacing: UM.Theme.getSize("default_lining").height - model: UM.SettingDefinitionsModel - { - id: definitionsModel - containerId: manager.selectedScriptDefinitionId - showAll: true - } + id: definitionsModel + containerId: manager.selectedScriptDefinitionId + showAll: true + } - delegate: Loader - { - id: settingLoader + delegate: Loader + { + id: settingLoader - width: parent.width - height: + width: listview.width + height: + { + if(provider.properties.enabled == "True") { - if(provider.properties.enabled == "True") + if(model.type != undefined) { - if(model.type != undefined) - { - return UM.Theme.getSize("section").height - } - else - { - return 0 - } + return UM.Theme.getSize("section").height } else { return 0 } } - Behavior on height { NumberAnimation { duration: 100 } } - opacity: provider.properties.enabled == "True" ? 1 : 0 - - Behavior on opacity { NumberAnimation { duration: 100 } } - enabled: opacity > 0 - - property var definition: model - property var settingDefinitionsModel: definitionsModel - property var propertyProvider: provider - property var globalPropertyProvider: inheritStackProvider - - //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 - //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, - //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely. - asynchronous: model.type != "enum" && model.type != "extruder" - - onLoaded: + else { - settingLoader.item.showRevertButton = false - settingLoader.item.showInheritButton = false - settingLoader.item.showLinkedSettingIcon = false - settingLoader.item.doDepthIndentation = false - settingLoader.item.doQualityUserSettingEmphasis = false + return 0 + } + } + Behavior on height { NumberAnimation { duration: 100 } } + opacity: provider.properties.enabled == "True" ? 1 : 0 + + Behavior on opacity { NumberAnimation { duration: 100 } } + enabled: opacity > 0 + + property var definition: model + property var settingDefinitionsModel: definitionsModel + property var propertyProvider: provider + property var globalPropertyProvider: inheritStackProvider + + //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 + //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, + //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely. + asynchronous: model.type != "enum" && model.type != "extruder" + + onLoaded: + { + settingLoader.item.showRevertButton = false + settingLoader.item.showInheritButton = false + settingLoader.item.showLinkedSettingIcon = false + settingLoader.item.doDepthIndentation = false + settingLoader.item.doQualityUserSettingEmphasis = false + } + + sourceComponent: + { + switch(model.type) + { + case "int": + return settingTextField + case "float": + return settingTextField + case "enum": + return settingComboBox + case "extruder": + return settingExtruder + case "bool": + return settingCheckBox + case "str": + return settingTextField + case "category": + return settingCategory + default: + return settingUnknown + } + } + + UM.SettingPropertyProvider + { + id: provider + containerStackId: manager.selectedScriptStackId + key: model.key ? model.key : "None" + watchedProperties: [ "value", "enabled", "state", "validationState" ] + storeIndex: 0 + } + + // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events + // so we bypass that to make a dedicated provider). + UM.SettingPropertyProvider + { + id: inheritStackProvider + containerStack: Cura.MachineManager.activeMachine + key: model.key ? model.key : "None" + watchedProperties: [ "limit_to_extruder" ] + } + + Connections + { + target: item + + function onShowTooltip(text) + { + tooltip.text = text + var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0) + tooltip.show(position) + tooltip.target.x = position.x + 1 } - sourceComponent: - { - switch(model.type) - { - case "int": - return settingTextField - case "float": - return settingTextField - case "enum": - return settingComboBox - case "extruder": - return settingExtruder - case "bool": - return settingCheckBox - case "str": - return settingTextField - case "category": - return settingCategory - default: - return settingUnknown - } - } - - UM.SettingPropertyProvider - { - id: provider - containerStackId: manager.selectedScriptStackId - key: model.key ? model.key : "None" - watchedProperties: [ "value", "enabled", "state", "validationState" ] - storeIndex: 0 - } - - // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events - // so we bypass that to make a dedicated provider). - UM.SettingPropertyProvider - { - id: inheritStackProvider - containerStack: Cura.MachineManager.activeMachine - key: model.key ? model.key : "None" - watchedProperties: [ "limit_to_extruder" ] - } - - Connections - { - target: item - - function onShowTooltip(text) - { - tooltip.text = text - var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0) - tooltip.show(position) - tooltip.target.x = position.x + 1 - } - - function onHideTooltip() { tooltip.hide() } - } + function onHideTooltip() { tooltip.hide() } } } } From d87551ac9cd82f910f993cd52ceb4fabcef4f783 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 17:01:16 +0100 Subject: [PATCH 059/377] Use Controls2 ListView instead of Controls1 ScrollView to scroll Just a listview with a specialised scroll bar. Contributes to issue CURA-8686. --- .../resources/qml/DiscoverUM3Action.qml | 82 +++++++++---------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index a690a1b2cb..30d3db0715 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -1,7 +1,7 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.5 as Cura import QtQuick 2.2 @@ -109,53 +109,51 @@ Cura.MachineAction width: Math.round(parent.width * 0.5) spacing: UM.Theme.getSize("default_margin").height - ScrollView + ListView { - id: objectListContainer + id: listview width: parent.width height: base.height - contentRow.y - discoveryTip.height - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ListView - { - id: listview - model: manager.foundDevices - width: parent.width - currentIndex: -1 - onCurrentIndexChanged: - { - base.selectedDevice = listview.model[currentIndex]; - // Only allow connecting if the printer has responded to API query since the last refresh - base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true"; - } - Component.onCompleted: manager.startDiscovery() - delegate: Rectangle - { - height: printNameLabel.height - color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase - width: listview.width - Label - { - id: printNameLabel - height: contentHeight - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.right: parent.right - text: listview.model[index].name - color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text - elide: Text.ElideRight - renderType: Text.NativeRendering - } - MouseArea + ScrollBar.vertical: UM.ScrollBar {} + clip: true + + model: manager.foundDevices + currentIndex: -1 + onCurrentIndexChanged: + { + base.selectedDevice = listview.model[currentIndex]; + // Only allow connecting if the printer has responded to API query since the last refresh + base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true"; + } + Component.onCompleted: manager.startDiscovery() + delegate: Rectangle + { + height: printNameLabel.height + color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase + width: listview.width + Label + { + id: printNameLabel + height: contentHeight + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.right: parent.right + text: listview.model[index].name + color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text + elide: Text.ElideRight + renderType: Text.NativeRendering + } + + MouseArea + { + anchors.fill: parent; + onClicked: { - anchors.fill: parent; - onClicked: + if(!parent.ListView.isCurrentItem) { - if(!parent.ListView.isCurrentItem) - { - parent.ListView.view.currentIndex = index; - } + parent.ListView.view.currentIndex = index; } } } From dbb2bce15719dfe20b4f304fe5591494ea20fcf4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 17:19:52 +0100 Subject: [PATCH 060/377] Fix icon name with Controls 2 action The text above this icon name got changed in master, which led to a minor merge conflict here that wasn't discovered. --- resources/qml/Actions.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index effbf1bea3..4e2a05a6aa 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -480,6 +480,6 @@ Item { id: browsePackagesAction text: "&Marketplace" - iconName: "plugins_browse" + icon.name: "plugins_browse" } } From 85d0749f5f77e280b0ecaeac5bf2f8eff03c1a8c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 17:27:51 +0100 Subject: [PATCH 061/377] Use Controls2 ListView instead of ScrollView for print job list No need for a ScrollView in Controls 2. And specialise the scroll bar. Be sure to also align the right side of the contents with the scroll bar though. Contributes to issue CURA-8686. --- .../resources/qml/MonitorQueue.qml | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index 44d8f80bb3..87b7cab83e 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.15 import UM 1.5 as UM import Cura 1.0 as Cura @@ -22,7 +22,7 @@ Item id: queuedLabel anchors { - left: queuedPrintJobs.left + left: printJobList.left top: parent.top } font: UM.Theme.getFont("large") @@ -34,7 +34,7 @@ Item id: manageQueueLabel anchors { - right: queuedPrintJobs.right + right: printJobList.right verticalCenter: queuedLabel.verticalCenter } height: 18 * screenScaleFactor // TODO: Theme! @@ -78,7 +78,7 @@ Item id: printJobQueueHeadings anchors { - left: queuedPrintJobs.left + left: printJobList.left leftMargin: UM.Theme.getSize("narrow_margin").width top: queuedLabel.bottom topMargin: 24 * screenScaleFactor // TODO: Theme! @@ -121,41 +121,42 @@ Item } } - ScrollView + ListView { - id: queuedPrintJobs + id: printJobList anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter top: printJobQueueHeadings.bottom - topMargin: 12 * screenScaleFactor // TODO: Theme! + topMargin: UM.Theme.getSize("default_margin").width } - style: UM.Theme.styles.scrollview width: parent.width - ListView + ScrollBar.vertical: UM.ScrollBar { - id: printJobList - anchors.fill: parent - delegate: MonitorPrintJobCard + id: printJobScrollBar + } + spacing: UM.Theme.getSize("narrow_margin").width + clip: true + + delegate: MonitorPrintJobCard + { + anchors { - anchors - { - left: parent.left - right: parent.right - } - printJob: modelData + left: parent.left + right: parent.right + rightMargin: printJobScrollBar.width } - model: + printJob: modelData + } + model: + { + if (OutputDevice.receivedData) { - if (OutputDevice.receivedData) - { - return OutputDevice.queuedPrintJobs - } - return [null, null] + return OutputDevice.queuedPrintJobs } - spacing: 6 // TODO: Theme! + return [null, null] } } } From c605b45b7c4c54ca7450aa8a77c7cb4dd19f33ac Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 17:51:37 +0100 Subject: [PATCH 062/377] Use styled scroll bar, and no ScrollView Make sure the text aligns next to the scrollbar instead of behind it, too. Contributes to issue CURA-8686. --- resources/qml/Dialogs/AboutDialog.qml | 134 +++++++++++++------------- 1 file changed, 66 insertions(+), 68 deletions(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index 1936dc9047..e2a89ece59 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -5,7 +5,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.9 import QtQuick.Window 2.1 -import UM 1.1 as UM +import UM 1.5 as UM UM.Dialog { @@ -89,81 +89,79 @@ UM.Dialog anchors.topMargin: UM.Theme.getSize("default_margin").height } - ScrollView + ListView { - id: credits + id: projectsList anchors.top: creditsNotes.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - width: parent.width height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height) - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ListView + + ScrollBar.vertical: UM.ScrollBar { - id: projectsList + id: projectsListScrollBar + } - width: parent.width + delegate: Row + { + spacing: UM.Theme.getSize("narrow_margin").width + Label + { + text: "%2".arg(model.url).arg(model.name) + width: (projectsList.width * 0.25) | 0 + elide: Text.ElideRight + onLinkActivated: Qt.openUrlExternally(link) + } + Label + { + text: model.description + elide: Text.ElideRight + width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width + } + Label + { + text: model.license + elide: Text.ElideRight + width: (projectsList.width * 0.15) | 0 + } + } + model: ListModel + { + id: projectsModel + } + Component.onCompleted: + { + projectsModel.append({ name: "Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" }); + projectsModel.append({ name: "Uranium", description: catalog.i18nc("@label", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" }); + projectsModel.append({ name: "CuraEngine", description: catalog.i18nc("@label", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" }); + projectsModel.append({ name: "libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" }); - delegate: Row - { - Label - { - text: "%2".arg(model.url).arg(model.name) - width: (projectsList.width * 0.25) | 0 - elide: Text.ElideRight - onLinkActivated: Qt.openUrlExternally(link) - } - Label - { - text: model.description - elide: Text.ElideRight - width: (projectsList.width * 0.6) | 0 - } - Label - { - text: model.license - elide: Text.ElideRight - width: (projectsList.width * 0.15) | 0 - } - } - model: ListModel - { - id: projectsModel - } - Component.onCompleted: - { - projectsModel.append({ name: "Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" }); - projectsModel.append({ name: "Uranium", description: catalog.i18nc("@label", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" }); - projectsModel.append({ name: "CuraEngine", description: catalog.i18nc("@label", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" }); - projectsModel.append({ name: "libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" }); - - projectsModel.append({ name: "Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" }); - projectsModel.append({ name: "Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" }); - projectsModel.append({ name: "PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" }); - projectsModel.append({ name: "SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" }); - projectsModel.append({ name: "Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" }); - projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" }); - projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" }); - projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" }); - projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" }); - projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" }); - projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" }); - projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" }); - projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" }); - projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" }); - projectsModel.append({ name: "Pyclipper", description: catalog.i18nc("@label", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" }); - projectsModel.append({ name: "mypy", description: catalog.i18nc("@Label", "Static type checker for Python"), license: "MIT", url: "http://mypy-lang.org/" }); - projectsModel.append({ name: "certifi", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" }); - projectsModel.append({ name: "cryptography", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" }); - projectsModel.append({ name: "Sentry", description: catalog.i18nc("@Label", "Python Error tracking library"), license: "BSD 2-Clause 'Simplified'", url: "https://sentry.io/for/python/" }); - projectsModel.append({ name: "libnest2d", description: catalog.i18nc("@label", "Polygon packing library, developed by Prusa Research"), license: "LGPL", url: "https://github.com/tamasmeszaros/libnest2d" }); - projectsModel.append({ name: "pynest2d", description: catalog.i18nc("@label", "Python bindings for libnest2d"), license: "LGPL", url: "https://github.com/Ultimaker/pynest2d" }); - projectsModel.append({ name: "keyring", description: catalog.i18nc("@label", "Support library for system keyring access"), license: "MIT", url: "https://github.com/jaraco/keyring" }); - projectsModel.append({ name: "pywin32", description: catalog.i18nc("@label", "Python extensions for Microsoft Windows"), license: "PSF", url: "https://github.com/mhammond/pywin32" }); - projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" }); - projectsModel.append({ name: "Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" }); - projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" }); - } + projectsModel.append({ name: "Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" }); + projectsModel.append({ name: "Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" }); + projectsModel.append({ name: "PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" }); + projectsModel.append({ name: "SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" }); + projectsModel.append({ name: "Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" }); + projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" }); + projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" }); + projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" }); + projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" }); + projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" }); + projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" }); + projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" }); + projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" }); + projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" }); + projectsModel.append({ name: "Pyclipper", description: catalog.i18nc("@label", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" }); + projectsModel.append({ name: "mypy", description: catalog.i18nc("@Label", "Static type checker for Python"), license: "MIT", url: "http://mypy-lang.org/" }); + projectsModel.append({ name: "certifi", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" }); + projectsModel.append({ name: "cryptography", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" }); + projectsModel.append({ name: "Sentry", description: catalog.i18nc("@Label", "Python Error tracking library"), license: "BSD 2-Clause 'Simplified'", url: "https://sentry.io/for/python/" }); + projectsModel.append({ name: "libnest2d", description: catalog.i18nc("@label", "Polygon packing library, developed by Prusa Research"), license: "LGPL", url: "https://github.com/tamasmeszaros/libnest2d" }); + projectsModel.append({ name: "pynest2d", description: catalog.i18nc("@label", "Python bindings for libnest2d"), license: "LGPL", url: "https://github.com/Ultimaker/pynest2d" }); + projectsModel.append({ name: "keyring", description: catalog.i18nc("@label", "Support library for system keyring access"), license: "MIT", url: "https://github.com/jaraco/keyring" }); + projectsModel.append({ name: "pywin32", description: catalog.i18nc("@label", "Python extensions for Microsoft Windows"), license: "PSF", url: "https://github.com/mhammond/pywin32" }); + projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" }); + projectsModel.append({ name: "Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" }); + projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" }); } } From 1cc3aecd8cf60c957071fd1dca61d4df3a4465c4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 17:56:31 +0100 Subject: [PATCH 063/377] Use correct scrollbar and clip contents We've not been clipping this for so long, but the text really does overlap with the label and the buttons if we don't (and the text is sufficiently large). Contributes to issue CURA-8686. --- .../qml/Dialogs/WorkspaceSummaryDialog.qml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 1e03a35d0a..5278168a77 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -6,7 +6,7 @@ import QtQuick.Controls 2.9 import QtQuick.Layouts 1.3 import QtQuick.Window 2.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura UM.Dialog @@ -81,6 +81,19 @@ UM.Dialog bottom: controls.top bottomMargin: UM.Theme.getSize("default_margin").height } + + ScrollBar.vertical: UM.ScrollBar + { + parent: scroll + anchors + { + top: parent.top + right: parent.right + bottom: parent.bottom + } + } + clip: true + ColumnLayout { spacing: UM.Theme.getSize("default_margin").height From ae81b5e3e70603b72a0a95efc969614cea63da13 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 18:13:13 +0100 Subject: [PATCH 064/377] Fix flickable with custom scrollbar A bit of a hassle with the scrollbar overlapping the background here. Contributes to issue CURA-8686. --- .../qml/MachineSettings/GcodeTextArea.qml | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/resources/qml/MachineSettings/GcodeTextArea.qml b/resources/qml/MachineSettings/GcodeTextArea.qml index f8bd02de3b..5292b4f83a 100644 --- a/resources/qml/MachineSettings/GcodeTextArea.qml +++ b/resources/qml/MachineSettings/GcodeTextArea.qml @@ -1,11 +1,11 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -45,7 +45,7 @@ UM.TooltipArea renderType: Text.NativeRendering } - ScrollView + Flickable { anchors.top: titleLabel.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height @@ -53,26 +53,9 @@ UM.TooltipArea anchors.left: parent.left anchors.right: parent.right - background: Rectangle - { - color: UM.Theme.getColor("main_background") - anchors.fill: parent + ScrollBar.vertical: UM.ScrollBar {} - border.color: - { - if (!gcodeTextArea.enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - if (gcodeTextArea.hovered || gcodeTextArea.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") - } - } - - TextArea + TextArea.flickable: TextArea { id: gcodeTextArea @@ -92,6 +75,27 @@ UM.TooltipArea propertyProvider.setPropertyValue("value", text) } } + + background: Rectangle + { + color: UM.Theme.getColor("main_background") + anchors.fill: parent + anchors.margins: -border.width //Wrap the border around the parent. + + border.color: + { + if (!gcodeTextArea.enabled) + { + return UM.Theme.getColor("setting_control_disabled_border") + } + if (gcodeTextArea.hovered || gcodeTextArea.activeFocus) + { + return UM.Theme.getColor("setting_control_border_highlight") + } + return UM.Theme.getColor("setting_control_border") + } + border.width: UM.Theme.getSize("default_lining").width + } } } } From 7a1578cbc4858da485a52de7c4173792867de2cb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 18:22:49 +0100 Subject: [PATCH 065/377] Re-use component scrollbar from Uranium It's a new component so that we don't have to re-implement it everywhere. In this case we do have to anchor it correctly though because ScrollView doesn't do that by itself. Contributes to issue CURA-8686. --- .../ConfigurationListView.qml | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index de70b0e0f4..1867ed6a4a 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -1,10 +1,10 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -67,18 +67,14 @@ Item contentHeight: configurationList.height clip: true - ScrollBar.vertical.policy: (configurationList.height > maximumHeight) ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff //The AsNeeded policy also hides it when the cursor is away, and we don't want that. - ScrollBar.vertical.background: Rectangle - { - implicitWidth: UM.Theme.getSize("scrollbar").width - radius: width / 2 - color: UM.Theme.getColor("scrollbar_background") - } - ScrollBar.vertical.contentItem: Rectangle - { - implicitWidth: UM.Theme.getSize("scrollbar").width - radius: width / 2 - color: UM.Theme.getColor(parent.pressed ? "scrollbar_handle_down" : parent.hovered ? "scrollbar_handle_hover" : "scrollbar_handle") + ScrollBar.vertical: UM.ScrollBar { + parent: container + anchors + { + top: parent.top + right: parent.right + bottom: parent.bottom + } } ButtonGroup From 4614b3a9e1a2daf54d2eea77389b3b65a364db9d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 18:37:34 +0100 Subject: [PATCH 066/377] Use new ListView instead of ScrollView, with correct scrollbar I also fixed an undefined reference for whether a button needed to be enabled, if no profile was selected yet. The button was invisible if it was undefined, but it was still giving QML warnings. Contributes to issue CURA-8686. --- resources/qml/Preferences/ProfilesPage.qml | 53 +++++++++++----------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 9144d4dbe1..72bd2df00f 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -1,12 +1,13 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.15 +import QtQuick.Controls 1.4 as OldControls import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.6 as Cura @@ -78,7 +79,7 @@ Item height: childrenRect.height // Activate button - Button + OldControls.Button { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate") @@ -98,7 +99,7 @@ Item } // Create button - Button + OldControls.Button { id: createMenuButton text: catalog.i18nc("@label", "Create") @@ -115,7 +116,7 @@ Item } // Duplicate button - Button + OldControls.Button { id: duplicateMenuButton text: catalog.i18nc("@label", "Duplicate") @@ -132,7 +133,7 @@ Item } // Remove button - Button + OldControls.Button { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove") @@ -146,7 +147,7 @@ Item } // Rename button - Button + OldControls.Button { id: renameMenuButton text: catalog.i18nc("@action:button", "Rename") @@ -161,7 +162,7 @@ Item } // Import button - Button + OldControls.Button { id: importMenuButton text: catalog.i18nc("@action:button", "Import") @@ -173,7 +174,7 @@ Item } // Export button - Button + OldControls.Button { id: exportMenuButton text: catalog.i18nc("@action:button", "Export") @@ -397,13 +398,13 @@ Item } visible: text != "" text: catalog.i18nc("@label %1 is printer name", "Printer: %1").arg(Cura.MachineManager.activeMachine.name) - width: profileScrollView.width + width: profileBackground.width elide: Text.ElideRight } - ScrollView + Rectangle { - id: profileScrollView + id: profileBackground anchors { top: captionLabel.visible ? captionLabel.bottom : parent.top @@ -411,22 +412,20 @@ Item bottom: parent.bottom left: parent.left } + width: (parent.width * 0.4) | 0 - Rectangle - { - parent: viewport - anchors.fill: parent - color: palette.light - } - - width: true ? (parent.width * 0.4) | 0 : parent.width - frameVisible: true - clip: true + color: palette.light ListView { id: qualityListView + anchors.fill: parent + ScrollBar.vertical: UM.ScrollBar + { + id: profileScrollBar + } + clip: true model: base.qualityManagementModel Component.onCompleted: @@ -461,7 +460,7 @@ Item delegate: Rectangle { - width: profileScrollView.width + width: profileBackground.width - profileScrollBar.width height: childrenRect.height // Added this property to identify custom profiles in automated system tests (Squish) @@ -513,7 +512,7 @@ Item anchors { - left: profileScrollView.right + left: profileBackground.right leftMargin: UM.Theme.getSize("default_margin").width top: parent.top bottom: parent.bottom @@ -555,7 +554,7 @@ Item Button { text: catalog.i18nc("@action:button", "Update profile with current settings/overrides") - enabled: Cura.MachineManager.hasUserSettings && !base.currentItem.is_read_only + enabled: Cura.MachineManager.hasUserSettings && qualityListView.currentItem && !qualityListView.currentItem.is_read_only onClicked: Cura.ContainerManager.updateQualityChanges() } @@ -594,7 +593,7 @@ Item } } - TabView + OldControls.TabView { anchors.left: parent.left anchors.top: profileNotices.visible ? profileNotices.bottom : profileNotices.anchors.top From bb32f25b496d2b1eeefcefd89dedfc060fbda8f3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 18:43:27 +0100 Subject: [PATCH 067/377] Replace old ScrollView with new ListView I also swapped out the old NewControls import to just be the actual Controls, and used OldControls to import the Controls1 module. This is consistent with the rest of the code base as far as I could find. Contributes to issue CURA-8686. --- .../qml/Preferences/SettingVisibilityPage.qml | 86 +++++++++---------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index d2fd5c7e94..dcd5c154d9 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -1,13 +1,11 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.15 +import QtQuick.Controls 1.1 as OldControls -import QtQuick.Controls 2.3 as NewControls - -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -36,7 +34,7 @@ UM.PreferencesPage id: base; anchors.fill: parent; - CheckBox + OldControls.CheckBox { id: toggleVisibleSettings anchors @@ -98,7 +96,7 @@ UM.PreferencesPage onTextChanged: definitionsModel.filter = {"i18n_label|i18n_description": "*" + text} } - NewControls.ComboBox + ComboBox { id: visibilityPreset width: 150 * screenScaleFactor @@ -106,7 +104,7 @@ UM.PreferencesPage { top: parent.top right: parent.right - bottom: scrollView.top + bottom: settingsListView.top } model: settingVisibilityPresetsModel.items @@ -133,12 +131,9 @@ UM.PreferencesPage } } - ScrollView + ListView { - id: scrollView - - frameVisible: true - + id: settingsListView anchors { top: filter.bottom; @@ -147,42 +142,41 @@ UM.PreferencesPage right: parent.right; bottom: parent.bottom; } - ListView + + clip: true + ScrollBar.vertical: UM.ScrollBar {} + + model: UM.SettingDefinitionsModel { - id: settingsListView + id: definitionsModel + containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" + showAll: true + exclude: ["machine_settings", "command_line_settings"] + showAncestors: true + expanded: ["*"] + visibilityHandler: UM.SettingPreferenceVisibilityHandler {} + } - model: UM.SettingDefinitionsModel + delegate: Loader + { + id: loader + + width: settingsListView.width + height: model.type != undefined ? UM.Theme.getSize("section").height : 0 + + property var definition: model + property var settingDefinitionsModel: definitionsModel + + asynchronous: true + active: model.type != undefined + sourceComponent: { - id: definitionsModel - containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" - showAll: true - exclude: ["machine_settings", "command_line_settings"] - showAncestors: true - expanded: ["*"] - visibilityHandler: UM.SettingPreferenceVisibilityHandler {} - } - - delegate: Loader - { - id: loader - - width: settingsListView.width - height: model.type != undefined ? UM.Theme.getSize("section").height : 0 - - property var definition: model - property var settingDefinitionsModel: definitionsModel - - asynchronous: true - active: model.type != undefined - sourceComponent: + switch(model.type) { - switch(model.type) - { - case "category": - return settingVisibilityCategory - default: - return settingVisibilityItem - } + case "category": + return settingVisibilityCategory + default: + return settingVisibilityItem } } } From 52f5b91621968b9056ebd2f4317557796e2d7483 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 19:01:22 +0100 Subject: [PATCH 068/377] Upgrade material list ScrollView to Controls2 Took some effort. This was a weird one. I had to manually set the contentHeight to the height of the contents. Perhaps the ScrollBar itself was messing with it? Contributes to issue CURA-8686. --- .../Preferences/Materials/MaterialsPage.qml | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 6ec23f001f..549e0cc00d 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -1,12 +1,13 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 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 2.15 +import QtQuick.Controls 1.4 as OldControls import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.5 as Cura Item @@ -102,7 +103,7 @@ Item height: childrenRect.height // Activate button - Button + OldControls.Button { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate") @@ -120,7 +121,7 @@ Item } // Create button - Button + OldControls.Button { id: createMenuButton text: catalog.i18nc("@action:button", "Create") @@ -135,7 +136,7 @@ Item } // Duplicate button - Button + OldControls.Button { id: duplicateMenuButton text: catalog.i18nc("@action:button", "Duplicate"); @@ -150,7 +151,7 @@ Item } // Remove button - Button + OldControls.Button { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove") @@ -165,7 +166,7 @@ Item } // Import button - Button + OldControls.Button { id: importMenuButton text: catalog.i18nc("@action:button", "Import") @@ -179,7 +180,7 @@ Item } // Export button - Button + OldControls.Button { id: exportMenuButton text: catalog.i18nc("@action:button", "Export") @@ -193,7 +194,7 @@ Item } //Sync button. - Button + OldControls.Button { id: syncMaterialsButton text: catalog.i18nc("@action:button Sending materials to printers", "Sync with Printers") @@ -207,7 +208,8 @@ Item } } - Item { + Item + { id: contentsItem anchors { @@ -271,22 +273,26 @@ Item bottom: parent.bottom left: parent.left } - - Rectangle - { - parent: viewport - anchors.fill: parent - color: palette.light - } - width: (parent.width * 0.4) | 0 - frameVisible: true - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff + + clip: true + ScrollBar.vertical: UM.ScrollBar + { + id: materialScrollBar + parent: materialScrollView + anchors + { + top: parent.top + right: parent.right + bottom: parent.bottom + } + } + contentHeight: materialListView.height //For some reason, this is not determined automatically with this ScrollView. Very weird! MaterialsList { id: materialListView - width: materialScrollView.viewport.width + width: materialScrollView.width - materialScrollBar.width } } From 4d9039288b6a4aa7f1625b6afaac62a4b9a6e35c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jan 2022 19:10:06 +0100 Subject: [PATCH 069/377] Use new ScrollBar for material sync dialogue Contributes to issue CURA-8686. --- .../Materials/MaterialsSyncDialog.qml | 326 +++++++++--------- 1 file changed, 162 insertions(+), 164 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index 2d2918072a..cc2985a8a8 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -1,4 +1,4 @@ -//Copyright (c) 2021 Ultimaker B.V. +//Copyright (c) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.15 @@ -253,204 +253,202 @@ Window onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer") } } - ScrollView + ListView { - id: printerListScrollView + id: printerList width: parent.width Layout.preferredWidth: width Layout.fillHeight: true + clip: true - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - - ListView + ScrollBar.vertical: UM.ScrollBar { - id: printerList - width: parent.width - spacing: UM.Theme.getSize("default_margin").height + id: printerListScrollBar + } + spacing: UM.Theme.getSize("default_margin").height - model: cloudPrinterList - delegate: Rectangle + model: cloudPrinterList + delegate: Rectangle + { + id: delegateContainer + color: "transparent" + border.color: UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width + width: printerList.width - printerListScrollBar.width + height: UM.Theme.getSize("card").height + + property string syncStatus: { - id: delegateContainer - color: "transparent" - border.color: UM.Theme.getColor("lining") - border.width: UM.Theme.getSize("default_lining").width - width: printerListScrollView.width - height: UM.Theme.getSize("card").height - - property string syncStatus: + var printer_id = model.metadata["host_guid"] + if(syncModel.printerStatus[printer_id] === undefined) //No status information available. Could be added after we started syncing. { - var printer_id = model.metadata["host_guid"] - if(syncModel.printerStatus[printer_id] === undefined) //No status information available. Could be added after we started syncing. - { - return "idle"; - } - return syncModel.printerStatus[printer_id]; + return "idle"; + } + return syncModel.printerStatus[printer_id]; + } + + Cura.IconWithText + { + anchors + { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: Math.round(parent.height - height) / 2 //Equal margin on the left as above and below. + right: parent.right + rightMargin: Math.round(parent.height - height) / 2 } - Cura.IconWithText - { - anchors - { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: Math.round(parent.height - height) / 2 //Equal margin on the left as above and below. - right: parent.right - rightMargin: Math.round(parent.height - height) / 2 - } + text: model.name + font: UM.Theme.getFont("medium") - text: model.name - font: UM.Theme.getFont("medium") - - source: UM.Theme.getIcon("Printer", "medium") - iconColor: UM.Theme.getColor("machine_selector_printer_icon") - iconSize: UM.Theme.getSize("machine_selector_icon").width - - //Printer status badge (always cloud, but whether it's online or offline). - UM.RecolorImage - { - width: UM.Theme.getSize("printer_status_icon").width - height: UM.Theme.getSize("printer_status_icon").height - anchors - { - bottom: parent.bottom - bottomMargin: -Math.round(height / 6) - left: parent.left - leftMargin: parent.iconSize - Math.round(width * 5 / 6) - } - - source: UM.Theme.getIcon("CloudBadge", "low") - color: UM.Theme.getColor("primary") - - //Make a themeable circle in the background so we can change it in other themes. - Rectangle - { - anchors.centerIn: parent - width: parent.width - 1.5 //1.5 pixels smaller (at least sqrt(2), regardless of pixel scale) so that the circle doesn't show up behind the icon due to anti-aliasing. - height: parent.height - 1.5 - radius: width / 2 - color: UM.Theme.getColor("connection_badge_background") - z: parent.z - 1 - } - } - } + source: UM.Theme.getIcon("Printer", "medium") + iconColor: UM.Theme.getColor("machine_selector_printer_icon") + iconSize: UM.Theme.getSize("machine_selector_icon").width + //Printer status badge (always cloud, but whether it's online or offline). UM.RecolorImage { - id: printerSpinner - width: UM.Theme.getSize("section_icon").width - height: width - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below. + width: UM.Theme.getSize("printer_status_icon").width + height: UM.Theme.getSize("printer_status_icon").height + anchors + { + bottom: parent.bottom + bottomMargin: -Math.round(height / 6) + left: parent.left + leftMargin: parent.iconSize - Math.round(width * 5 / 6) + } - visible: delegateContainer.syncStatus === "uploading" - source: UM.Theme.getIcon("ArrowDoubleCircleRight") + source: UM.Theme.getIcon("CloudBadge", "low") color: UM.Theme.getColor("primary") - RotationAnimator + //Make a themeable circle in the background so we can change it in other themes. + Rectangle { - target: printerSpinner - from: 0 - to: 360 - duration: 1000 - loops: Animation.Infinite - running: true + anchors.centerIn: parent + width: parent.width - 1.5 //1.5 pixels smaller (at least sqrt(2), regardless of pixel scale) so that the circle doesn't show up behind the icon due to anti-aliasing. + height: parent.height - 1.5 + radius: width / 2 + color: UM.Theme.getColor("connection_badge_background") + z: parent.z - 1 } } - UM.StatusIcon - { - width: UM.Theme.getSize("section_icon").width - height: width - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below. - - visible: delegateContainer.syncStatus === "failed" || delegateContainer.syncStatus === "success" - status: delegateContainer.syncStatus === "success" ? UM.StatusIcon.Status.POSITIVE : UM.StatusIcon.Status.ERROR - } } - footer: Item + UM.RecolorImage { - width: printerListScrollView.width - height: { - if(!visible) - { - return 0; - } - let h = UM.Theme.getSize("card").height + printerListTroubleshooting.height + UM.Theme.getSize("default_margin").height * 2; //1 margin between content and footer, 1 for troubleshooting link. - return h; - } - visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0 && typeof syncModel !== "undefined" && syncModel.exportUploadStatus === "idle" - Rectangle + id: printerSpinner + width: UM.Theme.getSize("section_icon").width + height: width + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below. + + visible: delegateContainer.syncStatus === "uploading" + source: UM.Theme.getIcon("ArrowDoubleCircleRight") + color: UM.Theme.getColor("primary") + + RotationAnimator { - anchors.fill: parent - anchors.topMargin: UM.Theme.getSize("default_margin").height + target: printerSpinner + from: 0 + to: 360 + duration: 1000 + loops: Animation.Infinite + running: true + } + } + UM.StatusIcon + { + width: UM.Theme.getSize("section_icon").width + height: width + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below. - border.color: UM.Theme.getColor("lining") - border.width: UM.Theme.getSize("default_lining").width - color: "transparent" + visible: delegateContainer.syncStatus === "failed" || delegateContainer.syncStatus === "success" + status: delegateContainer.syncStatus === "success" ? UM.StatusIcon.Status.POSITIVE : UM.StatusIcon.Status.ERROR + } + } - Row + footer: Item + { + width: printerList.width - printerListScrollBar + height: { + if(!visible) + { + return 0; + } + let h = UM.Theme.getSize("card").height + printerListTroubleshooting.height + UM.Theme.getSize("default_margin").height * 2; //1 margin between content and footer, 1 for troubleshooting link. + return h; + } + visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0 && typeof syncModel !== "undefined" && syncModel.exportUploadStatus === "idle" + Rectangle + { + anchors.fill: parent + anchors.topMargin: UM.Theme.getSize("default_margin").height + + border.color: UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width + color: "transparent" + + Row + { + anchors { - anchors + fill: parent + margins: Math.round(UM.Theme.getSize("card").height - UM.Theme.getSize("machine_selector_icon").width) / 2 //Same margin as in other cards. + } + spacing: UM.Theme.getSize("default_margin").width + + UM.StatusIcon + { + id: infoIcon + width: UM.Theme.getSize("section_icon").width + height: width + //Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings. + anchors.top: parent.top + anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2) + + status: UM.StatusIcon.Status.WARNING + } + + Column + { + //Fill the total width. Can't use layouts because we need the anchors for vertical alignment. + width: parent.width - infoIcon.width - refreshListButton.width - parent.spacing * 2 + + spacing: UM.Theme.getSize("default_margin").height + + UM.Label { - fill: parent - margins: Math.round(UM.Theme.getSize("card").height - UM.Theme.getSize("machine_selector_icon").width) / 2 //Same margin as in other cards. + id: printersMissingText + text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") + + "\n" + + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") + font: UM.Theme.getFont("medium") + elide: Text.ElideRight } - spacing: UM.Theme.getSize("default_margin").width - - UM.StatusIcon + Cura.TertiaryButton { - id: infoIcon - width: UM.Theme.getSize("section_icon").width - height: width - //Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings. - anchors.top: parent.top - anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2) + id: printerListTroubleshooting + leftPadding: 0 //Want to visually align this to the text. - status: UM.StatusIcon.Status.WARNING + text: catalog.i18nc("@button", "Troubleshooting") + iconSource: UM.Theme.getIcon("LinkExternal") + onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer") } + } - Column - { - //Fill the total width. Can't use layouts because we need the anchors for vertical alignment. - width: parent.width - infoIcon.width - refreshListButton.width - parent.spacing * 2 + Cura.SecondaryButton + { + id: refreshListButton + //Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings. + anchors.top: parent.top + anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2) - spacing: UM.Theme.getSize("default_margin").height - - UM.Label - { - id: printersMissingText - text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") - + "\n" - + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") - font: UM.Theme.getFont("medium") - elide: Text.ElideRight - } - Cura.TertiaryButton - { - id: printerListTroubleshooting - leftPadding: 0 //Want to visually align this to the text. - - text: catalog.i18nc("@button", "Troubleshooting") - iconSource: UM.Theme.getIcon("LinkExternal") - onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer") - } - } - - Cura.SecondaryButton - { - id: refreshListButton - //Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings. - anchors.top: parent.top - anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2) - - text: catalog.i18nc("@button", "Refresh List") - iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") - onClicked: Cura.API.account.sync(true) - } + text: catalog.i18nc("@button", "Refresh List") + iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") + onClicked: Cura.API.account.sync(true) } } } From 509c9068eb05677ad01f569554d9f17d1d78eccf Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 13:48:21 +0100 Subject: [PATCH 070/377] Convert all ScrollViews to Controls2 This was a bit of a doozy. One was really simple but the other one had me stumped for a while: The Controls2 version doesn't have the viewport property any more, so just use the width. Contributes to issue CURA-8686. --- .../Preferences/Materials/MaterialsView.qml | 184 +++++++++--------- 1 file changed, 97 insertions(+), 87 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 2c68973e55..daa47f33e9 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -1,16 +1,17 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2022 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 2.15 +import QtQuick.Controls 1.4 as OldControls import QtQuick.Dialogs 1.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import ".." // Access to ReadOnlyTextArea.qml -TabView +OldControls.TabView { id: base @@ -67,7 +68,7 @@ TabView } } - Tab + OldControls.Tab { title: catalog.i18nc("@title", "Information") @@ -77,11 +78,21 @@ TabView { id: scrollView anchors.fill: parent - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff - flickableItem.flickableDirection: Flickable.VerticalFlick - frameVisible: true - property real columnWidth: (viewport.width * 0.5 - UM.Theme.getSize("default_margin").width) | 0 + ScrollBar.vertical: UM.ScrollBar + { + parent: scrollView + anchors + { + top: parent.top + right: parent.right + bottom: parent.bottom + } + } + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + clip: true + + property real columnWidth: (scrollView.width * 0.5 - UM.Theme.getSize("default_margin").width) | 0 Flow { @@ -257,7 +268,7 @@ TabView } Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament Cost") } - SpinBox + OldControls.SpinBox { id: spoolCostSpinBox width: scrollView.columnWidth @@ -274,7 +285,7 @@ TabView } Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament weight") } - SpinBox + OldControls.SpinBox { id: spoolWeightSpinBox width: scrollView.columnWidth @@ -318,7 +329,7 @@ TabView wrapMode: Text.WordWrap visible: unlinkMaterialButton.visible } - Button + OldControls.Button { id: unlinkMaterialButton text: catalog.i18nc("@label", "Unlink Material") @@ -369,7 +380,7 @@ TabView } } - Tab + OldControls.Tab { title: catalog.i18nc("@label", "Print settings") anchors @@ -380,86 +391,85 @@ TabView rightMargin: 0 } - ScrollView + ListView { - anchors.fill: parent; - - ListView + anchors.fill: parent + model: UM.SettingDefinitionsModel { - model: UM.SettingDefinitionsModel + containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" + visibilityHandler: Cura.MaterialSettingsVisibilityHandler { } + expanded: ["*"] + } + + ScrollBar.vertical: UM.ScrollBar {} + clip: true + + delegate: UM.TooltipArea + { + width: childrenRect.width + height: childrenRect.height + text: model.description + Label { - containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" - visibilityHandler: Cura.MaterialSettingsVisibilityHandler { } - expanded: ["*"] + id: label + width: base.firstColumnWidth; + height: spinBox.height + UM.Theme.getSize("default_lining").height + text: model.label + elide: Text.ElideRight + verticalAlignment: Qt.AlignVCenter + } + ReadOnlySpinBox + { + id: spinBox + anchors.left: label.right + value: + { + // In case the setting is not in the material... + if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) + { + return parseFloat(materialPropertyProvider.properties.value); + } + // ... we search in the variant, and if it is not there... + if (!isNaN(parseFloat(variantPropertyProvider.properties.value))) + { + return parseFloat(variantPropertyProvider.properties.value); + } + // ... then look in the definition container. + if (!isNaN(parseFloat(machinePropertyProvider.properties.value))) + { + return parseFloat(machinePropertyProvider.properties.value); + } + return 0; + } + width: base.secondColumnWidth + readOnly: !base.editingEnabled + suffix: " " + model.unit + maximumValue: 99999 + decimals: model.unit == "mm" ? 2 : 0 + + onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) } - delegate: UM.TooltipArea + UM.ContainerPropertyProvider { - width: childrenRect.width - height: childrenRect.height - text: model.description - Label - { - id: label - width: base.firstColumnWidth; - height: spinBox.height + UM.Theme.getSize("default_lining").height - text: model.label - elide: Text.ElideRight - verticalAlignment: Qt.AlignVCenter - } - ReadOnlySpinBox - { - id: spinBox - anchors.left: label.right - value: - { - // In case the setting is not in the material... - if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) - { - return parseFloat(materialPropertyProvider.properties.value); - } - // ... we search in the variant, and if it is not there... - if (!isNaN(parseFloat(variantPropertyProvider.properties.value))) - { - return parseFloat(variantPropertyProvider.properties.value); - } - // ... then look in the definition container. - if (!isNaN(parseFloat(machinePropertyProvider.properties.value))) - { - return parseFloat(machinePropertyProvider.properties.value); - } - return 0; - } - width: base.secondColumnWidth - readOnly: !base.editingEnabled - suffix: " " + model.unit - maximumValue: 99999 - decimals: model.unit == "mm" ? 2 : 0 - - onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) - } - - UM.ContainerPropertyProvider - { - id: materialPropertyProvider - containerId: base.containerId - watchedProperties: [ "value" ] - key: model.key - } - UM.ContainerPropertyProvider - { - id: variantPropertyProvider - containerId: Cura.MachineManager.activeStack.variant.id - watchedProperties: [ "value" ] - key: model.key - } - UM.ContainerPropertyProvider - { - id: machinePropertyProvider - containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" - watchedProperties: [ "value" ] - key: model.key - } + id: materialPropertyProvider + containerId: base.containerId + watchedProperties: [ "value" ] + key: model.key + } + UM.ContainerPropertyProvider + { + id: variantPropertyProvider + containerId: Cura.MachineManager.activeStack.variant.id + watchedProperties: [ "value" ] + key: model.key + } + UM.ContainerPropertyProvider + { + id: machinePropertyProvider + containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" + watchedProperties: [ "value" ] + key: model.key } } } From 7e1b92953c0401403b49d99126641d887a7814f9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 14:14:03 +0100 Subject: [PATCH 071/377] Update ScrollView to Controls 2 and customise with scrollbar Contributes to issue CURA-8686. --- resources/qml/Preferences/GeneralPage.qml | 37 +++++++++++++++-------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 7b025f889d..d92d237bcf 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -2,12 +2,11 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.1 +import QtQuick.Controls 1.1 as OldControls +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.3 as NewControls - -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.1 as Cura UM.PreferencesPage @@ -133,10 +132,22 @@ UM.PreferencesPage width: parent.width height: parent.height + ScrollBar.vertical: UM.ScrollBar + { + id: preferencesScrollBar + parent: preferencesScrollView + anchors + { + top: parent.top + bottom: parent.bottom + right: parent.right + } + } + Column { UM.I18nCatalog{id: catalog; name: "cura"} - width: preferencesScrollView.viewport.width + width: preferencesScrollView.width - preferencesScrollBar.width Label { @@ -188,7 +199,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: languageComboBox @@ -242,7 +253,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: themeComboBox @@ -518,7 +529,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: cameraComboBox @@ -675,7 +686,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ") } - NewControls.ComboBox + ComboBox { id: choiceOnOpenProjectDropDownButton width: Math.round(250 * screenScaleFactor) @@ -742,7 +753,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ") } - NewControls.ComboBox + ComboBox { id: choiceOnProfileOverrideDropDownButton width: Math.round(250 * screenScaleFactor) @@ -845,7 +856,7 @@ UM.PreferencesPage } } - ExclusiveGroup { id: curaUpdatesGroup } + OldControls.ExclusiveGroup { id: curaUpdatesGroup } UM.TooltipArea { width: childrenRect.width @@ -853,7 +864,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.") anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - RadioButton + OldControls.RadioButton { text: catalog.i18nc("@option:radio", "Stable releases only") exclusiveGroup: curaUpdatesGroup @@ -869,7 +880,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.") anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - RadioButton + OldControls.RadioButton { text: catalog.i18nc("@option:radio", "Stable and Beta releases") exclusiveGroup: curaUpdatesGroup From c57126fb00899de4274e68d3f1125fda1237780f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 14:32:12 +0100 Subject: [PATCH 072/377] Use re-useable scrollbar and remove ScrollView The machine selector has the scroll view inside of the listview. It just needs to use our new scrollbar element instead of the default. Contributes to issue CURA-8686. --- .../qml/PrinterSelector/MachineSelector.qml | 46 ++++++------------- .../PrinterSelector/MachineSelectorList.qml | 9 +++- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 0c2f80fb37..8bea52fab6 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -1,10 +1,10 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Cura.ExpandablePopup @@ -193,42 +193,27 @@ Cura.ExpandablePopup { id: popup width: UM.Theme.getSize("machine_selector_widget_content").width + height: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, UM.Theme.getSize("machine_selector_widget_content").height) //Maximum height is the theme entry. - ScrollView + MachineSelectorList { - id: scroll - width: parent.width - clip: true - leftPadding: UM.Theme.getSize("default_lining").width - rightPadding: UM.Theme.getSize("default_lining").width - - MachineSelectorList + id: machineSelectorList + anchors { - id: machineSelectorList - // Can't use parent.width since the parent is the flickable component and not the ScrollView - width: scroll.width - scroll.leftPadding - scroll.rightPadding - property real maximumHeight: UM.Theme.getSize("machine_selector_widget_content").height - buttonRow.height - - // We use an extra property here, since we only want to to be informed about the content size changes. - onContentHeightChanged: - { - scroll.height = Math.min(contentHeight, maximumHeight) - popup.height = scroll.height + buttonRow.height - } - - Component.onCompleted: - { - scroll.height = Math.min(contentHeight, maximumHeight) - popup.height = scroll.height + buttonRow.height - } + left: parent.left + leftMargin: UM.Theme.getSize("default_lining").width + right: parent.right + rightMargin: UM.Theme.getSize("default_lining").width + top: parent.top + bottom: separator.top } + clip: true } Rectangle { id: separator - - anchors.top: scroll.bottom + anchors.bottom: buttonRow.top width: parent.width height: UM.Theme.getSize("default_lining").height color: UM.Theme.getColor("lining") @@ -238,8 +223,7 @@ Cura.ExpandablePopup { id: buttonRow - // The separator is inside the buttonRow. This is to avoid some weird behaviours with the scroll bar. - anchors.top: separator.top + anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter padding: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width diff --git a/resources/qml/PrinterSelector/MachineSelectorList.qml b/resources/qml/PrinterSelector/MachineSelectorList.qml index 10458ea4a4..ae2706f9ab 100644 --- a/resources/qml/PrinterSelector/MachineSelectorList.qml +++ b/resources/qml/PrinterSelector/MachineSelectorList.qml @@ -14,10 +14,15 @@ ListView section.property: "hasRemoteConnection" property real contentHeight: childrenRect.height + ScrollBar.vertical: UM.ScrollBar + { + id: scrollBar + } + section.delegate: UM.Label { text: section == "true" ? catalog.i18nc("@label", "Connected printers") : catalog.i18nc("@label", "Preset printers") - width: parent.width + width: parent.width - scrollBar.width height: UM.Theme.getSize("action_button").height leftPadding: UM.Theme.getSize("default_margin").width font: UM.Theme.getFont("medium") @@ -27,7 +32,7 @@ ListView delegate: MachineSelectorButton { text: model.name ? model.name : "" - width: listView.width + width: listView.width - scrollBar.width outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null checked: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.id == model.id : false From 5041162a99f2b4fe2cd0da615f34265e95087d97 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 14:47:55 +0100 Subject: [PATCH 073/377] Use custom scroll bar for qualities+intents menu Contributes to issue CURA-8686. --- .../Custom/QualitiesWithIntentMenu.qml | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml index b03d9d4b54..d6901cfc7f 100644 --- a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml +++ b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -43,17 +43,29 @@ Popup // This repeater adds the intent labels ScrollView { + id: qualityListScrollView property real maximumHeight: screenScaleFactor * 400 contentHeight: dataColumn.height height: Math.min(contentHeight, maximumHeight) - clip: true + width: parent.width - ScrollBar.vertical.policy: height == maximumHeight ? ScrollBar.AlwaysOn: ScrollBar.AlwaysOff + clip: true + ScrollBar.vertical: UM.ScrollBar + { + id: qualityListScrollBar + parent: qualityListScrollView + anchors + { + top: parent.top + right: parent.right + bottom: parent.bottom + } + } Column { id: dataColumn - width: parent.width + width: qualityListScrollView.width - qualityListScrollBar.width Repeater { model: dataModel @@ -64,7 +76,7 @@ Popup property variant subItemModel: model.qualities height: childrenRect.height - width: popup.contentWidth + width: dataColumn.width UM.Label { @@ -137,7 +149,7 @@ Popup Item { height: childrenRect.height - width: popup.contentWidth + width: dataColumn.width UM.Label { From f94b7ce753c84bf71ac65664e67df7da735ec7e8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 14:58:55 +0100 Subject: [PATCH 074/377] Replace ScrollView+Column+Repeater by ListView with correct scrollbar Much simpler. And looks more consistent too. Contributes to issue CURA-8686. --- .../qml/WelcomePages/AddCloudPrintersView.qml | 94 +++++++++---------- 1 file changed, 42 insertions(+), 52 deletions(-) diff --git a/resources/qml/WelcomePages/AddCloudPrintersView.qml b/resources/qml/WelcomePages/AddCloudPrintersView.qml index e33d519f22..f454dc139d 100644 --- a/resources/qml/WelcomePages/AddCloudPrintersView.qml +++ b/resources/qml/WelcomePages/AddCloudPrintersView.qml @@ -1,11 +1,11 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.7 as Cura @@ -22,7 +22,7 @@ Item property bool searchingForCloudPrinters: true property var discoveredCloudPrintersModel: CuraApplication.getDiscoveredCloudPrintersModel() - // The area where either the discoveredCloudPrintersScrollView or the busyIndicator will be displayed + // The area where either the discoveredCloudPrintersList or the busyIndicator will be displayed Item { id: cloudPrintersContent @@ -126,14 +126,9 @@ Item // The scrollView that contains the list of newly discovered Ultimaker Cloud printers. Visible only when // there is at least a new cloud printer. - ScrollView + ListView { - id: discoveredCloudPrintersScrollView - width: parent.width - clip : true - ScrollBar.horizontal.policy: ScrollBar.AsNeeded - ScrollBar.vertical.policy: ScrollBar.AsNeeded - visible: discoveredCloudPrintersModel.count > 0 + id: discoveredCloudPrintersList anchors { top: cloudPrintersAddedTitle.bottom @@ -144,52 +139,47 @@ Item bottom: parent.bottom } - Column + ScrollBar.vertical: UM.ScrollBar {} + clip : true + visible: discoveredCloudPrintersModel.count > 0 + spacing: UM.Theme.getSize("wide_margin").height + + model: discoveredCloudPrintersModel + delegate: Item { - id: discoveredPrintersColumn - spacing: 2 * UM.Theme.getSize("default_margin").height + width: discoveredCloudPrintersList.width + height: contentColumn.height - Repeater + Column { - id: discoveredCloudPrintersRepeater - model: discoveredCloudPrintersModel - delegate: Item + id: contentColumn + Label { - width: discoveredCloudPrintersScrollView.width - height: contentColumn.height - - Column - { - id: contentColumn - Label - { - id: cloudPrinterNameLabel - leftPadding: UM.Theme.getSize("default_margin").width - text: model.name - font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") - elide: Text.ElideRight - } - Label - { - id: cloudPrinterTypeLabel - leftPadding: 2 * UM.Theme.getSize("default_margin").width - topPadding: UM.Theme.getSize("thin_margin").height - text: {"Type: " + model.machine_type} - font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - elide: Text.ElideRight - } - Label - { - id: cloudPrinterFirmwareVersionLabel - leftPadding: 2 * UM.Theme.getSize("default_margin").width - text: {"Firmware version: " + model.firmware_version} - font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - elide: Text.ElideRight - } - } + id: cloudPrinterNameLabel + leftPadding: UM.Theme.getSize("default_margin").width + text: model.name + font: UM.Theme.getFont("large_bold") + color: UM.Theme.getColor("text") + elide: Text.ElideRight + } + Label + { + id: cloudPrinterTypeLabel + leftPadding: 2 * UM.Theme.getSize("default_margin").width + topPadding: UM.Theme.getSize("thin_margin").height + text: {"Type: " + model.machine_type} + font: UM.Theme.getFont("medium") + color: UM.Theme.getColor("text") + elide: Text.ElideRight + } + Label + { + id: cloudPrinterFirmwareVersionLabel + leftPadding: 2 * UM.Theme.getSize("default_margin").width + text: {"Firmware version: " + model.firmware_version} + font: UM.Theme.getFont("medium") + color: UM.Theme.getColor("text") + elide: Text.ElideRight } } } From fa2fbb99c7cc5c527e2dddf301172877ce869a03 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 16:26:48 +0100 Subject: [PATCH 075/377] Fix height and scrolling of add printer menus This fixes the irritating scrolling behaviour of the local printer menu, as well as the disappearing items (former issue which had a workaround) and makes it use a styled scroll bar. Contributes to issue CURA-8686. --- .../AddLocalPrinterScrollView.qml | 153 ++++++++---------- .../AddNetworkOrLocalPrinterContent.qml | 13 +- resources/qml/WelcomePages/DropDownWidget.qml | 4 +- 3 files changed, 68 insertions(+), 102 deletions(-) diff --git a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml index e34452623d..d2d48267de 100644 --- a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -74,118 +74,93 @@ Item Row { id: localPrinterSelectionItem - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top + anchors.fill: parent - // ScrollView + ListView for selecting a local printer to add - Cura.ScrollView + //Selecting a local printer to add from this list. + ListView { - id: scrollView - - height: childrenHeight + id: machineList width: Math.floor(parent.width * 0.48) + height: parent.height - ListView + clip: true + ScrollBar.vertical: UM.ScrollBar {} + + model: UM.DefinitionContainersModel { - id: machineList - - // CURA-6793 - // Enabling the buffer seems to cause the blank items issue. When buffer is enabled, if the ListView's - // individual item has a dynamic change on its visibility, the ListView doesn't redraw itself. - // The default value of cacheBuffer is platform-dependent, so we explicitly disable it here. - cacheBuffer: 0 - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 20000 // To prevent the flicking behavior. - model: UM.DefinitionContainersModel - { - id: machineDefinitionsModel - filter: { "visible": true } - sectionProperty: "manufacturer" - preferredSections: preferredCategories - } - - section.property: "section" - section.delegate: sectionHeader - delegate: machineButton + id: machineDefinitionsModel + filter: { "visible": true } + sectionProperty: "manufacturer" + preferredSections: preferredCategories } - Component + section.property: "section" + section.delegate: Button { - id: sectionHeader + id: button + width: machineList.width + height: UM.Theme.getSize("action_button").height + text: section - Button + property bool isActive: base.currentSection == section + + background: Rectangle { - id: button - width: ListView.view.width + anchors.fill: parent + color: isActive ? UM.Theme.getColor("setting_control_highlight") : "transparent" + } + + contentItem: Item + { + width: childrenRect.width height: UM.Theme.getSize("action_button").height - text: section - property bool isActive: base.currentSection == section - - background: Rectangle + UM.RecolorImage { - anchors.fill: parent - color: isActive ? UM.Theme.getColor("setting_control_highlight") : "transparent" + id: arrow + anchors.left: parent.left + 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") + source: base.currentSection == section ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight") } - contentItem: Item + UM.Label { - width: childrenRect.width - height: UM.Theme.getSize("action_button").height - - UM.RecolorImage - { - id: arrow - anchors.left: parent.left - 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") - source: base.currentSection == section ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight") - } - - UM.Label - { - id: label - anchors.left: arrow.right - anchors.leftMargin: UM.Theme.getSize("default_margin").width - text: button.text - font: UM.Theme.getFont("default_bold") - } + id: label + anchors.left: arrow.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width + text: button.text + font: UM.Theme.getFont("default_bold") } + } - onClicked: - { - base.currentSection = section - base.updateCurrentItemUponSectionChange() - } + onClicked: + { + base.currentSection = section + base.updateCurrentItemUponSectionChange() } } - Component + delegate: Cura.RadioButton { - id: machineButton - - Cura.RadioButton + id: radioButton + anchors { - id: radioButton - anchors - { - left: parent !== null ? parent.left: undefined - leftMargin: UM.Theme.getSize("standard_list_lineheight").width + left: parent !== null ? parent.left : undefined + leftMargin: UM.Theme.getSize("standard_list_lineheight").width - right: parent !== null ? parent.right: undefined - rightMargin: UM.Theme.getSize("default_margin").width - } - height: visible ? UM.Theme.getSize("standard_list_lineheight").height : 0 - - checked: ListView.view.currentIndex == index - text: name - visible: base.currentSection.toLowerCase() === section.toLowerCase() - onClicked: ListView.view.currentIndex = index + right: parent !== null ? parent.right : undefined + rightMargin: UM.Theme.getSize("default_margin").width } + height: visible ? UM.Theme.getSize("standard_list_lineheight").height : 0 //This causes the scrollbar to vary in length due to QTBUG-76830. + + checked: machineList.currentIndex == index + text: name + visible: base.currentSection.toLowerCase() === section.toLowerCase() + onClicked: machineList.currentIndex = index } } @@ -194,7 +169,7 @@ Item { id: verticalLine anchors.top: parent.top - height: childrenHeight - UM.Theme.getSize("default_lining").height + height: parent.height - UM.Theme.getSize("default_lining").height width: UM.Theme.getSize("default_lining").height color: UM.Theme.getColor("lining") } diff --git a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml index edf6fe5974..dbf68ce701 100644 --- a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml +++ b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -45,11 +45,9 @@ Item } contentComponent: networkPrinterListComponent - Component { id: networkPrinterListComponent - AddNetworkPrinterScrollView { id: networkPrinterScrollView @@ -95,20 +93,13 @@ Item } contentComponent: localPrinterListComponent - Component { id: localPrinterListComponent - AddLocalPrinterScrollView { id: localPrinterView - property int childrenHeight: backButton.y - addLocalPrinterDropDown.y - UM.Theme.getSize("expandable_component_content_header").height - UM.Theme.getSize("default_margin").height - - onChildrenHeightChanged: - { - addLocalPrinterDropDown.children[1].height = childrenHeight - } + height: backButton.y - addLocalPrinterDropDown.y - UM.Theme.getSize("expandable_component_content_header").height - UM.Theme.getSize("default_margin").height } } } diff --git a/resources/qml/WelcomePages/DropDownWidget.qml b/resources/qml/WelcomePages/DropDownWidget.qml index 2639a8eb43..90e1900d35 100644 --- a/resources/qml/WelcomePages/DropDownWidget.qml +++ b/resources/qml/WelcomePages/DropDownWidget.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -61,7 +61,7 @@ Item anchors.left: header.left anchors.right: header.right // Add 2x lining, because it needs a bit of space on the top and the bottom. - height: contentLoader.item.height + 2 * UM.Theme.getSize("thick_lining").height + height: contentLoader.item ? contentLoader.item.height + 2 * UM.Theme.getSize("thick_lining").height : 0 border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") From 9124f213ea074711755f8a6aa49281a63eab9a91 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 16:31:36 +0100 Subject: [PATCH 076/377] Prevent QML errors when model is not yet initialised I'm not sure when this happens, but it updates this text twice: Once with 'undefined' name and once with the proper name. For the user it displays the name correctly, but it may be so fast that nothing was visible. Discovered during work on CURA-8686. --- resources/qml/WelcomePages/AddCloudPrintersView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddCloudPrintersView.qml b/resources/qml/WelcomePages/AddCloudPrintersView.qml index f454dc139d..0b94d21fae 100644 --- a/resources/qml/WelcomePages/AddCloudPrintersView.qml +++ b/resources/qml/WelcomePages/AddCloudPrintersView.qml @@ -157,7 +157,7 @@ Item { id: cloudPrinterNameLabel leftPadding: UM.Theme.getSize("default_margin").width - text: model.name + text: model.name ? model.name : "" font: UM.Theme.getFont("large_bold") color: UM.Theme.getColor("text") elide: Text.ElideRight From f1db69a36aaae305ec4090fff8cfc47861397e50 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 17:14:30 +0100 Subject: [PATCH 077/377] Remove extra ScrollView and customise ListView instead Contributes to issue CURA-8686. --- .../AddNetworkPrinterScrollView.qml | 147 ++++++++---------- 1 file changed, 67 insertions(+), 80 deletions(-) diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 51f69dfa30..752ad64f98 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -17,7 +17,7 @@ Item id: base height: networkPrinterInfo.height + controlsRectangle.height - property alias maxItemCountAtOnce: networkPrinterScrollView.maxItemCountAtOnce + property alias maxItemCountAtOnce: networkPrinterListView.maxItemCountAtOnce property var currentItem: (networkPrinterListView.currentIndex >= 0) ? networkPrinterListView.model[networkPrinterListView.currentIndex] : null @@ -29,7 +29,7 @@ Item Item { id: networkPrinterInfo - height: networkPrinterScrollView.visible ? networkPrinterScrollView.height : noPrinterLabel.height + height: networkPrinterListView.visible ? networkPrinterListView.height : noPrinterLabel.height anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top @@ -44,104 +44,91 @@ Item visible: networkPrinterListView.count == 0 // Do not show if there are discovered devices. } - ScrollView + ListView { - id: networkPrinterScrollView + id: networkPrinterListView anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - - ScrollBar.horizontal.policy: ScrollBar.AsNeeded - ScrollBar.vertical.policy: ScrollBar.AsNeeded - - property int maxItemCountAtOnce: 8 // show at max 8 items at once, otherwise you need to scroll. height: Math.min(contentHeight, (maxItemCountAtOnce * UM.Theme.getSize("action_button").height) - UM.Theme.getSize("default_margin").height) + ScrollBar.vertical: UM.ScrollBar + { + id: networkPrinterScrollBar + } + clip: true + property int maxItemCountAtOnce: 8 // show at max 8 items at once, otherwise you need to scroll. visible: networkPrinterListView.count > 0 - clip: true + model: contentLoader.enabled ? CuraApplication.getDiscoveredPrintersModel().discoveredPrinters: undefined + cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item. - ListView + section.property: "modelData.sectionName" + section.criteria: ViewSection.FullString + section.delegate: UM.Label { - id: networkPrinterListView - anchors.fill: parent - model: contentLoader.enabled ? CuraApplication.getDiscoveredPrintersModel().discoveredPrinters: undefined + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.right: networkPrinterScrollBar.left + anchors.rightMargin: UM.Theme.getSize("default_margin").width + height: UM.Theme.getSize("setting_control").height + text: section + color: UM.Theme.getColor("small_button_text") + } - section.property: "modelData.sectionName" - section.criteria: ViewSection.FullString - section.delegate: sectionHeading - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 20000 // To prevent the flicking behavior. - cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item. - - Component.onCompleted: + Component.onCompleted: + { + var toSelectIndex = -1 + // Select the first one that's not "unknown" and is the host a group by default. + for (var i = 0; i < count; i++) { - var toSelectIndex = -1 - // Select the first one that's not "unknown" and is the host a group by default. - for (var i = 0; i < count; i++) + if (!model[i].isUnknownMachineType && model[i].isHostOfGroup) { - if (!model[i].isUnknownMachineType && model[i].isHostOfGroup) - { - toSelectIndex = i - break - } - } - currentIndex = toSelectIndex - } - - // CURA-6483 For some reason currentIndex can be reset to 0. This check is here to prevent automatically - // selecting an unknown or non-host printer. - onCurrentIndexChanged: - { - var item = model[currentIndex] - if (!item || item.isUnknownMachineType || !item.isHostOfGroup) - { - currentIndex = -1 + toSelectIndex = i + break } } + currentIndex = toSelectIndex + } - Component + // CURA-6483 For some reason currentIndex can be reset to 0. This check is here to prevent automatically + // selecting an unknown or non-host printer. + onCurrentIndexChanged: + { + var item = model[currentIndex] + if (!item || item.isUnknownMachineType || !item.isHostOfGroup) { - id: sectionHeading + currentIndex = -1 + } + } - UM.Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - height: UM.Theme.getSize("setting_control").height - text: section - color: UM.Theme.getColor("small_button_text") - } + delegate: Cura.MachineSelectorButton + { + text: modelData.device.name + + width: networkPrinterListView.width - networkPrinterScrollBar.width + outputDevice: modelData.device + + enabled: !modelData.isUnknownMachineType && modelData.isHostOfGroup + + printerTypeLabelAutoFit: true + + // update printer types for all items in the list + updatePrinterTypesOnlyWhenChecked: false + updatePrinterTypesFunction: updateMachineTypes + // show printer type as it is + printerTypeLabelConversionFunction: function(value) { return value } + + function updateMachineTypes() + { + printerTypesList = [ modelData.readableMachineType ] } - delegate: Cura.MachineSelectorButton + checkable: false + selected: networkPrinterListView.currentIndex == model.index + onClicked: { - text: modelData.device.name - - width: networkPrinterListView.width - outputDevice: modelData.device - - enabled: !modelData.isUnknownMachineType && modelData.isHostOfGroup - - printerTypeLabelAutoFit: true - - // update printer types for all items in the list - updatePrinterTypesOnlyWhenChecked: false - updatePrinterTypesFunction: updateMachineTypes - // show printer type as it is - printerTypeLabelConversionFunction: function(value) { return value } - - function updateMachineTypes() - { - printerTypesList = [ modelData.readableMachineType ] - } - - checkable: false - selected: ListView.view.currentIndex == model.index - onClicked: - { - ListView.view.currentIndex = index - } + networkPrinterListView.currentIndex = index } } } From efc748cc994c202f0a178db83f3b5a06070a11f6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 17:16:39 +0100 Subject: [PATCH 078/377] Remove unused ScrollView widget We were not using Cura.ScrollView anywhere. Contributes to issue CURA-8686. --- resources/qml/Widgets/ScrollView.qml | 46 ---------------------------- 1 file changed, 46 deletions(-) delete mode 100644 resources/qml/Widgets/ScrollView.qml diff --git a/resources/qml/Widgets/ScrollView.qml b/resources/qml/Widgets/ScrollView.qml deleted file mode 100644 index 9e7531994c..0000000000 --- a/resources/qml/Widgets/ScrollView.qml +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2020 Ultimaker B.V. -// Toolbox is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 2.3 - -import UM 1.1 as UM - -ScrollView -{ - clip: true - - // Setting this property to false hides the scrollbar both when the scrollbar is not needed (child height < height) - // and when the scrollbar is not actively being hovered or pressed - property bool scrollAlwaysVisible: true - - ScrollBar.vertical: ScrollBar - { - hoverEnabled: true - policy: parent.scrollAlwaysVisible ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded - anchors.top: parent.top - anchors.right: parent.right - anchors.bottom: parent.bottom - - contentItem: Rectangle - { - implicitWidth: UM.Theme.getSize("scrollbar").width - opacity: (parent.active || parent.parent.scrollAlwaysVisible) ? 1.0 : 0.0 - radius: Math.round(width / 2) - color: - { - if (parent.pressed) - { - return UM.Theme.getColor("scrollbar_handle_down") - } - else if (parent.hovered) - { - return UM.Theme.getColor("scrollbar_handle_hover") - } - return UM.Theme.getColor("scrollbar_handle") - } - Behavior on color { ColorAnimation { duration: 100; } } - Behavior on opacity { NumberAnimation { duration: 100 } } - } - } -} \ No newline at end of file From 796779316fc356065d866c9c6d5b20b68292120e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 17:33:10 +0100 Subject: [PATCH 079/377] Fix scrolling through post-processing scripts list It turns out this has been broken for a while. I don't think anyone adds that many scripts that they'd need to scroll this, but if they want to they can now. Contributes to issue CURA-8686. --- .../PostProcessingPlugin.qml | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index 489254e310..d4ed30dea6 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -34,7 +34,7 @@ UM.Dialog UM.I18nCatalog{id: catalog; name: "cura"} id: base property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width) - property int textMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) + property int textMargin: UM.Theme.getSize("narrow_margin").width property string activeScriptName SystemPalette{ id: palette } SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled } @@ -44,19 +44,18 @@ UM.Dialog { id: selectedScriptGroup } - Item + Column { id: activeScripts - anchors.left: parent.left width: base.columnWidth height: parent.height + spacing: base.textMargin + Label { id: activeScriptsHeader text: catalog.i18nc("@label", "Post Processing Scripts") - anchors.top: parent.top - anchors.topMargin: base.textMargin anchors.left: parent.left anchors.leftMargin: base.textMargin anchors.right: parent.right @@ -67,22 +66,24 @@ UM.Dialog ListView { id: activeScriptsList - anchors { - top: activeScriptsHeader.bottom left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width right: parent.right rightMargin: base.textMargin - topMargin: base.textMargin - leftMargin: UM.Theme.getSize("default_margin").width } + height: Math.min(contentHeight, parent.height - parent.spacing * 2 - activeScriptsHeader.height - addButton.height) //At the window height, start scrolling this one. - height: childrenRect.height + clip: true + ScrollBar.vertical: UM.ScrollBar + { + id: activeScriptsScrollBar + } model: manager.scriptList delegate: Item { - width: parent.width + width: parent.width - activeScriptsScrollBar.width height: activeScriptButton.height Button { @@ -132,8 +133,7 @@ UM.Dialog text: "x" width: 20 * screenScaleFactor height: 20 * screenScaleFactor - anchors.right:parent.right - anchors.rightMargin: base.textMargin + anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter onClicked: manager.removeScriptByIndex(index) contentItem: Item @@ -221,8 +221,6 @@ UM.Dialog text: catalog.i18nc("@action", "Add a script") anchors.left: parent.left anchors.leftMargin: base.textMargin - anchors.top: activeScriptsList.bottom - anchors.topMargin: base.textMargin onClicked: scriptsMenu.open() } Menu From 08b8dcfa43d55bafbf3abcef04ba542f90910a50 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 17:59:41 +0100 Subject: [PATCH 080/377] Use custom scroll bar for object selector Contributes to issue CURA-8686. --- resources/qml/ObjectSelector.qml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/resources/qml/ObjectSelector.qml b/resources/qml/ObjectSelector.qml index 5f7de1f301..db68ff6c03 100644 --- a/resources/qml/ObjectSelector.qml +++ b/resources/qml/ObjectSelector.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -76,7 +76,7 @@ Item id: contents width: parent.width visible: objectSelector.opened - height: visible ? listView.height : 0 + height: visible ? listView.height + border.width * 2 : 0 color: UM.Theme.getColor("main_background") border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") @@ -99,23 +99,22 @@ Item ListView { id: listView - clip: true anchors { left: parent.left right: parent.right + top: parent.top margins: UM.Theme.getSize("default_lining").width } - - ScrollBar.vertical: ScrollBar - { - hoverEnabled: true - } - property real maximumHeight: UM.Theme.getSize("objects_menu_size").height - height: Math.min(contentHeight, maximumHeight) + ScrollBar.vertical: UM.ScrollBar + { + id: scrollBar + } + clip: true + model: Cura.ObjectsModel {} delegate: ObjectItemButton @@ -128,7 +127,7 @@ Item value: model.selected } text: model.name - width: listView.width + width: listView.width - scrollBar.width property bool outsideBuildArea: model.outside_build_area property int perObjectSettingsCount: model.per_object_settings_count property string meshType: model.mesh_type From 4f8213703575eb2eb3f09048c625db818d6f3175 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 20 Jan 2022 17:26:49 +0100 Subject: [PATCH 081/377] Customise scrollbar for extruder selectors Contributes to issue CURA-8686. --- .../SettingPickDialog.qml | 2 +- .../RecommendedSupportSelector.qml | 20 +++++++++---------- resources/qml/Settings/SettingExtruder.qml | 8 ++++---- .../qml/Settings/SettingOptionalExtruder.qml | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 8ea1a774a4..16590c68f1 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -71,7 +71,7 @@ UM.Dialog } ListView - { + { id: listview anchors { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 24732a31d4..4d23561bf0 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -1,9 +1,9 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.3 as Controls2 +import QtQuick.Controls 1.4 as OldControls +import QtQuick.Controls 2.3 import UM 1.5 as UM import Cura 1.0 as Cura @@ -73,7 +73,7 @@ Item } } - Controls2.ComboBox + ComboBox { id: supportExtruderCombobox @@ -200,7 +200,7 @@ Item } } - contentItem:UM.Label + contentItem: UM.Label { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left @@ -229,7 +229,7 @@ Item } } - popup: Controls2.Popup + popup: Popup { y: supportExtruderCombobox.height - UM.Theme.getSize("default_lining").height width: supportExtruderCombobox.width @@ -238,12 +238,12 @@ Item contentItem: ListView { - clip: true implicitHeight: contentHeight + + ScrollBar.vertical: UM.ScrollBar {} + clip: true model: supportExtruderCombobox.popup.visible ? supportExtruderCombobox.delegateModel : null currentIndex: supportExtruderCombobox.highlightedIndex - - Controls2.ScrollIndicator.vertical: Controls2.ScrollIndicator { } } background: Rectangle @@ -253,7 +253,7 @@ Item } } - delegate: Controls2.ItemDelegate + delegate: ItemDelegate { width: supportExtruderCombobox.width - 2 * UM.Theme.getSize("default_lining").width height: supportExtruderCombobox.height diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 071d9dbfe5..a7aaa99fb2 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 @@ -178,12 +178,12 @@ SettingItem contentItem: ListView { - clip: true implicitHeight: contentHeight + + ScrollBar.vertical: UM.ScrollBar {} + clip: true model: control.popup.visible ? control.delegateModel : null currentIndex: control.highlightedIndex - - ScrollIndicator.vertical: ScrollIndicator { } } background: Rectangle diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 19bca44460..1f4a021009 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 @@ -181,12 +181,12 @@ SettingItem contentItem: ListView { - clip: true implicitHeight: contentHeight + + ScrollBar.vertical: UM.ScrollBar {} + clip: true model: control.popup.visible ? control.delegateModel : null currentIndex: control.highlightedIndex - - ScrollIndicator.vertical: ScrollIndicator { } } background: Rectangle { From 643f6e7d277135a355d247727f61cb661961d14f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 20 Jan 2022 17:28:31 +0100 Subject: [PATCH 082/377] Customise scrollbar for combobox widgets Contributes to issue CURA-8686. --- resources/qml/Widgets/ComboBox.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 1d6b26e2ce..b92daad9c4 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -100,12 +100,12 @@ ComboBox contentItem: ListView { - clip: true implicitHeight: contentHeight + + ScrollBar.vertical: UM.ScrollBar {} + clip: true model: control.popup.visible ? control.delegateModel : null currentIndex: control.highlightedIndex - - ScrollIndicator.vertical: ScrollIndicator { } } background: Rectangle From 7a5db88fd8154609ca5feec612cf7d7a34b2241d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 20 Jan 2022 17:58:11 +0100 Subject: [PATCH 083/377] Update slider to Controls 2 Because Controls 1 is going out. The rest of the controls elements here are left as they were since they need to be styled. Contributes to issue CURA-8686. --- plugins/ImageReader/ConfigUI.qml | 111 ++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 38 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index a3dceed50d..70a26d17d4 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -1,8 +1,9 @@ -// Copyright (c) 2015 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 1.1 as OldControls +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 @@ -27,20 +28,24 @@ UM.Dialog rowSpacing: 4 * screenScaleFactor columns: 1 - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"") - Row { + Row + { width: parent.width - Label { + Label + { text: catalog.i18nc("@action:label", "Height (mm)") width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - TextField { + OldControls.TextField + { id: peak_height objectName: "Peak_Height" validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} @@ -50,20 +55,24 @@ UM.Dialog } } - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.") - Row { + Row + { width: parent.width - Label { + Label + { text: catalog.i18nc("@action:label", "Base (mm)") width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - TextField { + OldControls.TextField + { id: base_height objectName: "Base_Height" validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} @@ -73,20 +82,24 @@ UM.Dialog } } - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.") - Row { + Row + { width: parent.width - Label { + Label + { text: catalog.i18nc("@action:label", "Width (mm)") width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - TextField { + OldControls.TextField + { id: width objectName: "Width" focus: true @@ -97,19 +110,23 @@ UM.Dialog } } - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate") - Row { + Row + { width: parent.width - Label { + Label + { text: catalog.i18nc("@action:label", "Depth (mm)") width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - TextField { + OldControls.TextField + { id: depth objectName: "Depth" focus: true @@ -120,20 +137,24 @@ UM.Dialog } } - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.") - Row { + Row + { width: parent.width //Empty label so 2 column layout works. - Label { + Label + { text: "" width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - ComboBox { + OldControls.ComboBox + { id: lighter_is_higher objectName: "Lighter_Is_Higher" model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ] @@ -143,19 +164,23 @@ UM.Dialog } } - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.") - Row { + Row + { width: parent.width - Label { + Label + { text: "Color Model" width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - ComboBox { + OldControls.ComboBox + { id: color_model objectName: "ColorModel" model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ] @@ -165,20 +190,24 @@ UM.Dialog } } - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency") - Row { + Row + { width: parent.width - Label { + Label + { text: catalog.i18nc("@action:label", "1mm Transmittance (%)") width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - TextField { + OldControls.TextField + { id: transmittance objectName: "Transmittance" focus: true @@ -189,28 +218,34 @@ UM.Dialog } } - UM.TooltipArea { + UM.TooltipArea + { Layout.fillWidth:true height: childrenRect.height text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.") - Row { + Row + { width: parent.width - Label { + Label + { text: catalog.i18nc("@action:label", "Smoothing") width: 150 * screenScaleFactor anchors.verticalCenter: parent.verticalCenter } - Item { + Item + { width: 180 * screenScaleFactor height: 20 * screenScaleFactor Layout.fillWidth: true - Slider { + Slider + { id: smoothing objectName: "Smoothing" - maximumValue: 100.0 + from: 0.0 + to: 100.0 stepSize: 1.0 width: 180 onValueChanged: { manager.onSmoothingChanged(value) } @@ -221,14 +256,14 @@ UM.Dialog } rightButtons: [ - Button + OldControls.Button { id:ok_button text: catalog.i18nc("@action:button","OK"); onClicked: { manager.onOkButtonClicked() } enabled: true }, - Button + OldControls.Button { id:cancel_button text: catalog.i18nc("@action:button","Cancel"); From 204d965df29f8b699c47e5f271a23c85363224b6 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 18 Jan 2022 17:43:13 +0100 Subject: [PATCH 084/377] Use `SecondaryButton` in the usb print panel inplace of tye style prop The Jog buttons are not changed yet as these button make use of the `checked` property this is not yet implemented for Cura's `Action` and by extension Cura's `Secondary` button. CURA-8684 --- resources/qml/MonitorButton.qml | 8 +- resources/qml/PrinterOutput/ExtruderBox.qml | 103 +------- resources/qml/PrinterOutput/HeatedBedBox.qml | 103 +------- .../PrinterOutput/ManualPrinterControl.qml | 26 +- resources/themes/cura-light/styles.qml | 229 ------------------ 5 files changed, 36 insertions(+), 433 deletions(-) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 40da10dc46..db10b2b2bc 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -266,7 +266,7 @@ Item } } - Button + Cura.SecondaryButton { id: pauseResumeButton @@ -309,11 +309,9 @@ Item activePrintJob.setState("pause"); } } - - style: UM.Theme.styles.print_setup_action_button } - Button + Cura.SecondaryButton { id: abortButton @@ -325,8 +323,6 @@ Item text: catalog.i18nc("@label", "Abort Print") onClicked: confirmationDialog.visible = true - - style: UM.Theme.styles.print_setup_action_button } MessageDialog diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index 63927cd98d..7ccab941b8 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -223,7 +223,7 @@ Item } } - Button //The pre-heat button. + Cura.SecondaryButton { id: preheatButton height: UM.Theme.getSize("setting_control").height @@ -255,96 +255,19 @@ Item anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: UM.Theme.getSize("default_margin").width - style: ButtonStyle { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2) - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - else - { - return UM.Theme.getColor("action_button_border"); - } - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - else - { - return UM.Theme.getColor("action_button"); - } - } - Behavior on color - { - ColorAnimation - { - duration: 50 - } - } - Label - { - id: actualLabel - anchors.centerIn: parent - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - else - { - return UM.Theme.getColor("action_button_text"); - } - } - font: UM.Theme.getFont("medium") - text: - { - if(extruderModel == null) - { - return "" - } - if(extruderModel.isPreheating ) - { - return catalog.i18nc("@button Cancel pre-heating", "Cancel") - } else - { - return catalog.i18nc("@button", "Pre-heat") - } - } - } + text: + { + if(extruderModel == null) + { + return "" + } + if(extruderModel.isPreheating ) + { + return catalog.i18nc("@button Cancel pre-heating", "Cancel") + } else + { + return catalog.i18nc("@button", "Pre-heat") } } diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 2e3e319c89..12e24024c2 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -214,7 +214,7 @@ Item } } - Button // The pre-heat button. + Cura.SecondaryButton // The pre-heat button. { id: preheatButton height: UM.Theme.getSize("setting_control").height @@ -246,96 +246,19 @@ Item anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: UM.Theme.getSize("default_margin").width - style: ButtonStyle { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2) - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - else - { - return UM.Theme.getColor("action_button_border"); - } - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - else - { - return UM.Theme.getColor("action_button"); - } - } - Behavior on color - { - ColorAnimation - { - duration: 50 - } - } - Label - { - id: actualLabel - anchors.centerIn: parent - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - else - { - return UM.Theme.getColor("action_button_text"); - } - } - font: UM.Theme.getFont("medium") - text: - { - if(printerModel == null) - { - return "" - } - if(printerModel.isPreheating ) - { - return catalog.i18nc("@button Cancel pre-heating", "Cancel") - } else - { - return catalog.i18nc("@button", "Pre-heat") - } - } - } + text: + { + if(printerModel == null) + { + return "" + } + if(printerModel.isPreheating ) + { + return catalog.i18nc("@button Cancel pre-heating", "Cancel") + } else + { + return catalog.i18nc("@button", "Pre-heat") } } diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index 57e1b26e72..fa7e3024dd 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -92,14 +92,13 @@ Item Layout.preferredHeight: height } - Button + Cura.SecondaryButton { Layout.row: 1 Layout.column: 1 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleUp"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -109,14 +108,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 2 Layout.column: 0 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleLeft"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -126,14 +124,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 2 Layout.column: 2 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleRight"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -143,14 +140,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 3 Layout.column: 1 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleDown"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -160,14 +156,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 2 Layout.column: 1 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("House"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -192,10 +187,9 @@ Item horizontalAlignment: Text.AlignHCenter } - Button + Cura.SecondaryButton { iconSource: UM.Theme.getIcon("ChevronSingleUp"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -205,10 +199,9 @@ Item } } - Button + Cura.SecondaryButton { iconSource: UM.Theme.getIcon("House"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -218,10 +211,9 @@ Item } } - Button + Cura.SecondaryButton { iconSource: UM.Theme.getIcon("ChevronSingleDown"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -270,8 +262,6 @@ Item checkable: true checked: distancesRow.currentDistance == model.value onClicked: distancesRow.currentDistance = model.value - - style: UM.Theme.styles.monitor_checkable_button_style } } } diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 857f066c39..d65873bfc1 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -372,233 +372,4 @@ QtObject } } } - - property Component print_setup_action_button: Component - { - ButtonStyle - { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - else - { - return UM.Theme.getColor("action_button_border"); - } - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - else - { - return UM.Theme.getColor("action_button"); - } - } - Behavior on color { ColorAnimation { duration: 50 } } - - implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("thick_margin").width * 2) - - Label - { - id: actualLabel - anchors.centerIn: parent - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - else - { - return UM.Theme.getColor("action_button_text"); - } - } - font: UM.Theme.getFont("medium") - text: control.text - } - } - label: Item { } - } - } - - property Component monitor_button_style: Component - { - ButtonStyle - { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(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"); - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(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"); - } - Behavior on color - { - ColorAnimation - { - duration: 50 - } - } - } - - label: Item - { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(control.width / 2) - height: Math.floor(control.height / 2) - sourceSize.height: width - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(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"); - } - source: control.iconSource - } - } - } - } - - property Component monitor_checkable_button_style: Component - { - ButtonStyle { - background: Rectangle { - border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else 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"); - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else 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"); - } - Behavior on color { ColorAnimation { duration: 50; } } - Label { - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else 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"); - } - font: UM.Theme.getFont("default") - text: control.text - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideMiddle - } - } - label: Item { } - } - } } From f2ee58a08bb470379e47e115f1d31a12f74369e0 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 19 Jan 2022 15:37:59 +0100 Subject: [PATCH 085/377] Update `PerObjectCategory` to QtQuick.Controls 2.1 CURA-8684 --- .../PerObjectCategory.qml | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectCategory.qml b/plugins/PerObjectSettingsTool/PerObjectCategory.qml index 58192f0acd..d23b0b9458 100644 --- a/plugins/PerObjectSettingsTool/PerObjectCategory.qml +++ b/plugins/PerObjectSettingsTool/PerObjectCategory.qml @@ -1,10 +1,8 @@ -// Copyright (c) 2015 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.1 import UM 1.1 as UM @@ -13,39 +11,38 @@ import ".." Button { id: base; - style: ButtonStyle { - background: Item { } - label: Row + background: Item { } + + contentItem: Row + { + spacing: UM.Theme.getSize("default_lining").width + + UM.RecolorImage { - spacing: UM.Theme.getSize("default_lining").width - - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - height: (label.height / 2) | 0 - width: height - source: control.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); - color: control.hovered ? palette.highlight : palette.buttonText - } - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - height: label.height - width: height - source: control.iconSource - color: control.hovered ? palette.highlight : palette.buttonText - } - Label - { - id: label - anchors.verticalCenter: parent.verticalCenter - text: control.text - color: control.hovered ? palette.highlight : palette.buttonText - font.bold: true - } - - SystemPalette { id: palette } + anchors.verticalCenter: parent.verticalCenter + height: (label.height / 2) | 0 + width: height + source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); + color: base.hovered ? palette.highlight : palette.buttonText } + UM.RecolorImage + { + anchors.verticalCenter: parent.verticalCenter + height: label.height + width: height + source: UM.Theme.getIcon(definition.icon) + color: base.hovered ? palette.highlight : palette.buttonText + } + Label + { + id: label + anchors.verticalCenter: parent.verticalCenter + text: base.text + color: base.hovered ? palette.highlight : palette.buttonText + font.bold: true + } + + SystemPalette { id: palette } } signal showTooltip(string text); @@ -53,7 +50,6 @@ Button { signal contextMenuRequested() text: definition.label - iconSource: UM.Theme.getIcon(definition.icon) checkable: true checked: definition.expanded From 07095a5802189a19a865ee11056da0ab2b0d42dc Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 20 Jan 2022 22:38:00 +0100 Subject: [PATCH 086/377] Update Material selection and variant selection buttons to QtControls 2 CURA-8684 --- .../ConfigurationMenu/CustomConfiguration.qml | 14 +-- resources/qml/PrintSetupHeaderButton.qml | 104 ++++++++++++++++++ resources/themes/cura-light/styles.qml | 87 --------------- 3 files changed, 110 insertions(+), 95 deletions(-) create mode 100644 resources/qml/PrintSetupHeaderButton.qml diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index bacee0bc24..95026112ba 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.6 import QtQuick.Controls 2.0 -import QtQuick.Controls 1.1 as OldControls import Cura 1.0 as Cura import UM 1.5 as UM @@ -262,7 +261,7 @@ Item width: selectors.textWidth } - OldControls.ToolButton + Cura.PrintSetupHeaderButton { id: materialSelection @@ -276,8 +275,8 @@ Item width: selectors.controlWidth height: parent.height - style: UM.Theme.styles.print_setup_header_button - activeFocusOnPress: true + focusPolicy: ClickFocus + Cura.MaterialMenu { id: materialsMenu @@ -324,15 +323,14 @@ Item width: selectors.textWidth } - OldControls.ToolButton + Cura.PrintSetupHeaderButton { id: variantSelection text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.variant.name : "" tooltip: text height: parent.height width: selectors.controlWidth - style: UM.Theme.styles.print_setup_header_button - activeFocusOnPress: true + focusPolicy: ClickFocus enabled: enabledCheckbox.checked Cura.NozzleMenu diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml new file mode 100644 index 0000000000..c0beac3205 --- /dev/null +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -0,0 +1,104 @@ +// Copyright (c) 2021 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 2.1 + +import Cura 1.0 as Cura +import UM 1.5 as UM + +ToolButton +{ + id: base + + property alias tooltip: tooltip.text + + contentItem: Label {} + + Cura.ToolTip + { + id: tooltip + visible: base.hovered + targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) + } + + background: Rectangle + { + color: + { + if(base.enabled) + { + if(base.valueError) + { + return UM.Theme.getColor("setting_validation_error_background"); + } + else if(base.valueWarning) + { + return UM.Theme.getColor("setting_validation_warning_background"); + } + else + { + return UM.Theme.getColor("setting_control"); + } + } + else + { + return UM.Theme.getColor("setting_control_disabled"); + } + } + + radius: UM.Theme.getSize("setting_control_radius").width + border.width: UM.Theme.getSize("default_lining").width + border.color: + { + if (base.enabled) + { + if (base.valueError) + { + return UM.Theme.getColor("setting_validation_error"); + } + else if (base.valueWarning) + { + return UM.Theme.getColor("setting_validation_warning"); + } + else if (base.hovered) + { + return UM.Theme.getColor("setting_control_border_highlight"); + } + else + { + return UM.Theme.getColor("setting_control_border"); + } + } + else + { + return UM.Theme.getColor("setting_control_disabled_border"); + } + } + 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.height: width + color: base.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") + source: UM.Theme.getIcon("ChevronSingleDown") + } + Label + { + id: printSetupComboBoxLabel + color: base.enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") + text: base.text; + elide: Text.ElideRight; + anchors.left: parent.left; + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width + anchors.right: downArrow.left; + anchors.rightMargin: base.rightMargin; + anchors.verticalCenter: parent.verticalCenter; + font: UM.Theme.getFont("default") + } + } +} diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index d65873bfc1..3ee943195d 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -9,93 +9,6 @@ import UM 1.1 as UM QtObject { - property Component print_setup_header_button: Component - { - ButtonStyle - { - background: Rectangle - { - color: - { - if(control.enabled) - { - if(control.valueError) - { - return UM.Theme.getColor("setting_validation_error_background"); - } - else if(control.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning_background"); - } - else - { - return UM.Theme.getColor("setting_control"); - } - } - else - { - return UM.Theme.getColor("setting_control_disabled"); - } - } - - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (control.enabled) - { - if (control.valueError) - { - return UM.Theme.getColor("setting_validation_error"); - } - else if (control.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning"); - } - else if (control.hovered) - { - return UM.Theme.getColor("setting_control_border_highlight"); - } - else - { - return UM.Theme.getColor("setting_control_border"); - } - } - else - { - return UM.Theme.getColor("setting_control_disabled_border"); - } - } - 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.height: width - color: control.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") - source: UM.Theme.getIcon("ChevronSingleDown") - } - Label - { - id: printSetupComboBoxLabel - color: control.enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - text: control.text; - elide: Text.ElideRight; - anchors.left: parent.left; - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.right: downArrow.left; - anchors.rightMargin: control.rightMargin; - anchors.verticalCenter: parent.verticalCenter; - font: UM.Theme.getFont("default") - } - } - label: Label{} - } - } - property Component tool_button: Component { ButtonStyle From bcd1689680e944082062c61b39a2ec54f96c3bf3 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 20 Jan 2022 22:58:43 +0100 Subject: [PATCH 087/377] Update buttons in per object settings plugin to QtControls 2 CURA-8684 --- .../PerObjectSettingsPanel.qml | 36 +++---- .../PerObjectSettingsTool/ToolBarButton.qml | 79 ++++++++++++++++ resources/themes/cura-light/styles.qml | 93 ------------------- 3 files changed, 94 insertions(+), 114 deletions(-) create mode 100644 plugins/PerObjectSettingsTool/ToolBarButton.qml diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index c97989c449..403dfa499d 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -2,7 +2,8 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 2.1 +import QtQuick.Controls 1.2 as OldControls import QtQuick.Controls.Styles 1.2 import UM 1.5 as UM @@ -76,7 +77,7 @@ Item id: meshTypeButtons spacing: UM.Theme.getSize("default_margin").width - Button + ToolBarButton { id: normalButton text: catalog.i18nc("@label", "Normal model") @@ -84,11 +85,10 @@ Item property bool needBorder: true checkable: true onClicked: setMeshType(normalMeshType); - style: UM.Theme.styles.tool_button; z: 4 } - Button + ToolBarButton { id: supportMeshButton text: catalog.i18nc("@label", "Print as support") @@ -96,11 +96,10 @@ Item property bool needBorder: true checkable:true onClicked: setMeshType(supportMeshType) - style: UM.Theme.styles.tool_button; z: 3 } - Button + ToolBarButton { id: overlapMeshButton text: catalog.i18nc("@label", "Modify settings for overlaps") @@ -108,11 +107,10 @@ Item property bool needBorder: true checkable:true onClicked: setMeshType(infillMeshType) - style: UM.Theme.styles.tool_button; z: 2 } - Button + ToolBarButton { id: antiOverhangMeshButton text: catalog.i18nc("@label", "Don't support overlaps") @@ -120,7 +118,6 @@ Item property bool needBorder: true checkable: true onClicked: setMeshType(antiOverhangMeshType) - style: UM.Theme.styles.tool_button; z: 1 } @@ -179,7 +176,7 @@ Item height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight) visible: currentMeshType != "anti_overhang_mesh" - ScrollView + OldControls.ScrollView { height: parent.height width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width @@ -292,19 +289,16 @@ Item onClicked: addedSettingsModel.setVisible(model.key, false) - style: ButtonStyle + background: Item { - background: Item + UM.RecolorImage { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - width: parent.width - height: 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") - } + anchors.verticalCenter: parent.verticalCenter + width: parent.width + height: width + sourceSize.height: width + color: parent.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") + source: UM.Theme.getIcon("Minus") } } } diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml new file mode 100644 index 0000000000..5e2479a73f --- /dev/null +++ b/plugins/PerObjectSettingsTool/ToolBarButton.qml @@ -0,0 +1,79 @@ +// Copyright (c) 2021 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 2.1 + +import Cura 1.0 as Cura +import UM 1.5 as UM + +ToolButton +{ + id: base + + property alias tooltip: tooltip.text + property alias iconSource: icon.source; + + Cura.ToolTip + { + id: tooltip + visible: base.hovered + targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) + } + + + background: Item + { + implicitWidth: UM.Theme.getSize("button").width + implicitHeight: UM.Theme.getSize("button").height + + Rectangle + { + id: buttonFace + + anchors.fill: parent + property bool down: base.pressed || (base.checkable && base.checked) + + color: + { + if(base.customColor !== undefined && base.customColor !== null) + { + return base.customColor + } + else if(base.checkable && base.checked && base.hovered) + { + return UM.Theme.getColor("toolbar_button_active_hover") + } + else if(base.pressed || (base.checkable && base.checked)) + { + return UM.Theme.getColor("toolbar_button_active") + } + else if(base.hovered) + { + return UM.Theme.getColor("toolbar_button_hover") + } + return UM.Theme.getColor("toolbar_background") + } + Behavior on color { ColorAnimation { duration: 50; } } + + border.width: (base.hasOwnProperty("needBorder") && base.needBorder) ? UM.Theme.getSize("default_lining").width : 0 + border.color: base.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") + } + } + + contentItem: Item + { + UM.RecolorImage + { + id: icon + + anchors.centerIn: parent + opacity: base.enabled ? 1.0 : 0.2 + width: UM.Theme.getSize("medium_button_icon").width + height: UM.Theme.getSize("medium_button_icon").height + color: UM.Theme.getColor("icon") + + sourceSize: UM.Theme.getSize("medium_button_icon") + } + } +} \ No newline at end of file diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 3ee943195d..d9932c1973 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -9,99 +9,6 @@ import UM 1.1 as UM QtObject { - property Component tool_button: Component - { - ButtonStyle - { - background: Item - { - implicitWidth: UM.Theme.getSize("button").width - implicitHeight: UM.Theme.getSize("button").height - - UM.PointingRectangle - { - id: button_tooltip - - anchors.left: parent.right - anchors.leftMargin: UM.Theme.getSize("button_tooltip_arrow").width * 2 - anchors.verticalCenter: parent.verticalCenter - - target: Qt.point(parent.x, y + Math.round(height/2)) - arrowSize: UM.Theme.getSize("button_tooltip_arrow").width - color: UM.Theme.getColor("button_tooltip") - opacity: control.hovered ? 1.0 : 0.0; - visible: control.text != "" - - width: control.hovered ? button_tip.width + UM.Theme.getSize("button_tooltip").width : 0 - height: UM.Theme.getSize("button_tooltip").height - - Behavior on width { NumberAnimation { duration: 100; } } - Behavior on opacity { NumberAnimation { duration: 100; } } - - Label - { - id: button_tip - - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - - text: control.text - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("tooltip_text") - } - } - - Rectangle - { - id: buttonFace - - anchors.fill: parent - property bool down: control.pressed || (control.checkable && control.checked) - - color: - { - if(control.customColor !== undefined && control.customColor !== null) - { - return control.customColor - } - else if(control.checkable && control.checked && control.hovered) - { - return UM.Theme.getColor("toolbar_button_active_hover") - } - else if(control.pressed || (control.checkable && control.checked)) - { - return UM.Theme.getColor("toolbar_button_active") - } - else if(control.hovered) - { - return UM.Theme.getColor("toolbar_button_hover") - } - return UM.Theme.getColor("toolbar_background") - } - Behavior on color { ColorAnimation { duration: 50; } } - - border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? UM.Theme.getSize("default_lining").width : 0 - border.color: control.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") - } - } - - label: Item - { - UM.RecolorImage - { - anchors.centerIn: parent - opacity: control.enabled ? 1.0 : 0.2 - source: control.iconSource - width: UM.Theme.getSize("medium_button_icon").width - height: UM.Theme.getSize("medium_button_icon").height - color: UM.Theme.getColor("icon") - - sourceSize: UM.Theme.getSize("medium_button_icon") - } - } - } - } - property Component progressbar: Component { ProgressBarStyle From ee38c9c05b53cb999f7b60ea71ddc6dc07bd7840 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 12:24:40 +0100 Subject: [PATCH 088/377] Update QtControls to v2.0 in image reader plugin CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index a3dceed50d..43d932f790 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2015 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 @@ -210,7 +210,7 @@ UM.Dialog Slider { id: smoothing objectName: "Smoothing" - maximumValue: 100.0 + to: 100.0 stepSize: 1.0 width: 180 onValueChanged: { manager.onSmoothingChanged(value) } From 092936ae3a8616e05a45d1407d067f061bb814bd Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 13:06:51 +0100 Subject: [PATCH 089/377] Update Buttons to QtControls 2.0 in general preferences page CURA-8684 --- resources/qml/Preferences/GeneralPage.qml | 27 +++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index db0c8e2d23..f7c19cd27d 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -2,11 +2,10 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.1 +import QtQuick.Controls 1.1 as OldControls +import QtQuick.Controls 2.3 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.3 as NewControls - import UM 1.1 as UM import Cura 1.1 as Cura @@ -125,7 +124,7 @@ UM.PreferencesPage pluginNotificationsUpdateCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check")) } - ScrollView + OldControls.ScrollView { width: parent.width height: parent.height @@ -186,7 +185,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: languageComboBox @@ -240,7 +239,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: themeComboBox @@ -516,7 +515,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: cameraComboBox @@ -673,7 +672,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ") } - NewControls.ComboBox + ComboBox { id: choiceOnOpenProjectDropDownButton width: Math.round(250 * screenScaleFactor) @@ -740,7 +739,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ") } - NewControls.ComboBox + ComboBox { id: choiceOnProfileOverrideDropDownButton width: Math.round(250 * screenScaleFactor) @@ -843,7 +842,11 @@ UM.PreferencesPage } } - ExclusiveGroup { id: curaUpdatesGroup } + ButtonGroup { + id: curaUpdatesGroup + buttons: [checkUpdatesOptionBeta, checkUpdatesOptionStable] + } + UM.TooltipArea { width: childrenRect.width @@ -853,8 +856,8 @@ UM.PreferencesPage anchors.leftMargin: UM.Theme.getSize("default_margin").width RadioButton { + id: checkUpdatesOptionStable text: catalog.i18nc("@option:radio", "Stable releases only") - exclusiveGroup: curaUpdatesGroup enabled: checkUpdatesCheckbox.checked checked: UM.Preferences.getValue("info/latest_update_source") == "stable" onClicked: UM.Preferences.setValue("info/latest_update_source", "stable") @@ -869,8 +872,8 @@ UM.PreferencesPage anchors.leftMargin: UM.Theme.getSize("default_margin").width RadioButton { + id: checkUpdatesOptionBeta text: catalog.i18nc("@option:radio", "Stable and Beta releases") - exclusiveGroup: curaUpdatesGroup enabled: checkUpdatesCheckbox.checked checked: UM.Preferences.getValue("info/latest_update_source") == "beta" onClicked: UM.Preferences.setValue("info/latest_update_source", "beta") From 09793854ef92ccf2bd745fc4cba3906a405b5143 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 13:38:58 +0100 Subject: [PATCH 090/377] Update Buttons to QtControls 2.0 in per model settings dialog CURA-8684 --- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 18f36b2651..0e9202a900 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -1,5 +1,9 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Uranium is released under the terms of the LGPLv3 or higher. + import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 1.2 as OldControls +import QtQuick.Controls 2.0 import UM 1.2 as UM import Cura 1.0 as Cura @@ -67,7 +71,7 @@ UM.Dialog text: catalog.i18nc("@label:checkbox", "Show all") } - ScrollView + OldControls.ScrollView { id: scrollView From 8cc1604b2f6e102dca572a941ab019e83e66d7b6 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 14:07:41 +0100 Subject: [PATCH 091/377] Update Buttons to QtControls 2.0 in the simulation view expend menu bar CURA-8684 --- .../SimulationViewMenuComponent.qml | 54 ++++++++++++++++-- resources/themes/cura-light/styles.qml | 55 ------------------- 2 files changed, 50 insertions(+), 59 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 6addaa6dc5..e40f7d0e4b 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -1,10 +1,9 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.4 import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.0 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.1 import QtGraphicalEffects 1.0 import UM 1.5 as UM @@ -133,7 +132,54 @@ Cura.ExpandableComponent width: parent.width model: layerViewTypes visible: !UM.SimulationView.compatibilityMode - style: UM.Theme.styles.combobox + + background: Rectangle + { + implicitHeight: UM.Theme.getSize("setting_control").height; + implicitWidth: UM.Theme.getSize("setting_control").width; + + color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") + Behavior on color { ColorAnimation { duration: 50; } } + + border.width: UM.Theme.getSize("default_lining").width; + border.color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border"); + radius: UM.Theme.getSize("setting_control_radius").width + } + + contentItem: Item + { + Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.right: downArrow.left + anchors.rightMargin: UM.Theme.getSize("default_lining").width + anchors.verticalCenter: parent.verticalCenter + + text: ladyerTypeCombobox.currentText + font: UM.Theme.getFont("default"); + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + + UM.RecolorImage + { + id: downArrow + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 + anchors.verticalCenter: parent.verticalCenter + + source: UM.Theme.getIcon("ChevronSingleDown") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor + + color: UM.Theme.getColor("setting_control_button"); + } + } onActivated: { diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index d9932c1973..11dd2a70eb 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -88,61 +88,6 @@ QtObject } } - property Component combobox: Component - { - ComboBoxStyle - { - - background: Rectangle - { - implicitHeight: UM.Theme.getSize("setting_control").height; - implicitWidth: UM.Theme.getSize("setting_control").width; - - color: control.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") - Behavior on color { ColorAnimation { duration: 50; } } - - border.width: UM.Theme.getSize("default_lining").width; - border.color: control.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border"); - radius: UM.Theme.getSize("setting_control_radius").width - } - - label: Item - { - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter - - text: control.currentText - font: UM.Theme.getFont("default"); - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") - - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.verticalCenter: parent.verticalCenter - - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_button"); - } - } - } - } - property Component partially_checkbox: Component { CheckBoxStyle From 0f61e25a77e6259291112d07f1b49315d2ae9d03 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 21 Jan 2022 17:07:10 +0100 Subject: [PATCH 092/377] Fix anchoring width of network printer view to scrollbar You can't anchor to something that's not a parent or sibling, and the scrollbar was an... uncle? Contributes to issue CURA-8686. --- resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 752ad64f98..64f194dd56 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -69,8 +69,7 @@ Item { anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.right: networkPrinterScrollBar.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width + width: parent.width - networkPrinterScrollBar.width - UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height text: section color: UM.Theme.getColor("small_button_text") From 582e4fcbd09f280864d211211380fe1e4b32093b Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 10:31:17 +0100 Subject: [PATCH 093/377] Update print action hotkey listener to QtControls 2 CURA-8684 --- resources/qml/ActionPanel/SliceProcessWidget.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 99d78537c3..868f23d242 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -1,10 +1,9 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 2.1 +import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 -import QtQuick.Controls 1.4 as Controls1 import UM 1.4 as UM import Cura 1.0 as Cura @@ -122,7 +121,9 @@ Column tooltip: catalog.i18nc("@label", "Start the slicing process") enabled: widget.backendState != UM.Backend.Error && !widget.waitingForSliceToStart visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error - onClicked: sliceOrStopSlicing() + onClicked: { + sliceOrStopSlicing() + } } Cura.SecondaryButton @@ -136,7 +137,9 @@ Column text: catalog.i18nc("@button", "Cancel") enabled: sliceButton.enabled visible: !sliceButton.visible - onClicked: sliceOrStopSlicing() + onClicked: { + sliceOrStopSlicing() + } } } @@ -165,7 +168,7 @@ Column } // Shortcut for "slice/stop" - Controls1.Action + Action { shortcut: "Ctrl+P" onTriggered: From 9e5fd998f4df2adf9aa503b3709f45b2e68673a0 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 14:11:02 +0100 Subject: [PATCH 094/377] Update open files dialog to QtControls 2 CURA-8684 --- .../OpenFilesIncludingProjectsDialog.qml | 73 +++++++++---------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 3f1900c66b..08d10bbfff 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 @@ -69,45 +68,43 @@ UM.Dialog width: height } - // Buttons - Item - { - anchors.right: parent.right - anchors.left: parent.left - height: childrenRect.height - - Button - { - id: cancelButton - text: catalog.i18nc("@action:button", "Cancel"); - anchors.right: importAllAsModelsButton.left - onClicked: - { - // cancel - base.hide(); - } - } - - Button - { - id: importAllAsModelsButton - text: catalog.i18nc("@action:button", "Import all as models"); - anchors.right: parent.right - isDefault: true - onClicked: - { - // load models from all selected file - loadModelFiles(base.fileUrls); - - base.hide(); - } - } - } - UM.I18nCatalog { id: catalog name: "cura" } + + ButtonGroup { + buttons: [cancelButton, importAllAsModelsButton] + checkedButton: importAllAsModelsButton + } } + + onAccepted: loadModelFiles(base.fileUrls) + + // Buttons + rightButtons: + [ + Button + { + id: cancelButton + text: catalog.i18nc("@action:button", "Cancel"); + onClicked: + { + // cancel + base.hide(); + } + }, + Button + { + id: importAllAsModelsButton + text: catalog.i18nc("@action:button", "Import all as models"); + onClicked: + { + // load models from all selected file + loadModelFiles(base.fileUrls); + base.hide(); + } + } + ] } \ No newline at end of file From 4c0ee058e43665d7ace0ec8c262a90558508c378 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 18:21:52 +0100 Subject: [PATCH 095/377] Update discard keep or discard changes dialog to QtControls 2 CURA-8684 --- .../DiscardOrKeepProfileChangesDialog.qml | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 0a9d317d2d..140efe8c5c 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -1,9 +1,9 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls 2.15 as NewControls +import QtQuick.Controls 1.1 as OldControls +import QtQuick.Controls 2.15 import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 @@ -15,6 +15,9 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Discard or Keep changes") + onAccepted: CuraApplication.discardOrKeepProfileChangesClosed("discard") + onRejected: CuraApplication.discardOrKeepProfileChangesClosed("keep") + minimumWidth: UM.Theme.getSize("popup_dialog").width minimumHeight: UM.Theme.getSize("popup_dialog").height property var changesModel: Cura.UserChangesModel{ id: userChangesModel} @@ -44,7 +47,6 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left anchors.right: parent.right - anchors.top: parent.top spacing: UM.Theme.getSize("default_margin").width UM.I18nCatalog @@ -68,7 +70,7 @@ UM.Dialog anchors.bottom: optionRow.top anchors.left: parent.left anchors.right: parent.right - TableView + OldControls.TableView { anchors.fill: parent height: base.height - 150 @@ -106,21 +108,21 @@ UM.Dialog } } - TableViewColumn + OldControls.TableViewColumn { role: "label" title: catalog.i18nc("@title:column", "Profile settings") delegate: labelDelegate width: (tableView.width * 0.4) | 0 } - TableViewColumn + OldControls.TableViewColumn { role: "original_value" title: Cura.MachineManager.activeQualityDisplayNameMap["main"] width: (tableView.width * 0.3) | 0 delegate: defaultDelegate } - TableViewColumn + OldControls.TableViewColumn { role: "user_value" title: catalog.i18nc("@title:column", "Current changes") @@ -140,13 +142,13 @@ UM.Dialog Item { id: optionRow - anchors.bottom: buttonsRow.top + anchors.bottom: parent.bottom anchors.right: parent.right anchors.left: parent.left anchors.margins: UM.Theme.getSize("default_margin").width height: childrenRect.height - NewControls.ComboBox + ComboBox { id: discardOrKeepProfileChangesDropDownButton width: 300 @@ -186,37 +188,33 @@ UM.Dialog Item { - id: buttonsRow - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: parent.left - anchors.margins: UM.Theme.getSize("default_margin").width - height: childrenRect.height + ButtonGroup + { + buttons: [discardButton, keepButton] + checkedButton: discardButton + } + } + rightButtons: [ Button { id: discardButton text: catalog.i18nc("@action:button", "Discard changes"); - anchors.right: parent.right onClicked: { CuraApplication.discardOrKeepProfileChangesClosed("discard") base.hide() } - isDefault: true - } - + }, Button { id: keepButton text: catalog.i18nc("@action:button", "Keep changes"); - anchors.right: discardButton.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width onClicked: { CuraApplication.discardOrKeepProfileChangesClosed("keep") base.hide() } } - } + ] } From b45707af54a456f42b5803c7080c3f3467de0e85 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 21:58:23 +0100 Subject: [PATCH 096/377] Update ask open project or models dialog to QtControls 2 CURA-8684 --- .../AskOpenAsProjectOrModelsDialog.qml | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 4890f79210..725b25e1e1 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 @@ -97,29 +97,32 @@ UM.Dialog text: catalog.i18nc("@text:window", "Remember my choice") checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask" } + } - // Buttons - Item { - id: buttonBar - anchors.right: parent.right - anchors.left: parent.left - height: childrenRect.height - - Button { - id: openAsProjectButton - text: catalog.i18nc("@action:button", "Open as project") - anchors.right: importModelsButton.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width - isDefault: true - onClicked: loadProjectFile() - } - - Button { - id: importModelsButton - text: catalog.i18nc("@action:button", "Import models") - anchors.right: parent.right - onClicked: loadModelFiles() - } + Item + { + ButtonGroup + { + buttons: [openAsProjectButton, importModelsButton] + checkedButton: openAsProjectButton } } + + onAccepted: loadProjectFile() + onRejected: loadModelFiles() + + rightButtons: [ + Button + { + id: openAsProjectButton + text: catalog.i18nc("@action:button", "Open as project") + onClicked: loadProjectFile() + }, + Button + { + id: importModelsButton + text: catalog.i18nc("@action:button", "Import models") + onClicked: loadModelFiles() + } + ] } From 3e98282871fe8c097068f864567ab4a4b7c9f04d Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 22:31:36 +0100 Subject: [PATCH 097/377] Update material preferences page to QtControls 2 CURA-8684 --- .../Preferences/Materials/MaterialsPage.qml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 6ec23f001f..20688c0b1b 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -2,7 +2,8 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 1.4 as OldControls +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 @@ -106,7 +107,7 @@ Item { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate") - iconName: "list-activate" + icon.name: "list-activate" enabled: !isCurrentItemActivated && Cura.MachineManager.activeMachine.hasMaterials onClicked: { @@ -124,7 +125,7 @@ Item { id: createMenuButton text: catalog.i18nc("@action:button", "Create") - iconName: "list-add" + icon.name: "list-add" enabled: Cura.MachineManager.activeMachine.hasMaterials onClicked: { @@ -139,7 +140,7 @@ Item { id: duplicateMenuButton text: catalog.i18nc("@action:button", "Duplicate"); - iconName: "list-add" + icon.name: "list-add" enabled: base.hasCurrentItem onClicked: { @@ -154,7 +155,7 @@ Item { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove") - iconName: "list-remove" + icon.name: "list-remove" enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && base.materialManagementModel.canMaterialBeRemoved(base.currentItem.container_node) onClicked: @@ -169,7 +170,7 @@ Item { id: importMenuButton text: catalog.i18nc("@action:button", "Import") - iconName: "document-import" + icon.name: "document-import" onClicked: { forceActiveFocus(); @@ -183,7 +184,7 @@ Item { id: exportMenuButton text: catalog.i18nc("@action:button", "Export") - iconName: "document-export" + icon.name: "document-export" onClicked: { forceActiveFocus(); @@ -197,7 +198,7 @@ Item { id: syncMaterialsButton text: catalog.i18nc("@action:button Sending materials to printers", "Sync with Printers") - iconName: "sync-synchronizing" + icon.name: "sync-synchronizing" onClicked: { forceActiveFocus(); @@ -261,7 +262,7 @@ Item elide: Text.ElideRight } - ScrollView + OldControls.ScrollView { id: materialScrollView anchors From b6e375a3bed4dfa7c0f4d71e66376963c71ae7fd Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 22:34:14 +0100 Subject: [PATCH 098/377] Update machines preferences page to QtControls 2 CURA-8684 --- resources/qml/Preferences/MachinesPage.qml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index a6acfa0566..aa5b275501 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 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 2.1 import QtQuick.Window 2.1 import UM 1.5 as UM @@ -38,7 +38,7 @@ UM.ManagementPage { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate"); - iconName: "list-activate"; + icon.name: "list-activate"; enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachine.id onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id) }, @@ -46,14 +46,14 @@ UM.ManagementPage { id: addMenuButton text: catalog.i18nc("@action:button", "Add"); - iconName: "list-add"; + icon.name: "list-add"; onClicked: Cura.Actions.addMachine.trigger() }, Button { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove"); - iconName: "list-remove"; + icon.name: "list-remove"; enabled: base.currentItem != null && model.count > 1 onClicked: confirmDialog.open(); }, @@ -61,7 +61,7 @@ UM.ManagementPage { id: renameMenuButton text: catalog.i18nc("@action:button", "Rename"); - iconName: "edit-rename"; + icon.name: "edit-rename"; enabled: base.currentItem != null && base.currentItem.metadata.group_name == null onClicked: renameDialog.open(); } @@ -125,7 +125,7 @@ UM.ManagementPage rightButtons: Button { text: catalog.i18nc("@action:button", "Close") - iconName: "dialog-close" + icon.name: "dialog-close" onClicked: actionDialog.reject() } } From 6dc535063b41d1b374cbf6f976ffb66329bc39f3 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 22:37:39 +0100 Subject: [PATCH 099/377] Update profiles preferences page to QtControls 2 CURA-8684 --- resources/qml/Preferences/ProfilesPage.qml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 9144d4dbe1..5176b4c188 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -2,7 +2,8 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 1.4 as OldControls +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 @@ -82,7 +83,7 @@ Item { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate") - iconName: "list-activate" + icon.name: "list-activate" enabled: !isCurrentItemActivated && base.currentItem onClicked: { @@ -102,7 +103,7 @@ Item { id: createMenuButton text: catalog.i18nc("@label", "Create") - iconName: "list-add" + icon.name: "list-add" enabled: base.canCreateProfile && !Cura.MachineManager.stacksHaveErrors visible: base.canCreateProfile @@ -119,7 +120,7 @@ Item { id: duplicateMenuButton text: catalog.i18nc("@label", "Duplicate") - iconName: "list-add" + icon.name: "list-add" enabled: !base.canCreateProfile visible: !base.canCreateProfile @@ -136,7 +137,7 @@ Item { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove") - iconName: "list-remove" + icon.name: "list-remove" enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated onClicked: { @@ -150,7 +151,7 @@ Item { id: renameMenuButton text: catalog.i18nc("@action:button", "Rename") - iconName: "edit-rename" + icon.name: "edit-rename" enabled: base.hasCurrentItem && !base.currentItem.is_read_only onClicked: { @@ -165,7 +166,7 @@ Item { id: importMenuButton text: catalog.i18nc("@action:button", "Import") - iconName: "document-import" + icon.name: "document-import" onClicked: { importDialog.open(); @@ -177,7 +178,7 @@ Item { id: exportMenuButton text: catalog.i18nc("@action:button", "Export") - iconName: "document-export" + icon.name: "document-export" enabled: base.hasCurrentItem && !base.currentItem.is_read_only onClicked: { @@ -401,7 +402,7 @@ Item elide: Text.ElideRight } - ScrollView + OldControls.ScrollView { id: profileScrollView anchors @@ -594,7 +595,7 @@ Item } } - TabView + OldControls.TabView { anchors.left: parent.left anchors.top: profileNotices.visible ? profileNotices.bottom : profileNotices.anchors.top From b47c7c9395f51a0c3cf1d6f368b795ca3c901d17 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 23:28:25 +0100 Subject: [PATCH 100/377] Update materials view preference menu to QtControls 2 CURA-8684 --- .../Preferences/Materials/MaterialsView.qml | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 2c68973e55..aca8af0cda 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -1,8 +1,9 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2022 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 2.1 +import QtQuick.Controls 1.4 as OldControls import QtQuick.Dialogs 1.2 import UM 1.2 as UM @@ -10,7 +11,7 @@ import Cura 1.0 as Cura import ".." // Access to ReadOnlyTextArea.qml -TabView +OldControls.TabView { id: base @@ -67,13 +68,13 @@ TabView } } - Tab + OldControls.Tab { title: catalog.i18nc("@title", "Information") anchors.margins: UM.Theme.getSize("default_margin").width - ScrollView + OldControls.ScrollView { id: scrollView anchors.fill: parent @@ -262,13 +263,25 @@ TabView id: spoolCostSpinBox width: scrollView.columnWidth value: base.getMaterialPreferenceValue(properties.guid, "spool_cost") - prefix: base.currency + " " - decimals: 2 - maximumValue: 100000000 + to: 100000000 + editable: true + + property int decimals: 2 + + valueFromText: function(text) { + // remove all non-number tokens from input string so value can be parsed correctly + var value = Number(text.replace(/[^0-9.-]+/g, "")); + var precision = Math.pow(10, spoolCostSpinBox.decimals); + return Math.round(value * precision) / precision; + } + + textFromValue: function(value) { + return base.currency + " " + value.toFixed(spoolCostSpinBox.decimals) + } onValueChanged: { - base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value)) + base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value, decimals)) updateCostPerMeter() } } @@ -279,10 +292,19 @@ TabView id: spoolWeightSpinBox width: scrollView.columnWidth value: base.getMaterialPreferenceValue(properties.guid, "spool_weight", Cura.ContainerManager.getContainerMetaDataEntry(properties.container_id, "properties/weight")) - suffix: " g" stepSize: 100 - decimals: 0 - maximumValue: 10000 + to: 10000 + editable: true + + valueFromText: function(text, locale) { + // remove all non-number tokens from input string so value can be parsed correctly + var value = Number(text.replace(/[^0-9.-]+/g, "")); + return Math.round(value); + } + + textFromValue: function(value, locale) { + return value + " g" + } onValueChanged: { @@ -369,7 +391,7 @@ TabView } } - Tab + OldControls.Tab { title: catalog.i18nc("@label", "Print settings") anchors @@ -380,7 +402,7 @@ TabView rightMargin: 0 } - ScrollView + OldControls.ScrollView { anchors.fill: parent; From c63b94375d973a2ed46181157ba9c932b0195ec6 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 23:34:38 +0100 Subject: [PATCH 101/377] Update materials slot preference menu to QtControls 2 CURA-8684 --- resources/qml/Preferences/Materials/MaterialsSlot.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSlot.qml b/resources/qml/Preferences/Materials/MaterialsSlot.qml index c80d2f2093..52728181b6 100644 --- a/resources/qml/Preferences/Materials/MaterialsSlot.qml +++ b/resources/qml/Preferences/Materials/MaterialsSlot.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 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 2.1 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 From d3f01034a2b3afe9de47c38d02ff35982cb4452a Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 25 Jan 2022 10:54:09 +0100 Subject: [PATCH 102/377] Highight default action and listen to keyboard actions in image dialog CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 43d932f790..1195f0c046 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -220,20 +220,30 @@ UM.Dialog } } + Item + { + ButtonGroup + { + buttons: [ok_button, cancel_button] + checkedButton: ok_button + } + } + + onAccepted: manager.onOkButtonClicked() + onRejected: manager.onCancelButtonClicked() + rightButtons: [ Button { id:ok_button text: catalog.i18nc("@action:button","OK"); - onClicked: { manager.onOkButtonClicked() } - enabled: true + onClicked: manager.onOkButtonClicked() }, Button { id:cancel_button text: catalog.i18nc("@action:button","Cancel"); - onClicked: { manager.onCancelButtonClicked() } - enabled: true + onClicked: manager.onCancelButtonClicked() } ] } From 5f101e8233b2d3ce07f168a6ff889cd374bf61fa Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 11:58:44 +0100 Subject: [PATCH 103/377] Set checked tab for TabRowButton We're changing this so that the button doesn't set this by itself. This is necessary so that I can use this TabRowButton also when it's not in a repeater (for the global stack in the profile manager). Contributes to issue CURA-8686. --- plugins/MachineSettingsAction/MachineSettingsAction.qml | 5 +++-- .../qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 5 +++-- resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index 8c4c00a3a5..0f0ffac8cd 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -1,5 +1,5 @@ -// Copyright (c) 2019 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. +//Copyright (c) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 2.3 @@ -111,6 +111,7 @@ Cura.MachineAction model: tabNameModel delegate: UM.TabRowButton { + checked: model.index == 0 text: model.name } } diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index bacee0bc24..4069341f25 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -1,5 +1,5 @@ -// Copyright (c) 2019 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. +//Copyright (c) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.6 import QtQuick.Controls 2.0 @@ -92,6 +92,7 @@ Item model: extrudersModel delegate: UM.TabRowButton { + checked: model.index == 0 contentItem: Item { Cura.ExtruderIcon diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index 16356e2c69..2925a10f17 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -1,5 +1,5 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. +//Copyright (c) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 2.3 @@ -213,6 +213,7 @@ Item model: extrudersModel delegate: UM.TabRowButton { + checked: model.index == 0 contentItem: Item { Cura.ExtruderIcon From 50960ce5cf720fdc13c024d5ccf162d62708fa14 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 12:09:59 +0100 Subject: [PATCH 104/377] Use UM.TabRow instead of a tab view This styles it for us automatically. However the contents of the tab disappears now. I'll have to restore that, but since that moves a bunch of code I'd rather do that in a separate commit. I also changed the item to a column so that we don't have to link up the anchors very weirdly/difficulty with all of the buttons and messages that are optional. This just automatically makes space if there need to be extra buttons and messages in between, and even deals with the spacing correctly. Contributes to issue CURA-8686. --- resources/qml/Preferences/ProfilesPage.qml | 69 ++++++++-------------- 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 72bd2df00f..bfab7d7d52 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -519,9 +519,11 @@ Item right: parent.right } - Item + Column { anchors.fill: parent + + spacing: UM.Theme.getSize("default_margin").height visible: base.currentItem != null Item // Profile title Label @@ -545,11 +547,9 @@ Item Flow { id: currentSettingsActions + width: parent.width + visible: base.hasCurrentItem && base.currentItem.name == Cura.MachineManager.activeQualityOrQualityChangesName && base.currentItem.intent_category == Cura.MachineManager.activeIntentCategory - anchors.left: parent.left - anchors.right: parent.right - anchors.top: profileName.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height Button { @@ -566,58 +566,37 @@ Item } } - Column + Label { - id: profileNotices - anchors.top: currentSettingsActions.visible ? currentSettingsActions.bottom : currentSettingsActions.anchors.top - anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.left: parent.left - anchors.right: parent.right - spacing: UM.Theme.getSize("default_margin").height - - Label - { - id: defaultsMessage - visible: false - text: catalog.i18nc("@action:label", "This profile uses the defaults specified by the printer, so it has no settings/overrides in the list below.") - wrapMode: Text.WordWrap - width: parent.width - } - Label - { - id: noCurrentSettingsMessage - visible: base.isCurrentItemActivated && !Cura.MachineManager.hasUserSettings - text: catalog.i18nc("@action:label", "Your current settings match the selected profile.") - wrapMode: Text.WordWrap - width: parent.width - } + id: defaultsMessage + visible: false + text: catalog.i18nc("@action:label", "This profile uses the defaults specified by the printer, so it has no settings/overrides in the list below.") + wrapMode: Text.WordWrap + width: parent.width + } + Label + { + id: noCurrentSettingsMessage + visible: base.isCurrentItemActivated && !Cura.MachineManager.hasUserSettings + text: catalog.i18nc("@action:label", "Your current settings match the selected profile.") + wrapMode: Text.WordWrap + width: parent.width } - OldControls.TabView + UM.TabRow { - anchors.left: parent.left - anchors.top: profileNotices.visible ? profileNotices.bottom : profileNotices.anchors.top - anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.right: parent.right - anchors.bottom: parent.bottom - - currentIndex: 0 - - ProfileTab + UM.TabRowButton //One extra tab for the global settings. { - title: catalog.i18nc("@title:tab", "Global Settings") - qualityItem: base.currentItem + text: catalog.i18nc("@title:tab", "Global Settings") } Repeater { model: base.extrudersModel - ProfileTab + UM.TabRowButton { - title: model.name - extruderPosition: model.index - qualityItem: base.currentItem + text: model.name } } } From cfafdf878ac41f45f6d18d5c0652ffd08382936d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 13:34:13 +0100 Subject: [PATCH 105/377] Move contents of ProfileTab to ProfileOverview file This way it is re-useable, and no longer connected to the concept of a tab view. We can then display it in the profile manager. Contributes to issue CURA-8686. --- resources/qml/Preferences/ProfileTab.qml | 118 --------------------- resources/qml/Preferences/ProfilesPage.qml | 28 ++++- resources/qml/ProfileOverview.qml | 110 +++++++++++++++++++ resources/qml/qmldir | 1 + 4 files changed, 136 insertions(+), 121 deletions(-) delete mode 100644 resources/qml/Preferences/ProfileTab.qml create mode 100644 resources/qml/ProfileOverview.qml diff --git a/resources/qml/Preferences/ProfileTab.qml b/resources/qml/Preferences/ProfileTab.qml deleted file mode 100644 index 3c0c46ed72..0000000000 --- a/resources/qml/Preferences/ProfileTab.qml +++ /dev/null @@ -1,118 +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 UM 1.2 as UM -import Cura 1.0 as Cura - -Tab -{ - id: base - - property int extruderPosition: -1 //Denotes the global stack. - property var qualityItem: null - - property bool isQualityItemCurrentlyActivated: - { - if (qualityItem == null) - { - return false; - } - return qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName; - } - - TableView - { - anchors.fill: parent - anchors.margins: UM.Theme.getSize("default_margin").width - id: profileSettingsView - - Component - { - id: itemDelegate - - UM.TooltipArea - { - property var setting: qualitySettings.getItem(styleData.row) - height: childrenRect.height - width: (parent != null) ? parent.width : 0 - text: - { - if (styleData.value === undefined) - { - return "" - } - return (styleData.value.substr(0,1) == "=") ? styleData.value : "" - } - - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.right: parent.right - text: - { - if (styleData.value === undefined) - { - return "" - } - return (styleData.value.substr(0,1) == "=") ? catalog.i18nc("@info:status", "Calculated") : styleData.value - } - font.strikeout: styleData.column == 1 && setting.user_value != "" && base.isQualityItemCurrentlyActivated - font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "" && base.isQualityItemCurrentlyActivated) - opacity: font.strikeout ? 0.5 : 1 - color: styleData.textColor - elide: Text.ElideRight - } - } - } - - TableViewColumn - { - role: "label" - title: catalog.i18nc("@title:column", "Setting") - width: (parent.width * 0.4) | 0 - delegate: itemDelegate - } - TableViewColumn - { - role: "profile_value" - title: catalog.i18nc("@title:column", "Profile") - width: (parent.width * 0.18) | 0 - delegate: itemDelegate - } - TableViewColumn - { - role: "user_value" - title: catalog.i18nc("@title:column", "Current"); - visible: base.isQualityItemCurrentlyActivated - width: (parent.width * 0.18) | 0 - delegate: itemDelegate - } - TableViewColumn - { - role: "unit" - title: catalog.i18nc("@title:column", "Unit") - width: (parent.width * 0.14) | 0 - delegate: itemDelegate - } - - section.property: "category" - section.delegate: Label - { - text: section - font.bold: true - } - - model: Cura.QualitySettingsModel - { - id: qualitySettings - selectedPosition: base.extruderPosition - selectedQualityItem: base.qualityItem == null ? {} : base.qualityItem - } - - SystemPalette { id: palette } - } -} diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index bfab7d7d52..af81d97e6c 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -1,5 +1,5 @@ -// Copyright (c) 2022 Ultimaker B.V. -// Uranium is released under the terms of the LGPLv3 or higher. +//Copyright (c) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 2.15 @@ -521,7 +521,13 @@ Item Column { - anchors.fill: parent + id: detailsPanelHeaderColumn + anchors + { + left: parent.left + right: parent.right + top: parent.top + } spacing: UM.Theme.getSize("default_margin").height visible: base.currentItem != null @@ -585,6 +591,7 @@ Item UM.TabRow { + id: profileExtruderTabs UM.TabRowButton //One extra tab for the global settings. { text: catalog.i18nc("@title:tab", "Global Settings") @@ -601,6 +608,21 @@ Item } } } + + Cura.ProfileOverview + { + anchors + { + top: detailsPanelHeaderColumn.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + + visible: detailsPanelHeaderColumn.visible + qualityItem: base.currentItem + extruderPosition: profileExtruderTabs.currentIndex - 1 + } } } } diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml new file mode 100644 index 0000000000..b807706e13 --- /dev/null +++ b/resources/qml/ProfileOverview.qml @@ -0,0 +1,110 @@ +//Copyright (c) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 1.4 as OldControls +import QtQuick.Controls 2.15 + +import UM 1.5 as UM +import Cura 1.6 as Cura + +OldControls.TableView +{ + id: profileOverview + + property var qualityItem //The quality profile to display here. + property int extruderPosition: -1 //The extruder to display. -1 denotes the global stack. + + property bool isQualityItemCurrentlyActivated: + { + if (qualityItem == null) + { + return false; + } + return qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName; + } + + Component + { + id: itemDelegate + + UM.TooltipArea + { + property var setting: qualitySettings.getItem(styleData.row) + height: childrenRect.height + width: (parent != null) ? parent.width : 0 + text: + { + if (styleData.value === undefined) + { + return "" + } + return (styleData.value.substr(0,1) == "=") ? styleData.value : "" + } + + Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.right: parent.right + text: + { + if (styleData.value === undefined) + { + return "" + } + return (styleData.value.substr(0,1) == "=") ? catalog.i18nc("@info:status", "Calculated") : styleData.value + } + font.strikeout: styleData.column == 1 && setting.user_value != "" && profileOverview.isQualityItemCurrentlyActivated + font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "" && profileOverview.isQualityItemCurrentlyActivated) + opacity: font.strikeout ? 0.5 : 1 + color: styleData.textColor + elide: Text.ElideRight + } + } + } + + OldControls.TableViewColumn + { + role: "label" + title: catalog.i18nc("@title:column", "Setting") + width: (parent.width * 0.4) | 0 + delegate: itemDelegate + } + OldControls.TableViewColumn + { + role: "profile_value" + title: catalog.i18nc("@title:column", "Profile") + width: (parent.width * 0.18) | 0 + delegate: itemDelegate + } + OldControls.TableViewColumn + { + role: "user_value" + title: catalog.i18nc("@title:column", "Current"); + visible: profileOverview.isQualityItemCurrentlyActivated + width: (parent.width * 0.18) | 0 + delegate: itemDelegate + } + OldControls.TableViewColumn + { + role: "unit" + title: catalog.i18nc("@title:column", "Unit") + width: (parent.width * 0.14) | 0 + delegate: itemDelegate + } + + section.property: "category" + section.delegate: Label + { + text: section + font.bold: true + } + + model: Cura.QualitySettingsModel + { + id: qualitySettings + selectedPosition: profileOverview.extruderPosition + selectedQualityItem: profileOverview.qualityItem == null ? {} : profileOverview.qualityItem + } +} \ No newline at end of file diff --git a/resources/qml/qmldir b/resources/qml/qmldir index df2518c988..27f916ebde 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -4,6 +4,7 @@ MachineSelector 1.0 MachineSelector.qml MachineSelectorButton 1.0 MachineSelectorButton.qml CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml PrintSetupSelector 1.0 PrintSetupSelector.qml +ProfileOverview 1.6 ProfileOverview.qml ActionButton 1.0 ActionButton.qml MaterialMenu 1.0 MaterialMenu.qml NozzleMenu 1.0 NozzleMenu.qml From 2758957d5caff3a0c97a8849006e0a6a1aed4a8a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 13:57:47 +0100 Subject: [PATCH 106/377] Use TabRow for material page selection The contents of the page is done with a simple page that becomes visible or not. The easiest solution I could think of. No StackLayout necessary here. Contributes to issue CURA-8686. --- .../Preferences/Materials/MaterialsView.qml | 764 +++++++++--------- 1 file changed, 387 insertions(+), 377 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index daa47f33e9..8de4d03241 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -11,7 +11,7 @@ import Cura 1.0 as Cura import ".." // Access to ReadOnlyTextArea.qml -OldControls.TabView +Item { id: base @@ -68,410 +68,420 @@ OldControls.TabView } } - OldControls.Tab + UM.TabRow { - title: catalog.i18nc("@title", "Information") - - anchors.margins: UM.Theme.getSize("default_margin").width - - ScrollView + id: pageSelectorTabRow + UM.TabRowButton { - id: scrollView - anchors.fill: parent - - ScrollBar.vertical: UM.ScrollBar - { - parent: scrollView - anchors - { - top: parent.top - right: parent.right - bottom: parent.bottom - } - } - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - clip: true - - property real columnWidth: (scrollView.width * 0.5 - UM.Theme.getSize("default_margin").width) | 0 - - Flow - { - id: containerGrid - - x: UM.Theme.getSize("default_margin").width - y: UM.Theme.getSize("default_lining").height - - width: base.width - property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height - - MessageDialog - { - id: confirmDiameterChangeDialog - - icon: StandardIcon.Question; - title: catalog.i18nc("@title:window", "Confirm Diameter Change") - text: catalog.i18nc("@label (%1 is a number)", "The new filament diameter is set to %1 mm, which is not compatible with the current extruder. Do you wish to continue?".arg(new_diameter_value)) - standardButtons: StandardButton.Yes | StandardButton.No - modality: Qt.ApplicationModal - - property var new_diameter_value: null; - property var old_diameter_value: null; - property var old_approximate_diameter_value: null; - - onYes: - { - base.setMetaDataEntry("approximate_diameter", old_approximate_diameter_value, getApproximateDiameter(new_diameter_value).toString()); - base.setMetaDataEntry("properties/diameter", properties.diameter, new_diameter_value); - // CURA-6868 Make sure to update the extruder to user a diameter-compatible material. - Cura.MachineManager.updateMaterialWithVariant() - base.resetSelectedMaterial() - } - - onNo: - { - base.properties.diameter = old_diameter_value; - diameterSpinBox.value = Qt.binding(function() { return base.properties.diameter }) - } - - onRejected: no() - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") } - ReadOnlyTextField - { - id: displayNameTextField; - width: scrollView.columnWidth; - text: properties.name; - readOnly: !base.editingEnabled; - onEditingFinished: base.updateMaterialDisplayName(properties.name, text) - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") } - ReadOnlyTextField - { - id: brandTextField; - width: scrollView.columnWidth; - text: properties.brand; - readOnly: !base.editingEnabled; - onEditingFinished: base.updateMaterialBrand(properties.brand, text) - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") } - ReadOnlyTextField - { - id: materialTypeField; - width: scrollView.columnWidth; - text: properties.material; - readOnly: !base.editingEnabled; - onEditingFinished: base.updateMaterialType(properties.material, text) - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") } - Row - { - width: scrollView.columnWidth - height: parent.rowHeight - spacing: Math.round(UM.Theme.getSize("default_margin").width / 2) - - // color indicator square - Rectangle - { - id: colorSelector - color: properties.color_code - - width: Math.round(colorLabel.height * 0.75) - height: Math.round(colorLabel.height * 0.75) - border.width: UM.Theme.getSize("default_lining").height - - anchors.verticalCenter: parent.verticalCenter - - // open the color selection dialog on click - MouseArea - { - anchors.fill: parent - onClicked: colorDialog.open() - enabled: base.editingEnabled - } - } - - // pretty color name text field - ReadOnlyTextField - { - id: colorLabel; - width: parent.width - colorSelector.width - parent.spacing - text: properties.color_name; - readOnly: !base.editingEnabled - onEditingFinished: base.setMetaDataEntry("color_name", properties.color_name, text) - } - - // popup dialog to select a new color - // if successful it sets the properties.color_code value to the new color - ColorDialog - { - id: colorDialog - color: properties.color_code - onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) - } - } - - Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } - - Label { width: parent.width; height: parent.rowHeight; font.bold: true; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Properties") } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Density") } - ReadOnlySpinBox - { - id: densitySpinBox - width: scrollView.columnWidth - value: properties.density - decimals: 2 - suffix: " g/cm³" - stepSize: 0.01 - readOnly: !base.editingEnabled - - onEditingFinished: base.setMetaDataEntry("properties/density", properties.density, value) - onValueChanged: updateCostPerMeter() - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Diameter") } - ReadOnlySpinBox - { - id: diameterSpinBox - width: scrollView.columnWidth - value: properties.diameter - decimals: 2 - suffix: " mm" - stepSize: 0.01 - readOnly: !base.editingEnabled - - onEditingFinished: - { - // This does not use a SettingPropertyProvider, because we need to make the change to all containers - // which derive from the same base_file - var old_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "properties/diameter"); - var old_approximate_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "approximate_diameter"); - var new_approximate_diameter = getApproximateDiameter(value); - if (new_approximate_diameter != Cura.ExtruderManager.getActiveExtruderStack().approximateMaterialDiameter) - { - confirmDiameterChangeDialog.old_diameter_value = old_diameter; - confirmDiameterChangeDialog.new_diameter_value = value; - confirmDiameterChangeDialog.old_approximate_diameter_value = old_approximate_diameter; - - confirmDiameterChangeDialog.open() - } - else { - base.setMetaDataEntry("approximate_diameter", old_approximate_diameter, getApproximateDiameter(value).toString()); - base.setMetaDataEntry("properties/diameter", properties.diameter, value); - } - } - onValueChanged: updateCostPerMeter() - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament Cost") } - OldControls.SpinBox - { - id: spoolCostSpinBox - width: scrollView.columnWidth - value: base.getMaterialPreferenceValue(properties.guid, "spool_cost") - prefix: base.currency + " " - decimals: 2 - maximumValue: 100000000 - - onValueChanged: - { - base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value)) - updateCostPerMeter() - } - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament weight") } - OldControls.SpinBox - { - id: spoolWeightSpinBox - width: scrollView.columnWidth - value: base.getMaterialPreferenceValue(properties.guid, "spool_weight", Cura.ContainerManager.getContainerMetaDataEntry(properties.container_id, "properties/weight")) - suffix: " g" - stepSize: 100 - decimals: 0 - maximumValue: 10000 - - onValueChanged: - { - base.setMaterialPreferenceValue(properties.guid, "spool_weight", parseFloat(value)) - updateCostPerMeter() - } - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament length") } - Label - { - width: scrollView.columnWidth - text: "~ %1 m".arg(Math.round(base.spoolLength)) - verticalAlignment: Qt.AlignVCenter - height: parent.rowHeight - } - - Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Cost per Meter") } - Label - { - width: scrollView.columnWidth - text: "~ %1 %2/m".arg(base.costPerMeter.toFixed(2)).arg(base.currency) - verticalAlignment: Qt.AlignVCenter - height: parent.rowHeight - } - - Item { width: parent.width; height: UM.Theme.getSize("default_margin").height; visible: unlinkMaterialButton.visible } - Label - { - width: 2 * scrollView.columnWidth - verticalAlignment: Qt.AlignVCenter - text: catalog.i18nc("@label", "This material is linked to %1 and shares some of its properties.").arg(base.linkedMaterialNames) - wrapMode: Text.WordWrap - visible: unlinkMaterialButton.visible - } - OldControls.Button - { - id: unlinkMaterialButton - text: catalog.i18nc("@label", "Unlink Material") - visible: base.linkedMaterialNames != "" - onClicked: - { - Cura.ContainerManager.unlinkMaterial(base.currentMaterialNode) - base.reevaluateLinkedMaterials = true - } - } - - Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } - - Label { width: parent.width; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Description") } - - ReadOnlyTextArea - { - text: properties.description; - width: 2 * scrollView.columnWidth - wrapMode: Text.WordWrap - - readOnly: !base.editingEnabled; - - onEditingFinished: base.setMetaDataEntry("description", properties.description, text) - } - - Label { width: parent.width; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Adhesion Information") } - - ReadOnlyTextArea - { - text: properties.adhesion_info; - width: 2 * scrollView.columnWidth - wrapMode: Text.WordWrap - - readOnly: !base.editingEnabled; - - onEditingFinished: base.setMetaDataEntry("adhesion_info", properties.adhesion_info, text) - } - - Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } - } - - function updateCostPerMeter() - { - base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); - base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); - } + text: catalog.i18nc("@title", "Information") + property string activeView: "information" //To determine which page gets displayed. + } + UM.TabRowButton + { + text: catalog.i18nc("@label", "Print settings") + property string activeView: "settings" } } - OldControls.Tab + ScrollView { - title: catalog.i18nc("@label", "Print settings") + id: informationPage anchors { - leftMargin: UM.Theme.getSize("default_margin").width - topMargin: UM.Theme.getSize("default_margin").height - bottomMargin: UM.Theme.getSize("default_margin").height - rightMargin: 0 + top: pageSelectorTabRow.bottom + left: parent.left + right: parent.right + bottom: parent.bottom } - ListView + ScrollBar.vertical: UM.ScrollBar { - anchors.fill: parent - model: UM.SettingDefinitionsModel + parent: informationPage + anchors { - containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" - visibilityHandler: Cura.MaterialSettingsVisibilityHandler { } - expanded: ["*"] + top: parent.top + right: parent.right + bottom: parent.bottom + } + } + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + clip: true + visible: pageSelectorTabRow.currentItem.activeView === "information" + + property real columnWidth: (width * 0.5 - UM.Theme.getSize("default_margin").width) | 0 + + Flow + { + id: containerGrid + + x: UM.Theme.getSize("default_margin").width + y: UM.Theme.getSize("default_lining").height + + width: base.width + property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height + + MessageDialog + { + id: confirmDiameterChangeDialog + + icon: StandardIcon.Question; + title: catalog.i18nc("@title:window", "Confirm Diameter Change") + text: catalog.i18nc("@label (%1 is a number)", "The new filament diameter is set to %1 mm, which is not compatible with the current extruder. Do you wish to continue?".arg(new_diameter_value)) + standardButtons: StandardButton.Yes | StandardButton.No + modality: Qt.ApplicationModal + + property var new_diameter_value: null; + property var old_diameter_value: null; + property var old_approximate_diameter_value: null; + + onYes: + { + base.setMetaDataEntry("approximate_diameter", old_approximate_diameter_value, getApproximateDiameter(new_diameter_value).toString()); + base.setMetaDataEntry("properties/diameter", properties.diameter, new_diameter_value); + // CURA-6868 Make sure to update the extruder to user a diameter-compatible material. + Cura.MachineManager.updateMaterialWithVariant() + base.resetSelectedMaterial() + } + + onNo: + { + base.properties.diameter = old_diameter_value; + diameterSpinBox.value = Qt.binding(function() { return base.properties.diameter }) + } + + onRejected: no() } - ScrollBar.vertical: UM.ScrollBar {} - clip: true - - delegate: UM.TooltipArea + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") } + ReadOnlyTextField { - width: childrenRect.width - height: childrenRect.height - text: model.description - Label + id: displayNameTextField; + width: informationPage.columnWidth; + text: properties.name; + readOnly: !base.editingEnabled; + onEditingFinished: base.updateMaterialDisplayName(properties.name, text) + } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") } + ReadOnlyTextField + { + id: brandTextField; + width: informationPage.columnWidth; + text: properties.brand; + readOnly: !base.editingEnabled; + onEditingFinished: base.updateMaterialBrand(properties.brand, text) + } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") } + ReadOnlyTextField + { + id: materialTypeField; + width: informationPage.columnWidth; + text: properties.material; + readOnly: !base.editingEnabled; + onEditingFinished: base.updateMaterialType(properties.material, text) + } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") } + Row + { + width: informationPage.columnWidth + height: parent.rowHeight + spacing: Math.round(UM.Theme.getSize("default_margin").width / 2) + + // color indicator square + Rectangle { - id: label - width: base.firstColumnWidth; - height: spinBox.height + UM.Theme.getSize("default_lining").height - text: model.label - elide: Text.ElideRight - verticalAlignment: Qt.AlignVCenter - } - ReadOnlySpinBox - { - id: spinBox - anchors.left: label.right - value: + id: colorSelector + color: properties.color_code + + width: Math.round(colorLabel.height * 0.75) + height: Math.round(colorLabel.height * 0.75) + border.width: UM.Theme.getSize("default_lining").height + + anchors.verticalCenter: parent.verticalCenter + + // open the color selection dialog on click + MouseArea { - // In case the setting is not in the material... - if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) - { - return parseFloat(materialPropertyProvider.properties.value); - } - // ... we search in the variant, and if it is not there... - if (!isNaN(parseFloat(variantPropertyProvider.properties.value))) - { - return parseFloat(variantPropertyProvider.properties.value); - } - // ... then look in the definition container. - if (!isNaN(parseFloat(machinePropertyProvider.properties.value))) - { - return parseFloat(machinePropertyProvider.properties.value); - } - return 0; + anchors.fill: parent + onClicked: colorDialog.open() + enabled: base.editingEnabled } - width: base.secondColumnWidth + } + + // pretty color name text field + ReadOnlyTextField + { + id: colorLabel; + width: parent.width - colorSelector.width - parent.spacing + text: properties.color_name; readOnly: !base.editingEnabled - suffix: " " + model.unit - maximumValue: 99999 - decimals: model.unit == "mm" ? 2 : 0 - - onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) + onEditingFinished: base.setMetaDataEntry("color_name", properties.color_name, text) } - UM.ContainerPropertyProvider + // popup dialog to select a new color + // if successful it sets the properties.color_code value to the new color + ColorDialog { - id: materialPropertyProvider - containerId: base.containerId - watchedProperties: [ "value" ] - key: model.key + id: colorDialog + color: properties.color_code + onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) } - UM.ContainerPropertyProvider + } + + Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } + + Label { width: parent.width; height: parent.rowHeight; font.bold: true; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Properties") } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Density") } + ReadOnlySpinBox + { + id: densitySpinBox + width: informationPage.columnWidth + value: properties.density + decimals: 2 + suffix: " g/cm³" + stepSize: 0.01 + readOnly: !base.editingEnabled + + onEditingFinished: base.setMetaDataEntry("properties/density", properties.density, value) + onValueChanged: updateCostPerMeter() + } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Diameter") } + ReadOnlySpinBox + { + id: diameterSpinBox + width: informationPage.columnWidth + value: properties.diameter + decimals: 2 + suffix: " mm" + stepSize: 0.01 + readOnly: !base.editingEnabled + + onEditingFinished: { - id: variantPropertyProvider - containerId: Cura.MachineManager.activeStack.variant.id - watchedProperties: [ "value" ] - key: model.key + // This does not use a SettingPropertyProvider, because we need to make the change to all containers + // which derive from the same base_file + var old_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "properties/diameter"); + var old_approximate_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "approximate_diameter"); + var new_approximate_diameter = getApproximateDiameter(value); + if (new_approximate_diameter != Cura.ExtruderManager.getActiveExtruderStack().approximateMaterialDiameter) + { + confirmDiameterChangeDialog.old_diameter_value = old_diameter; + confirmDiameterChangeDialog.new_diameter_value = value; + confirmDiameterChangeDialog.old_approximate_diameter_value = old_approximate_diameter; + + confirmDiameterChangeDialog.open() + } + else { + base.setMetaDataEntry("approximate_diameter", old_approximate_diameter, getApproximateDiameter(value).toString()); + base.setMetaDataEntry("properties/diameter", properties.diameter, value); + } } - UM.ContainerPropertyProvider + onValueChanged: updateCostPerMeter() + } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament Cost") } + OldControls.SpinBox + { + id: spoolCostSpinBox + width: informationPage.columnWidth + value: base.getMaterialPreferenceValue(properties.guid, "spool_cost") + prefix: base.currency + " " + decimals: 2 + maximumValue: 100000000 + + onValueChanged: { - id: machinePropertyProvider - containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" - watchedProperties: [ "value" ] - key: model.key + base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value)) + updateCostPerMeter() } } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament weight") } + OldControls.SpinBox + { + id: spoolWeightSpinBox + width: informationPage.columnWidth + value: base.getMaterialPreferenceValue(properties.guid, "spool_weight", Cura.ContainerManager.getContainerMetaDataEntry(properties.container_id, "properties/weight")) + suffix: " g" + stepSize: 100 + decimals: 0 + maximumValue: 10000 + + onValueChanged: + { + base.setMaterialPreferenceValue(properties.guid, "spool_weight", parseFloat(value)) + updateCostPerMeter() + } + } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament length") } + Label + { + width: informationPage.columnWidth + text: "~ %1 m".arg(Math.round(base.spoolLength)) + verticalAlignment: Qt.AlignVCenter + height: parent.rowHeight + } + + Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Cost per Meter") } + Label + { + width: informationPage.columnWidth + text: "~ %1 %2/m".arg(base.costPerMeter.toFixed(2)).arg(base.currency) + verticalAlignment: Qt.AlignVCenter + height: parent.rowHeight + } + + Item { width: parent.width; height: UM.Theme.getSize("default_margin").height; visible: unlinkMaterialButton.visible } + Label + { + width: 2 * informationPage.columnWidth + verticalAlignment: Qt.AlignVCenter + text: catalog.i18nc("@label", "This material is linked to %1 and shares some of its properties.").arg(base.linkedMaterialNames) + wrapMode: Text.WordWrap + visible: unlinkMaterialButton.visible + } + OldControls.Button + { + id: unlinkMaterialButton + text: catalog.i18nc("@label", "Unlink Material") + visible: base.linkedMaterialNames != "" + onClicked: + { + Cura.ContainerManager.unlinkMaterial(base.currentMaterialNode) + base.reevaluateLinkedMaterials = true + } + } + + Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } + + Label { width: parent.width; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Description") } + + ReadOnlyTextArea + { + text: properties.description; + width: 2 * informationPage.columnWidth + wrapMode: Text.WordWrap + + readOnly: !base.editingEnabled; + + onEditingFinished: base.setMetaDataEntry("description", properties.description, text) + } + + Label { width: parent.width; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Adhesion Information") } + + ReadOnlyTextArea + { + text: properties.adhesion_info; + width: 2 * informationPage.columnWidth + wrapMode: Text.WordWrap + + readOnly: !base.editingEnabled; + + onEditingFinished: base.setMetaDataEntry("adhesion_info", properties.adhesion_info, text) + } + + Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } + } + + function updateCostPerMeter() + { + base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); + base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); + } + } + + ListView + { + anchors + { + top: pageSelectorTabRow.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + + model: UM.SettingDefinitionsModel + { + containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" + visibilityHandler: Cura.MaterialSettingsVisibilityHandler { } + expanded: ["*"] + } + ScrollBar.vertical: UM.ScrollBar {} + clip: true + visible: pageSelectorTabRow.currentItem.activeView === "settings" + + delegate: UM.TooltipArea + { + width: childrenRect.width + height: childrenRect.height + text: model.description + Label + { + id: label + width: base.firstColumnWidth; + height: spinBox.height + UM.Theme.getSize("default_lining").height + text: model.label + elide: Text.ElideRight + verticalAlignment: Qt.AlignVCenter + } + ReadOnlySpinBox + { + id: spinBox + anchors.left: label.right + value: + { + // In case the setting is not in the material... + if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) + { + return parseFloat(materialPropertyProvider.properties.value); + } + // ... we search in the variant, and if it is not there... + if (!isNaN(parseFloat(variantPropertyProvider.properties.value))) + { + return parseFloat(variantPropertyProvider.properties.value); + } + // ... then look in the definition container. + if (!isNaN(parseFloat(machinePropertyProvider.properties.value))) + { + return parseFloat(machinePropertyProvider.properties.value); + } + return 0; + } + width: base.secondColumnWidth + readOnly: !base.editingEnabled + suffix: " " + model.unit + maximumValue: 99999 + decimals: model.unit == "mm" ? 2 : 0 + + onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) + } + + UM.ContainerPropertyProvider + { + id: materialPropertyProvider + containerId: base.containerId + watchedProperties: [ "value" ] + key: model.key + } + UM.ContainerPropertyProvider + { + id: variantPropertyProvider + containerId: Cura.MachineManager.activeStack.variant.id + watchedProperties: [ "value" ] + key: model.key + } + UM.ContainerPropertyProvider + { + id: machinePropertyProvider + containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: "" + watchedProperties: [ "value" ] + key: model.key + } } } From f834e63413aed5c44996399a622f031449a6fe38 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 15:54:33 +0100 Subject: [PATCH 107/377] Update plugins/PerObjectSettingsTool/ToolBarButton.qml Co-authored-by: Jaime van Kessel --- plugins/PerObjectSettingsTool/ToolBarButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml index 5e2479a73f..3bf38d19be 100644 --- a/plugins/PerObjectSettingsTool/ToolBarButton.qml +++ b/plugins/PerObjectSettingsTool/ToolBarButton.qml @@ -54,7 +54,7 @@ ToolButton } return UM.Theme.getColor("toolbar_background") } - Behavior on color { ColorAnimation { duration: 50; } } + Behavior on color { ColorAnimation { duration: 50 } } border.width: (base.hasOwnProperty("needBorder") && base.needBorder) ? UM.Theme.getSize("default_lining").width : 0 border.color: base.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") From ea60fdeacd7165c38961491e8eed565f8450bea5 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 15:59:17 +0100 Subject: [PATCH 108/377] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index aa5b275501..fc229cab7b 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -38,7 +38,7 @@ UM.ManagementPage { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate"); - icon.name: "list-activate"; + icon.name: "list-activate" enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachine.id onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id) }, From ad3832791c184489b2e4bf9ac578621959359b90 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 25 Jan 2022 16:05:49 +0100 Subject: [PATCH 109/377] Use Button in tool bar button component CURA-8684 --- plugins/PerObjectSettingsTool/ToolBarButton.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml index 5e2479a73f..5a96d7cd19 100644 --- a/plugins/PerObjectSettingsTool/ToolBarButton.qml +++ b/plugins/PerObjectSettingsTool/ToolBarButton.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 @@ -7,7 +7,7 @@ import QtQuick.Controls 2.1 import Cura 1.0 as Cura import UM 1.5 as UM -ToolButton +Button { id: base From 5671b6c61f50185ea90b6ca1f6d9f45aa5f1f9e7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 17:51:48 +0100 Subject: [PATCH 110/377] Replace TableView with custom implementation I intend to copy this implementation to mainline Cura when it's done. Contributes to issue CURA-8686. --- .../resources/qml/OpenProjectFilesPage.qml | 26 +++- .../DigitalLibrary/resources/qml/Table.qml | 127 ++++++++++++++++++ 2 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 plugins/DigitalLibrary/resources/qml/Table.qml diff --git a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml index 0e55efeb39..8e77c853a3 100644 --- a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml @@ -1,6 +1,8 @@ -// Copyright (C) 2021 Ultimaker B.V. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.10 +import Qt.labs.qmlmodels 1.0 +import QtQuick 2.15 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 @@ -56,8 +58,24 @@ Item border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") + //We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView. + //So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView. + Table + { + id: filesTableView + anchors.fill: parent - Cura.TableView + columnHeaders: ["Name", "Uploaded by", "Uploaded at"] + model: TableModel + { + TableModelColumn { display: "fileName" } + TableModelColumn { display: "username" } + TableModelColumn { display: "uploadedAt" } + rows: manager.digitalFactoryFileModel.items + } + } + + /*Cura.TableView { id: filesTableView anchors.fill: parent @@ -102,7 +120,7 @@ Item manager.setSelectedFileIndices(newSelection); } } - } + }*/ Label { diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml new file mode 100644 index 0000000000..c1d01ec124 --- /dev/null +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -0,0 +1,127 @@ +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. + +import Qt.labs.qmlmodels 1.0 +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +import DigitalFactory 1.0 as DF +import UM 1.5 as UM + +/* + * A re-sizeable table of data. + * + * This table combines a list of headers with a TableView to show certain roles in a table. + * The columns of the table can be resized. + * When the table becomes too big, you can scroll through the table. When a column becomes too small, the contents of + * the table are elided. + * The table gets Cura's themeing. + */ +Item +{ + id: tableScrollView + + required property var columnHeaders //The text to show in the headers of each column. + property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items" + property int currentRow: -1 //The selected row index. + + Row + { + id: headerBar + Repeater + { + id: headerRepeater + model: columnHeaders + Rectangle + { + width: Math.round(tableScrollView.width / headerRepeater.count) + height: UM.Theme.getSize("section").height + + color: UM.Theme.getColor("secondary") + + Label + { + id: contentText + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("narrow_margin").width + + text: modelData + font: UM.Theme.getFont("medium_bold") + color: UM.Theme.getColor("text") + } + Rectangle + { + anchors + { + right: parent.right + top: parent.top + bottom: parent.bottom + } + width: UM.Theme.getSize("thick_lining").width + + color: UM.Theme.getColor("thick_lining") + + MouseArea + { + anchors.fill: parent + + cursorShape: Qt.SizeHorCursor + drag + { + target: parent + axis: Drag.XAxis + } + onMouseXChanged: + { + if(drag.active) + { + parent.parent.width = Math.max(10, parent.parent.width + mouseX); //Don't go smaller than 10 pixels, to make sure you can still scale it back. + } + tableView.forceLayout(); + } + } + } + } + } + } + TableView + { + id: tableView + anchors + { + top: headerBar.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + + clip: true + ScrollBar.vertical: UM.ScrollBar {} + columnWidthProvider: function(column) + { + return headerBar.children[column].width; //Cells get the same width as their column header. + } + + delegate: Rectangle + { + height: UM.Theme.getSize("section").height + + color: UM.Theme.getColor((row % 2 == 0) ? "main_background": "viewport_background") + + Label + { + id: cellContent + anchors.fill: parent + + text: display + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + } + } + + } +} \ No newline at end of file From 59494cdace3e20f4def4b277feb1584aa62a6633 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:03:45 +0100 Subject: [PATCH 111/377] Implement selection Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index c1d01ec124..66144b3ea3 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -108,7 +108,7 @@ Item { height: UM.Theme.getSize("section").height - color: UM.Theme.getColor((row % 2 == 0) ? "main_background": "viewport_background") + color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) Label { @@ -121,7 +121,14 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } + MouseArea + { + anchors.fill: parent + onClicked: + { + tableScrollView.currentRow = row; //Select this row. + } + } } - } } \ No newline at end of file From a7da4e4ef90293830fec53ba239fd5a742f590bb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:11:30 +0100 Subject: [PATCH 112/377] Fix integration with new table view Only a single selected item for the moment. Contributes to issue CURA-8686. --- .../resources/qml/OpenProjectFilesPage.qml | 55 ++----------------- 1 file changed, 6 insertions(+), 49 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml index 8e77c853a3..e0009d20e3 100644 --- a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml @@ -73,55 +73,13 @@ Item TableModelColumn { display: "uploadedAt" } rows: manager.digitalFactoryFileModel.items } + + onCurrentRowChanged: + { + manager.setSelectedFileIndices([currentRow]); + } } - /*Cura.TableView - { - id: filesTableView - anchors.fill: parent - model: manager.digitalFactoryFileModel - visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress - selectionMode: OldControls.SelectionMode.SingleSelection - onDoubleClicked: - { - manager.setSelectedFileIndices([row]); - openFilesButton.clicked(); - } - - OldControls.TableViewColumn - { - id: fileNameColumn - role: "fileName" - title: "Name" - width: Math.round(filesTableView.width / 3) - } - - OldControls.TableViewColumn - { - id: usernameColumn - role: "username" - title: "Uploaded by" - width: Math.round(filesTableView.width / 3) - } - - OldControls.TableViewColumn - { - role: "uploadedAt" - title: "Uploaded at" - } - - Connections - { - target: filesTableView.selection - function onSelectionChanged() - { - let newSelection = []; - filesTableView.selection.forEach(function(rowIndex) { newSelection.push(rowIndex); }); - manager.setSelectedFileIndices(newSelection); - } - } - }*/ - Label { id: emptyProjectLabel @@ -178,7 +136,6 @@ Item { // Make sure no files are selected when the file model changes filesTableView.currentRow = -1 - filesTableView.selection.clear() } } } @@ -204,7 +161,7 @@ Item anchors.bottom: parent.bottom anchors.right: parent.right text: "Open" - enabled: filesTableView.selection.count > 0 + enabled: filesTableView.currentRow >= 0 onClicked: { manager.openSelectedFiles() From bbb40d9b11cae3335378d65e3cf874f22a1738b6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:19:08 +0100 Subject: [PATCH 113/377] Allow double-clicking on a file to open it Contributes to issue CURA-8686. --- .../DigitalLibrary/resources/qml/OpenProjectFilesPage.qml | 5 +++++ plugins/DigitalLibrary/resources/qml/Table.qml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml index e0009d20e3..6a03bca27b 100644 --- a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml @@ -78,6 +78,11 @@ Item { manager.setSelectedFileIndices([currentRow]); } + onDoubleClicked: function(row) + { + manager.setSelectedFileIndices([row]); + openFilesButton.clicked(); + } } Label diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 66144b3ea3..0ae97792dc 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -24,6 +24,7 @@ Item required property var columnHeaders //The text to show in the headers of each column. property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items" property int currentRow: -1 //The selected row index. + property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on. Row { @@ -128,6 +129,10 @@ Item { tableScrollView.currentRow = row; //Select this row. } + onDoubleClicked: + { + tableScrollView.onDoubleClicked(row); + } } } } From 88bf1995c0b3c034453ad12fb4159fad25ba41d7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:22:38 +0100 Subject: [PATCH 114/377] Fix cell height adjusting to content To be honest, I'm not entirely sure why it only works here if I use implicitHeight instead of height. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 0ae97792dc..d8ea65c992 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -107,14 +107,14 @@ Item delegate: Rectangle { - height: UM.Theme.getSize("section").height + implicitHeight: cellContent.height color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) Label { id: cellContent - anchors.fill: parent + width: parent.width text: display verticalAlignment: Text.AlignVCenter From c6717c67f4b01c2f534ba848bd11c655766c66bc Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:24:38 +0100 Subject: [PATCH 115/377] Don't let table overlap lining Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml index 6a03bca27b..6c74675227 100644 --- a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml @@ -64,6 +64,7 @@ Item { id: filesTableView anchors.fill: parent + anchors.margins: parent.border.width columnHeaders: ["Name", "Uploaded by", "Uploaded at"] model: TableModel From 279c23f5aa5127e76e7793082088afee6384ed65 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:26:15 +0100 Subject: [PATCH 116/377] Elide header text too Otherwise it just overlaps with the next column. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index d8ea65c992..5ace6a823a 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -51,6 +51,7 @@ Item text: modelData font: UM.Theme.getFont("medium_bold") color: UM.Theme.getColor("text") + elide: Text.ElideRight } Rectangle { From 2429f28b7f782842e8df38b6c5c607f04836ca5f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:31:43 +0100 Subject: [PATCH 117/377] Limit column widths to not exceed the total width of the table A bit clunky, but very effective! This way we don't have to deal with clipping or scrolling horizontally. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 5ace6a823a..ea379b0885 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -80,6 +80,15 @@ Item if(drag.active) { parent.parent.width = Math.max(10, parent.parent.width + mouseX); //Don't go smaller than 10 pixels, to make sure you can still scale it back. + let sum_widths = 0; + for(let i = 0; i < headerBar.children.length; ++i) + { + sum_widths += headerBar.children[i].width; + } + if(sum_widths > tableScrollView.width) + { + parent.parent.width -= sum_widths - tableScrollView.width; //Limit the total width to not exceed the view. + } } tableView.forceLayout(); } From 39e29ae768718b439a254504a1a94903f09b563a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:34:04 +0100 Subject: [PATCH 118/377] Fix QML warning of 0 height from before table is filled If there is no model data, the cells will be empty and would have a height of 0. The table warns us that a height of 0 is not allowed. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index ea379b0885..503672be4c 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -117,7 +117,7 @@ Item delegate: Rectangle { - implicitHeight: cellContent.height + implicitHeight: Math.max(1, cellContent.height) color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) From 6457410a534b7d08033f5289e576865cc552592b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:37:34 +0100 Subject: [PATCH 119/377] Copy new Table implementation to Cura.TableView There we can re-use it. We can't re-use that implementation from the Digital Library itself, since that plug-in needs to be compatible with older Cura versions as well. Contributes to issue CURA-8686. --- .../DigitalLibrary/resources/qml/Table.qml | 1 - resources/qml/TableView.qml | 175 +++++++++++++----- 2 files changed, 128 insertions(+), 48 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 503672be4c..7d5750d113 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -5,7 +5,6 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.15 import QtQuick.Controls 2.15 -import DigitalFactory 1.0 as DF import UM 1.5 as UM /* diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index db495c3dc2..7d5750d113 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -1,67 +1,148 @@ -// Copyright (C) 2021 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.10 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one -import QtQuick.Controls 2.3 -import QtQuick.Controls.Styles 1.4 +import Qt.labs.qmlmodels 1.0 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import UM 1.5 as UM - -OldControls.TableView +/* + * A re-sizeable table of data. + * + * This table combines a list of headers with a TableView to show certain roles in a table. + * The columns of the table can be resized. + * When the table becomes too big, you can scroll through the table. When a column becomes too small, the contents of + * the table are elided. + * The table gets Cura's themeing. + */ +Item { - itemDelegate: Item - { - height: tableCellLabel.implicitHeight + id: tableScrollView - UM.Label + required property var columnHeaders //The text to show in the headers of each column. + property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items" + property int currentRow: -1 //The selected row index. + property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on. + + Row + { + id: headerBar + Repeater { - id: tableCellLabel - color: styleData.selected ? UM.Theme.getColor("primary_button_text") : UM.Theme.getColor("text") - elide: Text.ElideRight - text: styleData.value - anchors.fill: parent - anchors.leftMargin: 10 * screenScaleFactor + id: headerRepeater + model: columnHeaders + Rectangle + { + width: Math.round(tableScrollView.width / headerRepeater.count) + height: UM.Theme.getSize("section").height + + color: UM.Theme.getColor("secondary") + + Label + { + id: contentText + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("narrow_margin").width + + text: modelData + font: UM.Theme.getFont("medium_bold") + color: UM.Theme.getColor("text") + elide: Text.ElideRight + } + Rectangle + { + anchors + { + right: parent.right + top: parent.top + bottom: parent.bottom + } + width: UM.Theme.getSize("thick_lining").width + + color: UM.Theme.getColor("thick_lining") + + MouseArea + { + anchors.fill: parent + + cursorShape: Qt.SizeHorCursor + drag + { + target: parent + axis: Drag.XAxis + } + onMouseXChanged: + { + if(drag.active) + { + parent.parent.width = Math.max(10, parent.parent.width + mouseX); //Don't go smaller than 10 pixels, to make sure you can still scale it back. + let sum_widths = 0; + for(let i = 0; i < headerBar.children.length; ++i) + { + sum_widths += headerBar.children[i].width; + } + if(sum_widths > tableScrollView.width) + { + parent.parent.width -= sum_widths - tableScrollView.width; //Limit the total width to not exceed the view. + } + } + tableView.forceLayout(); + } + } + } + } } } - - rowDelegate: Rectangle + TableView { - color: styleData.selected ? UM.Theme.getColor("primary_button") : UM.Theme.getColor("main_background") - height: UM.Theme.getSize("table_row").height - } - - // Use the old styling technique since it's the only way to make the scrollbars themed in the TableView - style: TableViewStyle - { - backgroundColor: UM.Theme.getColor("main_background") - - handle: Rectangle + id: tableView + anchors { - // Both implicit width and height have to be set, since the handle is used by both the horizontal and the vertical scrollbars - implicitWidth: UM.Theme.getSize("scrollbar").width - implicitHeight: UM.Theme.getSize("scrollbar").width - radius: width / 2 - color: UM.Theme.getColor(styleData.pressed ? "scrollbar_handle_down" : (styleData.hovered ? "scrollbar_handle_hover" : "scrollbar_handle")) + top: headerBar.bottom + left: parent.left + right: parent.right + bottom: parent.bottom } - scrollBarBackground: Rectangle + clip: true + ScrollBar.vertical: UM.ScrollBar {} + columnWidthProvider: function(column) { - // Both implicit width and height have to be set, since the handle is used by both the horizontal and the vertical scrollbars - implicitWidth: UM.Theme.getSize("scrollbar").width - implicitHeight: UM.Theme.getSize("scrollbar").width - color: UM.Theme.getColor("main_background") + return headerBar.children[column].width; //Cells get the same width as their column header. } - // The little rectangle between the vertical and horizontal scrollbars - corner: Rectangle + delegate: Rectangle { - color: UM.Theme.getColor("main_background") - } + implicitHeight: Math.max(1, cellContent.height) - // Override the control arrows - incrementControl: Item { } - decrementControl: Item { } + color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) + + Label + { + id: cellContent + width: parent.width + + text: display + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + } + MouseArea + { + anchors.fill: parent + onClicked: + { + tableScrollView.currentRow = row; //Select this row. + } + onDoubleClicked: + { + tableScrollView.onDoubleClicked(row); + } + } + } } } \ No newline at end of file From a4ef86609f46c879752880b630f86d484232d168 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:48:06 +0100 Subject: [PATCH 120/377] Implement option to disable selections Sometimes you don't want the user to be able to highlight certain rows. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 3 +++ resources/qml/TableView.qml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 7d5750d113..1b12c8ec38 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -24,6 +24,7 @@ Item property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items" property int currentRow: -1 //The selected row index. property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on. + property bool allowSelection: true //Whether to allow the user to select items. Row { @@ -134,6 +135,8 @@ Item MouseArea { anchors.fill: parent + + enabled: tableScrollView.allowSelection onClicked: { tableScrollView.currentRow = row; //Select this row. diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 7d5750d113..1b12c8ec38 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -24,6 +24,7 @@ Item property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items" property int currentRow: -1 //The selected row index. property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on. + property bool allowSelection: true //Whether to allow the user to select items. Row { @@ -134,6 +135,8 @@ Item MouseArea { anchors.fill: parent + + enabled: tableScrollView.allowSelection onClicked: { tableScrollView.currentRow = row; //Select this row. From 83953b03b433c7f6771364b15d116eeff0df2ae3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:48:45 +0100 Subject: [PATCH 121/377] Use new table element for saving files as well Re-using that component. Contributes to issue CURA-8686. --- .../resources/qml/OpenProjectFilesPage.qml | 1 - .../resources/qml/SaveProjectFilesPage.qml | 43 +++++++------------ 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml index 6c74675227..5f594cb79e 100644 --- a/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml @@ -4,7 +4,6 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.15 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM diff --git a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml index 139333c150..8d72ed9ff4 100644 --- a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml @@ -1,8 +1,9 @@ -// Copyright (C) 2021 Ultimaker B.V. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. +import Qt.labs.qmlmodels 1.0 import QtQuick 2.10 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM @@ -85,35 +86,22 @@ Item border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") - - Cura.TableView + //We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView. + //So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView. + Table { id: filesTableView anchors.fill: parent - model: manager.digitalFactoryFileModel - visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress - selectionMode: OldControls.SelectionMode.NoSelection + anchors.margins: parent.border.width - OldControls.TableViewColumn + allowSelection: false + columnHeaders: ["Name", "Uploaded by", "Uploaded at"] + model: TableModel { - id: fileNameColumn - role: "fileName" - title: "@tableViewColumn:title", "Name" - width: Math.round(filesTableView.width / 3) - } - - OldControls.TableViewColumn - { - id: usernameColumn - role: "username" - title: "Uploaded by" - width: Math.round(filesTableView.width / 3) - } - - OldControls.TableViewColumn - { - role: "uploadedAt" - title: "Uploaded at" + TableModelColumn { display: "fileName" } + TableModelColumn { display: "username" } + TableModelColumn { display: "uploadedAt" } + rows: manager.digitalFactoryFileModel.items } } @@ -172,8 +160,7 @@ Item function onItemsChanged() { // Make sure no files are selected when the file model changes - filesTableView.currentRow = -1 - filesTableView.selection.clear() + filesTableView.currentRow = -1; } } } From c6eb1e668d3b89c60eab200943df2e7c5c679404 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:51:03 +0100 Subject: [PATCH 122/377] Rename tableScrollView to tableBase It is no longer a scrollview, after all, since the TableView itself already scrolls (and leaves the header nicely at the top this way). Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 16 ++++++++-------- resources/qml/TableView.qml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 1b12c8ec38..cb4ca1fe37 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -18,7 +18,7 @@ import UM 1.5 as UM */ Item { - id: tableScrollView + id: tableBase required property var columnHeaders //The text to show in the headers of each column. property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items" @@ -35,7 +35,7 @@ Item model: columnHeaders Rectangle { - width: Math.round(tableScrollView.width / headerRepeater.count) + width: Math.round(tableBase.width / headerRepeater.count) height: UM.Theme.getSize("section").height color: UM.Theme.getColor("secondary") @@ -85,9 +85,9 @@ Item { sum_widths += headerBar.children[i].width; } - if(sum_widths > tableScrollView.width) + if(sum_widths > tableBase.width) { - parent.parent.width -= sum_widths - tableScrollView.width; //Limit the total width to not exceed the view. + parent.parent.width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. } } tableView.forceLayout(); @@ -119,7 +119,7 @@ Item { implicitHeight: Math.max(1, cellContent.height) - color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) + color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) Label { @@ -136,14 +136,14 @@ Item { anchors.fill: parent - enabled: tableScrollView.allowSelection + enabled: tableBase.allowSelection onClicked: { - tableScrollView.currentRow = row; //Select this row. + tableBase.currentRow = row; //Select this row. } onDoubleClicked: { - tableScrollView.onDoubleClicked(row); + tableBase.onDoubleClicked(row); } } } diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 1b12c8ec38..cb4ca1fe37 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -18,7 +18,7 @@ import UM 1.5 as UM */ Item { - id: tableScrollView + id: tableBase required property var columnHeaders //The text to show in the headers of each column. property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items" @@ -35,7 +35,7 @@ Item model: columnHeaders Rectangle { - width: Math.round(tableScrollView.width / headerRepeater.count) + width: Math.round(tableBase.width / headerRepeater.count) height: UM.Theme.getSize("section").height color: UM.Theme.getColor("secondary") @@ -85,9 +85,9 @@ Item { sum_widths += headerBar.children[i].width; } - if(sum_widths > tableScrollView.width) + if(sum_widths > tableBase.width) { - parent.parent.width -= sum_widths - tableScrollView.width; //Limit the total width to not exceed the view. + parent.parent.width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. } } tableView.forceLayout(); @@ -119,7 +119,7 @@ Item { implicitHeight: Math.max(1, cellContent.height) - color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) + color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) Label { @@ -136,14 +136,14 @@ Item { anchors.fill: parent - enabled: tableScrollView.allowSelection + enabled: tableBase.allowSelection onClicked: { - tableScrollView.currentRow = row; //Select this row. + tableBase.currentRow = row; //Select this row. } onDoubleClicked: { - tableScrollView.onDoubleClicked(row); + tableBase.onDoubleClicked(row); } } } From 2a5abfdb01f6dc78d275895322bc7ae961f01b27 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:53:52 +0100 Subject: [PATCH 123/377] Downgrade UM version, re-implementing scroll bar This plug-in needs to be compatible with Cura 4.9 and up, which means we can't use UM.ScrollBar. Contributes to issue CURA-8686. --- .../DigitalLibrary/resources/qml/Table.qml | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index cb4ca1fe37..6eec4d4090 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -5,7 +5,7 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.15 import QtQuick.Controls 2.15 -import UM 1.5 as UM +import UM 1.2 as UM /* * A re-sizeable table of data. @@ -109,7 +109,29 @@ Item } clip: true - ScrollBar.vertical: UM.ScrollBar {} + ScrollBar.vertical: ScrollBar + { + // Vertical ScrollBar, styled similarly to the scrollBar in the settings panel + id: verticalScrollBar + visible: flickableView.contentHeight > flickableView.height + + background: Rectangle + { + implicitWidth: UM.Theme.getSize("scrollbar").width + radius: Math.round(implicitWidth / 2) + color: UM.Theme.getColor("scrollbar_background") + } + + contentItem: Rectangle + { + id: scrollViewHandle + implicitWidth: UM.Theme.getSize("scrollbar").width + radius: Math.round(implicitWidth / 2) + + color: verticalScrollBar.pressed ? UM.Theme.getColor("scrollbar_handle_down") : verticalScrollBar.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle") + Behavior on color { ColorAnimation { duration: 50; } } + } + } columnWidthProvider: function(column) { return headerBar.children[column].width; //Cells get the same width as their column header. From f22fea5f2245e0e4e83f07b92cea3f637c6430a3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 19:05:54 +0100 Subject: [PATCH 124/377] Scroll back to top when contents of table change Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 11 ++++++++++- resources/qml/TableView.qml | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 6eec4d4090..b6162e9135 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -113,7 +113,7 @@ Item { // Vertical ScrollBar, styled similarly to the scrollBar in the settings panel id: verticalScrollBar - visible: flickableView.contentHeight > flickableView.height + visible: tableView.contentHeight > tableView.height background: Rectangle { @@ -169,5 +169,14 @@ Item } } } + + Connections + { + target: model + function onRowCountChanged() + { + tableView.contentY = 0; //When the number of rows is reduced, make sure to scroll back to the start. + } + } } } \ No newline at end of file diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index cb4ca1fe37..079e25d717 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -147,5 +147,14 @@ Item } } } + + Connections + { + target: model + function onRowCountChanged() + { + tableView.contentY = 0; //When the number of rows is reduced, make sure to scroll back to the start. + } + } } } \ No newline at end of file From a3edf9e3e3a8158f1cc086523f667a4e66ced7dc Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 22:33:51 +0100 Subject: [PATCH 125/377] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index fc229cab7b..e88cd954ff 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -53,7 +53,7 @@ UM.ManagementPage { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove"); - icon.name: "list-remove"; + icon.name: "list-remove" enabled: base.currentItem != null && model.count > 1 onClicked: confirmDialog.open(); }, From 95c79e7921f2189f0b07d508518203a3d85568d5 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 22:37:39 +0100 Subject: [PATCH 126/377] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index e88cd954ff..1f01fc4bb0 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -61,7 +61,7 @@ UM.ManagementPage { id: renameMenuButton text: catalog.i18nc("@action:button", "Rename"); - icon.name: "edit-rename"; + icon.name: "edit-rename" enabled: base.currentItem != null && base.currentItem.metadata.group_name == null onClicked: renameDialog.open(); } From 26bd68d891d7cc493306f6fafa6b2ca116655e40 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 22:38:02 +0100 Subject: [PATCH 127/377] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 1f01fc4bb0..166e6c4346 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -46,7 +46,7 @@ UM.ManagementPage { id: addMenuButton text: catalog.i18nc("@action:button", "Add"); - icon.name: "list-add"; + icon.name: "list-add" onClicked: Cura.Actions.addMachine.trigger() }, Button From b51c787f622db64b964767754e932fb20d0ac183 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 08:56:33 +0100 Subject: [PATCH 128/377] Re-use `Cura.ToolbarButton` in per object settings menu CURA-8684 --- .../PerObjectSettingsPanel.qml | 32 ++++++-- .../PerObjectSettingsTool/ToolBarButton.qml | 79 ------------------- 2 files changed, 24 insertions(+), 87 deletions(-) delete mode 100644 plugins/PerObjectSettingsTool/ToolBarButton.qml diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 403dfa499d..6076d7392b 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -77,44 +77,60 @@ Item id: meshTypeButtons spacing: UM.Theme.getSize("default_margin").width - ToolBarButton + Cura.ToolbarButton { id: normalButton text: catalog.i18nc("@label", "Normal model") - iconSource: UM.Theme.getIcon("Infill0"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("Infill0") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable: true onClicked: setMeshType(normalMeshType); z: 4 } - ToolBarButton + Cura.ToolbarButton { id: supportMeshButton text: catalog.i18nc("@label", "Print as support") - iconSource: UM.Theme.getIcon("MeshTypeSupport"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("MeshTypeSupport") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable:true onClicked: setMeshType(supportMeshType) z: 3 } - ToolBarButton + Cura.ToolbarButton { id: overlapMeshButton text: catalog.i18nc("@label", "Modify settings for overlaps") - iconSource: UM.Theme.getIcon("MeshTypeIntersect"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("MeshTypeIntersect") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable:true onClicked: setMeshType(infillMeshType) z: 2 } - ToolBarButton + Cura.ToolbarButton { id: antiOverhangMeshButton text: catalog.i18nc("@label", "Don't support overlaps") - iconSource: UM.Theme.getIcon("BlockSupportOverlaps"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("BlockSupportOverlaps") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable: true onClicked: setMeshType(antiOverhangMeshType) diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml deleted file mode 100644 index 0aa35c3a52..0000000000 --- a/plugins/PerObjectSettingsTool/ToolBarButton.qml +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2022 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.1 -import QtQuick.Controls 2.1 - -import Cura 1.0 as Cura -import UM 1.5 as UM - -Button -{ - id: base - - property alias tooltip: tooltip.text - property alias iconSource: icon.source; - - Cura.ToolTip - { - id: tooltip - visible: base.hovered - targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) - } - - - background: Item - { - implicitWidth: UM.Theme.getSize("button").width - implicitHeight: UM.Theme.getSize("button").height - - Rectangle - { - id: buttonFace - - anchors.fill: parent - property bool down: base.pressed || (base.checkable && base.checked) - - color: - { - if(base.customColor !== undefined && base.customColor !== null) - { - return base.customColor - } - else if(base.checkable && base.checked && base.hovered) - { - return UM.Theme.getColor("toolbar_button_active_hover") - } - else if(base.pressed || (base.checkable && base.checked)) - { - return UM.Theme.getColor("toolbar_button_active") - } - else if(base.hovered) - { - return UM.Theme.getColor("toolbar_button_hover") - } - return UM.Theme.getColor("toolbar_background") - } - Behavior on color { ColorAnimation { duration: 50 } } - - border.width: (base.hasOwnProperty("needBorder") && base.needBorder) ? UM.Theme.getSize("default_lining").width : 0 - border.color: base.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") - } - } - - contentItem: Item - { - UM.RecolorImage - { - id: icon - - anchors.centerIn: parent - opacity: base.enabled ? 1.0 : 0.2 - width: UM.Theme.getSize("medium_button_icon").width - height: UM.Theme.getSize("medium_button_icon").height - color: UM.Theme.getColor("icon") - - sourceSize: UM.Theme.getSize("medium_button_icon") - } - } -} \ No newline at end of file From 200e4df0254a5a3f4907331da6ee82a3030ba575 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 10:25:20 +0100 Subject: [PATCH 129/377] Fix issues in simulation view - Correctly display text in LayerType dropdown menu - Use UM.Label component to reduce code duplication - Don't display QtControls default dropdown icon CURA-8684 --- .../SimulationViewMenuComponent.qml | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index e40f7d0e4b..0a5065abf0 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -93,7 +93,8 @@ Cura.ExpandableComponent spacing: UM.Theme.getSize("layerview_row_spacing").height - ListModel // matches SimulationView.py + // matches SimulationView.py + ListModel { id: layerViewTypes } @@ -129,6 +130,8 @@ Cura.ExpandableComponent ComboBox { id: layerTypeCombobox + textRole: "text" + valueRole: "type_id" width: parent.width model: layerViewTypes visible: !UM.SimulationView.compatibilityMode @@ -146,39 +149,33 @@ Cura.ExpandableComponent radius: UM.Theme.getSize("setting_control_radius").width } - contentItem: Item + indicator: UM.RecolorImage { - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter + id: downArrow + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 + anchors.verticalCenter: parent.verticalCenter - text: ladyerTypeCombobox.currentText - font: UM.Theme.getFont("default"); - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + source: UM.Theme.getIcon("ChevronSingleDown") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } + color: UM.Theme.getColor("setting_control_button"); + } - UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.verticalCenter: parent.verticalCenter + contentItem: UM.Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.right: downArrow.left + anchors.rightMargin: UM.Theme.getSize("default_lining").width + anchors.verticalCenter: parent.verticalCenter - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_button"); - } + text: layerTypeCombobox.currentText + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter } onActivated: From e607ae7b92917f83f65310e433524ac1308d18e7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 11:24:41 +0100 Subject: [PATCH 130/377] Show tooltip if text got elided This way you can still see the whole text, even if the cell is too small. Handy. Contributes to issue CURA-8686. --- resources/qml/TableView.qml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 079e25d717..8dc7cce713 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -132,14 +132,25 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } - MouseArea + TextMetrics + { + id: cellTextMetrics + text: cellContent.text + font: cellContent.font + elide: cellContent.elide + elideWidth: cellContent.width + } + UM.TooltipArea { anchors.fill: parent - enabled: tableBase.allowSelection + text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided. onClicked: { - tableBase.currentRow = row; //Select this row. + if(tableBase.allowSelection) + { + tableBase.currentRow = row; //Select this row. + } } onDoubleClicked: { From 5e5e0febb91a3fa6643cc95107f14ce3d764fc0f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 11:33:42 +0100 Subject: [PATCH 131/377] Format calculated functions in QualitySettingsModel itself That way we don't have to re-format it in the display in the table. Contributes to issue CURA-8686. --- cura/Machines/Models/QualitySettingsModel.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cura/Machines/Models/QualitySettingsModel.py b/cura/Machines/Models/QualitySettingsModel.py index 89a996fba1..63d23240a8 100644 --- a/cura/Machines/Models/QualitySettingsModel.py +++ b/cura/Machines/Models/QualitySettingsModel.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Ultimaker B.V. +# Copyright (c) 2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import pyqtProperty, pyqtSignal, Qt @@ -9,6 +9,7 @@ from UM import i18nCatalog from UM.Logger import Logger from UM.Qt.ListModel import ListModel from UM.Settings.ContainerRegistry import ContainerRegistry +from UM.Settings.SettingFunction import SettingFunction # To format setting functions differently. import os @@ -174,11 +175,16 @@ class QualitySettingsModel(ListModel): if self._i18n_catalog: label = self._i18n_catalog.i18nc(definition.key + " label", label) + if isinstance(profile_value, SettingFunction): + profile_value_display = self._i18n_catalog.i18nc("@info:status", "Calculated") + else: + profile_value_display = "" if profile_value is None else str(profile_value) + items.append({ "key": definition.key, "label": label, "unit": definition.unit, - "profile_value": "" if profile_value is None else str(profile_value), # it is for display only + "profile_value": profile_value_display, "profile_value_source": profile_value_source, "user_value": "" if user_value is None else str(user_value), "category": current_category From c973be3115679d4c90da47366be487d51e971e6a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 11:39:23 +0100 Subject: [PATCH 132/377] Use new TableView for profile overview This requires some more changes that are not yet implemented: Italic text for things that were changed in the profile, and section headers. Let's see what I can do... Contributes to issue CURA-8686. --- resources/qml/ProfileOverview.qml | 92 +++++-------------------------- 1 file changed, 13 insertions(+), 79 deletions(-) diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index b807706e13..eaf4373f4b 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -1,6 +1,7 @@ //Copyright (c) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. +import Qt.labs.qmlmodels 1.0 import QtQuick 2.7 import QtQuick.Controls 1.4 as OldControls import QtQuick.Controls 2.15 @@ -8,7 +9,7 @@ import QtQuick.Controls 2.15 import UM 1.5 as UM import Cura 1.6 as Cura -OldControls.TableView +Cura.TableView { id: profileOverview @@ -24,87 +25,20 @@ OldControls.TableView return qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName; } - Component - { - id: itemDelegate - - UM.TooltipArea - { - property var setting: qualitySettings.getItem(styleData.row) - height: childrenRect.height - width: (parent != null) ? parent.width : 0 - text: - { - if (styleData.value === undefined) - { - return "" - } - return (styleData.value.substr(0,1) == "=") ? styleData.value : "" - } - - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.right: parent.right - text: - { - if (styleData.value === undefined) - { - return "" - } - return (styleData.value.substr(0,1) == "=") ? catalog.i18nc("@info:status", "Calculated") : styleData.value - } - font.strikeout: styleData.column == 1 && setting.user_value != "" && profileOverview.isQualityItemCurrentlyActivated - font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "" && profileOverview.isQualityItemCurrentlyActivated) - opacity: font.strikeout ? 0.5 : 1 - color: styleData.textColor - elide: Text.ElideRight - } - } - } - - OldControls.TableViewColumn - { - role: "label" - title: catalog.i18nc("@title:column", "Setting") - width: (parent.width * 0.4) | 0 - delegate: itemDelegate - } - OldControls.TableViewColumn - { - role: "profile_value" - title: catalog.i18nc("@title:column", "Profile") - width: (parent.width * 0.18) | 0 - delegate: itemDelegate - } - OldControls.TableViewColumn - { - role: "user_value" - title: catalog.i18nc("@title:column", "Current"); - visible: profileOverview.isQualityItemCurrentlyActivated - width: (parent.width * 0.18) | 0 - delegate: itemDelegate - } - OldControls.TableViewColumn - { - role: "unit" - title: catalog.i18nc("@title:column", "Unit") - width: (parent.width * 0.14) | 0 - delegate: itemDelegate - } - - section.property: "category" - section.delegate: Label - { - text: section - font.bold: true - } - - model: Cura.QualitySettingsModel + Cura.QualitySettingsModel { id: qualitySettings selectedPosition: profileOverview.extruderPosition selectedQualityItem: profileOverview.qualityItem == null ? {} : profileOverview.qualityItem } + + columnHeaders: [catalog.i18nc("@title:column", "Setting"), catalog.i18nc("@title:column", "Profile"), catalog.i18nc("@title:column", "Current"), catalog.i18nc("@title:column Unit of measurement", "Unit")] + model: TableModel + { + TableModelColumn { display: "label" } + TableModelColumn { display: "profile_value" } + TableModelColumn { display: "user_value" } + TableModelColumn { display: "unit" } + rows: qualitySettings.items + } } \ No newline at end of file From a74c7aa4f3c8aeef98a147a0892bbb144b8e64e2 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 11:46:40 +0100 Subject: [PATCH 133/377] Remove unused contentItem CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index c0beac3205..e6b5cc3d1d 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -13,8 +13,6 @@ ToolButton property alias tooltip: tooltip.text - contentItem: Label {} - Cura.ToolTip { id: tooltip From b3a6d8a1fc4b032a5816d51d030646ab46bc5766 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 11:47:14 +0100 Subject: [PATCH 134/377] Use `UM.Label` in print setup header button CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index e6b5cc3d1d..8dc99ea38f 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -85,18 +85,16 @@ ToolButton color: base.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") source: UM.Theme.getIcon("ChevronSingleDown") } - Label + UM.Label { id: printSetupComboBoxLabel - color: base.enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - text: base.text; + text: base.text elide: Text.ElideRight; anchors.left: parent.left; anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.right: downArrow.left; - anchors.rightMargin: base.rightMargin; - anchors.verticalCenter: parent.verticalCenter; - font: UM.Theme.getFont("default") + anchors.right: downArrow.lef + anchors.rightMargin: base.rightMargin + anchors.verticalCenter: parent.verticalCenter } } } From a66275ce73c0e0e1f8caf37c3c4f3d2a266dfe34 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 12:01:30 +0100 Subject: [PATCH 135/377] Fix PrintSetupHeaderButton displaying text twice CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 8dc99ea38f..8a4b50ea15 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -85,16 +85,17 @@ ToolButton color: base.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") source: UM.Theme.getIcon("ChevronSingleDown") } - UM.Label - { - id: printSetupComboBoxLabel - text: base.text - elide: Text.ElideRight; - anchors.left: parent.left; - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.right: downArrow.lef - anchors.rightMargin: base.rightMargin - anchors.verticalCenter: parent.verticalCenter - } + } + + contentItem: UM.Label + { + id: printSetupComboBoxLabel + text: base.text + elide: Text.ElideRight; + anchors.left: parent.left; + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width + anchors.right: downArrow.lef + anchors.rightMargin: base.rightMargin + anchors.verticalCenter: parent.verticalCenter } } From a2d03af2f147bf0c073472fe694d6d14f7ea98a1 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 12:15:13 +0100 Subject: [PATCH 136/377] Use states to set border&background color in print setup header button CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 103 +++++++++++++---------- 1 file changed, 59 insertions(+), 44 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 8a4b50ea15..540f16a284 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -20,59 +20,74 @@ ToolButton targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) } - background: Rectangle - { - color: + states: + [ + State { - if(base.enabled) + name: "disabled" + when: !base.enabled; + PropertyChanges { - if(base.valueError) - { - return UM.Theme.getColor("setting_validation_error_background"); - } - else if(base.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning_background"); - } - else - { - return UM.Theme.getColor("setting_control"); - } + target: background + color: UM.Theme.getColor("setting_control_disabled") + border.color: UM.Theme.getColor("setting_control_disabled_border") } - else + }, + State + { + name: "value_error" + when: base.enabled && base.valueError + PropertyChanges { - return UM.Theme.getColor("setting_control_disabled"); + target: background + color: UM.Theme.getColor("setting_validation_error_background") + border.color: UM.Theme.getColor("setting_validation_error") + } + }, + State + { + name: "value_warning" + when: base.enabled && base.valueWarning + PropertyChanges + { + target: background + color: UM.Theme.getColor("setting_validation_warning_background") + border.color: UM.Theme.getColor("setting_validation_warning") + } + }, + State + { + name: "highlight" + when: base.enabled && base.hovered + PropertyChanges + { + target: background + color: UM.Theme.getColor("setting_control") + border.color: UM.Theme.getColor("setting_control_border_highlight") + } + }, + State + { + name: "neutral" + when: base.enabled && !base.hovered && !base.valueWarning && !base.valueError + PropertyChanges + { + target: background + color: UM.Theme.getColor("setting_control") + border.color: UM.Theme.getColor("setting_control_border") } } + ] + + background: Rectangle + { + id: background radius: UM.Theme.getSize("setting_control_radius").width border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (base.enabled) - { - if (base.valueError) - { - return UM.Theme.getColor("setting_validation_error"); - } - else if (base.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning"); - } - else if (base.hovered) - { - return UM.Theme.getColor("setting_control_border_highlight"); - } - else - { - return UM.Theme.getColor("setting_control_border"); - } - } - else - { - return UM.Theme.getColor("setting_control_disabled_border"); - } - } + color: UM.Theme.getColor("setting_control") + border.color: UM.Theme.getColor("setting_control_border") + UM.RecolorImage { id: downArrow From 5c71671585e6b48163528669d20e97fb7f4378c2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 14:00:29 +0100 Subject: [PATCH 137/377] Make setting names italic if changed in quality-changes profile This was the behaviour before. Contributes to issue CURA-8686. --- cura/Machines/Models/QualitySettingsModel.py | 2 ++ resources/qml/TableView.qml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cura/Machines/Models/QualitySettingsModel.py b/cura/Machines/Models/QualitySettingsModel.py index 63d23240a8..bdae032f36 100644 --- a/cura/Machines/Models/QualitySettingsModel.py +++ b/cura/Machines/Models/QualitySettingsModel.py @@ -174,6 +174,8 @@ class QualitySettingsModel(ListModel): label = definition.label if self._i18n_catalog: label = self._i18n_catalog.i18nc(definition.key + " label", label) + if profile_value_source == "quality_changes": + label = f"{label}" # Make setting name italic if it's derived from the quality-changes profile. if isinstance(profile_value, SettingFunction): profile_value_display = self._i18n_catalog.i18nc("@info:status", "Calculated") diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 8dc7cce713..1c5822ec8c 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -53,7 +53,7 @@ Item color: UM.Theme.getColor("text") elide: Text.ElideRight } - Rectangle + Rectangle //Resize handle. { anchors { From fa177f519260d3a1d71e3c54ff98b040cae28940 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 15:36:52 +0100 Subject: [PATCH 138/377] Implement section headers I'm not real happy with the limitations I had to work with here. The TableView can only accept a table of strings, so I basically had to fit everything into editing this dictionary of strings. Not the best. But it's very effective. Contributes to issue CURA-8686. --- resources/qml/ProfileOverview.qml | 1 + resources/qml/TableView.qml | 40 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index eaf4373f4b..06a7268198 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -41,4 +41,5 @@ Cura.TableView TableModelColumn { display: "unit" } rows: qualitySettings.items } + sectionRole: "category" } \ No newline at end of file diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 1c5822ec8c..c30a448ea6 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -25,6 +25,7 @@ Item property int currentRow: -1 //The selected row index. property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on. property bool allowSelection: true //Whether to allow the user to select items. + property string sectionRole: "" Row { @@ -97,6 +98,7 @@ Item } } } + TableView { id: tableView @@ -168,4 +170,42 @@ Item } } } + + Connections + { + target: model + function onRowsChanged() + { + let first_column = model.columns[0].display; + if(model.rows.length > 0 && model.rows[0][first_column].startsWith("")) //First item is already a section header. + { + return; //Assume we already added section headers. Prevent infinite recursion. + } + if(sectionRole === "" || model.rows.length == 0) //No section headers, or no items at all. + { + tableView.model.rows = model.rows; + return; + } + + //Insert section headers in the rows. + let last_section = ""; + let new_rows = []; + for(let i = 0; i < model.rows.length; ++i) + { + let item_section = model.rows[i][sectionRole]; + if(item_section !== last_section) //Starting a new section. + { + let section_header = {}; + for(let key in model.rows[i]) + { + section_header[key] = (key === first_column) ? "" + item_section + "" : ""; //Put the section header in the first column. + } + new_rows.push(section_header); //Add a row representing a section header. + last_section = item_section; + } + new_rows.push(model.rows[i]); + } + tableView.model.rows = new_rows; + } + } } \ No newline at end of file From ec21b167d06776030910b0729dfaeef7169f7688 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 16:29:09 +0100 Subject: [PATCH 139/377] Resize columns when TableView is resized They should retain their width proportionally. This also fixes a case where the width of the TableView was initialised as 0 but then changed for some anchors due to weird bindings. Because it now updates the tableView when the width is changed. Contributes to issue CURA-8686. --- resources/qml/TableView.qml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index c30a448ea6..6499a4f668 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -36,7 +36,7 @@ Item model: columnHeaders Rectangle { - width: Math.round(tableBase.width / headerRepeater.count) + width: Math.max(1, Math.round(tableBase.width / headerRepeater.count)) height: UM.Theme.getSize("section").height color: UM.Theme.getColor("secondary") @@ -80,21 +80,27 @@ Item { if(drag.active) { - parent.parent.width = Math.max(10, parent.parent.width + mouseX); //Don't go smaller than 10 pixels, to make sure you can still scale it back. - let sum_widths = 0; + let new_width = parent.parent.width + mouseX; //Don't go smaller than 10 pixels, to make sure you can still scale it back. + let sum_widths = mouseX; for(let i = 0; i < headerBar.children.length; ++i) { sum_widths += headerBar.children[i].width; } if(sum_widths > tableBase.width) { - parent.parent.width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. + new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. } + let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized. + parent.parent.width = Qt.binding(function() { return tableBase.width * width_fraction }); } - tableView.forceLayout(); } } } + + onWidthChanged: + { + tableView.forceLayout(); //Rescale table cells underneath as well. + } } } } From 7a1c3e1bd5cc961b044d51f94fb706bf09b5586c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 16:30:50 +0100 Subject: [PATCH 140/377] Use customised TableView for Keep/Discard Changes dialogue Had to make some more modifications to get it to work again this time, due to the way the width of the table scales with the dialogue. But it's nice now. Contributes to issue CURA-8686. --- .../DiscardOrKeepProfileChangesDialog.qml | 96 ++++++------------- resources/qml/ProfileOverview.qml | 7 +- 2 files changed, 35 insertions(+), 68 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 0a9d317d2d..c6ee4f31e6 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -1,14 +1,15 @@ -// Copyright (c) 2020 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. +//Copyright (c) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. +import Qt.labs.qmlmodels 1.0 import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls 2.15 as NewControls +import QtQuick.Controls 1.1 as OldControls +import QtQuick.Controls 2.15 import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 import UM 1.2 as UM -import Cura 1.0 as Cura +import Cura 1.6 as Cura UM.Dialog { @@ -17,6 +18,8 @@ UM.Dialog minimumWidth: UM.Theme.getSize("popup_dialog").width minimumHeight: UM.Theme.getSize("popup_dialog").height + width: minimumWidth + height: minimumHeight property var changesModel: Cura.UserChangesModel{ id: userChangesModel} onVisibilityChanged: { @@ -68,72 +71,31 @@ UM.Dialog anchors.bottom: optionRow.top anchors.left: parent.left anchors.right: parent.right - TableView + + Cura.TableView { - anchors.fill: parent - height: base.height - 150 id: tableView - Component + anchors { - id: labelDelegate - Label - { - property var extruder_name: userChangesModel.getItem(styleData.row).extruder - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.right: parent.right - elide: Text.ElideRight - font: UM.Theme.getFont("system") - text: - { - var result = styleData.value - if (extruder_name != "") - { - result += " (" + extruder_name + ")" - } - return result - } - } + top: parent.top + left: parent.left + right: parent.right } + height: base.height - 150 - Component + columnHeaders: [ + catalog.i18nc("@title:column", "Profile settings"), + Cura.MachineManager.activeQualityDisplayNameMap["main"], + catalog.i18nc("@title:column", "Current changes") + ] + model: TableModel { - id: defaultDelegate - Label - { - text: styleData.value - font: UM.Theme.getFont("system") - } + TableModelColumn { display: "label" } + TableModelColumn { display: "original_value" } + TableModelColumn { display: "user_value" } + rows: userChangesModel.items } - - TableViewColumn - { - role: "label" - title: catalog.i18nc("@title:column", "Profile settings") - delegate: labelDelegate - width: (tableView.width * 0.4) | 0 - } - TableViewColumn - { - role: "original_value" - title: Cura.MachineManager.activeQualityDisplayNameMap["main"] - width: (tableView.width * 0.3) | 0 - delegate: defaultDelegate - } - TableViewColumn - { - role: "user_value" - title: catalog.i18nc("@title:column", "Current changes") - width: (tableView.width * 0.3) | 0 - } - section.property: "category" - section.delegate: Label - { - text: section - font.bold: true - } - - model: userChangesModel + sectionRole: "category" } } @@ -146,7 +108,7 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width height: childrenRect.height - NewControls.ComboBox + ComboBox { id: discardOrKeepProfileChangesDropDownButton width: 300 @@ -193,7 +155,7 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width height: childrenRect.height - Button + OldControls.Button { id: discardButton text: catalog.i18nc("@action:button", "Discard changes"); @@ -206,7 +168,7 @@ UM.Dialog isDefault: true } - Button + OldControls.Button { id: keepButton text: catalog.i18nc("@action:button", "Keep changes"); diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index 06a7268198..534c261b5f 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -32,7 +32,12 @@ Cura.TableView selectedQualityItem: profileOverview.qualityItem == null ? {} : profileOverview.qualityItem } - columnHeaders: [catalog.i18nc("@title:column", "Setting"), catalog.i18nc("@title:column", "Profile"), catalog.i18nc("@title:column", "Current"), catalog.i18nc("@title:column Unit of measurement", "Unit")] + columnHeaders: [ + catalog.i18nc("@title:column", "Setting"), + catalog.i18nc("@title:column", "Profile"), + catalog.i18nc("@title:column", "Current"), + catalog.i18nc("@title:column Unit of measurement", "Unit") + ] model: TableModel { TableModelColumn { display: "label" } From 43d407530948de7888643e91989d581e38b02997 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Jan 2022 17:24:24 +0100 Subject: [PATCH 141/377] Bring changes from TableView to Digital Library version The classes should be approximately the same. There's 2 differences now though: * The ScrollBar is re-implemented in the Digital Library because the re-useable component is not available in all Cura editions that the Digital Library needs to support. * The sections are not working. It was removing big parts of the table for some reason and I don't think it's worth debugging since this version of the table doesn't use it at all. It's also a bit faster this way. Contributes to issue CURA-8686. --- .../DigitalLibrary/resources/qml/Table.qml | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index b6162e9135..3cde4e4e1c 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -35,7 +35,7 @@ Item model: columnHeaders Rectangle { - width: Math.round(tableBase.width / headerRepeater.count) + width: Math.max(1, Math.round(tableBase.width / headerRepeater.count)) height: UM.Theme.getSize("section").height color: UM.Theme.getColor("secondary") @@ -53,7 +53,7 @@ Item color: UM.Theme.getColor("text") elide: Text.ElideRight } - Rectangle + Rectangle //Resize handle. { anchors { @@ -79,24 +79,31 @@ Item { if(drag.active) { - parent.parent.width = Math.max(10, parent.parent.width + mouseX); //Don't go smaller than 10 pixels, to make sure you can still scale it back. - let sum_widths = 0; + let new_width = parent.parent.width + mouseX; //Don't go smaller than 10 pixels, to make sure you can still scale it back. + let sum_widths = mouseX; for(let i = 0; i < headerBar.children.length; ++i) { sum_widths += headerBar.children[i].width; } if(sum_widths > tableBase.width) { - parent.parent.width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. + new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. } + let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized. + parent.parent.width = Qt.binding(function() { return tableBase.width * width_fraction }); } - tableView.forceLayout(); } } } + + onWidthChanged: + { + tableView.forceLayout(); //Rescale table cells underneath as well. + } } } } + TableView { id: tableView @@ -154,14 +161,25 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } - MouseArea + TextMetrics + { + id: cellTextMetrics + text: cellContent.text + font: cellContent.font + elide: cellContent.elide + elideWidth: cellContent.width + } + UM.TooltipArea { anchors.fill: parent - enabled: tableBase.allowSelection + text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided. onClicked: { - tableBase.currentRow = row; //Select this row. + if(tableBase.allowSelection) + { + tableBase.currentRow = row; //Select this row. + } } onDoubleClicked: { From 69de60eb1452ea04549e2d485a2d09dcc564bb00 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 27 Jan 2022 16:03:58 +0100 Subject: [PATCH 142/377] Update resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml Co-authored-by: Ghostkeeper --- resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 08d10bbfff..b739ad0436 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -74,7 +74,8 @@ UM.Dialog name: "cura" } - ButtonGroup { + ButtonGroup + { buttons: [cancelButton, importAllAsModelsButton] checkedButton: importAllAsModelsButton } From a5e2e290558782f8750b5edf0f4063a05a58e965 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 27 Jan 2022 16:04:10 +0100 Subject: [PATCH 143/377] Update resources/qml/Preferences/GeneralPage.qml Co-authored-by: Ghostkeeper --- resources/qml/Preferences/GeneralPage.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index f7c19cd27d..9c002b1d80 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -842,7 +842,8 @@ UM.PreferencesPage } } - ButtonGroup { + ButtonGroup + { id: curaUpdatesGroup buttons: [checkUpdatesOptionBeta, checkUpdatesOptionStable] } From 7f17ef6c51431a8e28fa6ac2ef1bdb99be3147b5 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 27 Jan 2022 16:04:17 +0100 Subject: [PATCH 144/377] Update resources/qml/PrintSetupHeaderButton.qml Co-authored-by: Ghostkeeper --- resources/qml/PrintSetupHeaderButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 540f16a284..819d893e16 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 From 4ef394fa2df94c652cb14c2886f4138750e5642a Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 28 Jan 2022 09:47:01 +0100 Subject: [PATCH 145/377] Update manual printer control to QtControls 2 CURA-8684 --- resources/qml/PrinterOutput/ManualPrinterControl.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index fa7e3024dd..33717ad76c 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import UM 1.5 as UM @@ -258,7 +257,7 @@ Item width: height + UM.Theme.getSize("default_margin").width text: model.label - exclusiveGroup: distanceGroup + ButtonGroup.group: distanceGroup checkable: true checked: distancesRow.currentDistance == model.value onClicked: distancesRow.currentDistance = model.value @@ -390,6 +389,6 @@ Item ListElement { label: "10"; value: 10 } ListElement { label: "100"; value: 100 } } - ExclusiveGroup { id: distanceGroup } + ButtonGroup { id: distanceGroup } } } From 2290b46bf3acc75a9346815e0d61e0d5aef94751 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 28 Jan 2022 09:47:44 +0100 Subject: [PATCH 146/377] Use the Cura Combobox Component in simulation view CURA-8684 --- .../SimulationViewMenuComponent.qml | 49 +------------------ 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 0a5065abf0..ba2c62153f 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -127,7 +127,7 @@ Cura.ExpandableComponent }) } - ComboBox + Cura.ComboBox { id: layerTypeCombobox textRole: "text" @@ -136,52 +136,7 @@ Cura.ExpandableComponent model: layerViewTypes visible: !UM.SimulationView.compatibilityMode - background: Rectangle - { - implicitHeight: UM.Theme.getSize("setting_control").height; - implicitWidth: UM.Theme.getSize("setting_control").width; - - color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") - Behavior on color { ColorAnimation { duration: 50; } } - - border.width: UM.Theme.getSize("default_lining").width; - border.color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border"); - radius: UM.Theme.getSize("setting_control_radius").width - } - - indicator: UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.verticalCenter: parent.verticalCenter - - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_button"); - } - - contentItem: UM.Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter - - text: layerTypeCombobox.currentText - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - onActivated: - { - UM.Preferences.setValue("layerview/layer_view_type", index); - } + onActivated: UM.Preferences.setValue("layerview/layer_view_type", index) Component.onCompleted: { From 29fc98fea4e2b3d2320aeb6cee1fb0f77f4da650 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 28 Jan 2022 10:33:01 +0100 Subject: [PATCH 147/377] Add documentation to PrintSetupHeaderButton CURA-8684 --- .../Menus/ConfigurationMenu/CustomConfiguration.qml | 13 +++++-------- resources/qml/PrintSetupHeaderButton.qml | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 95026112ba..cf130487dd 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -7,6 +7,9 @@ import QtQuick.Controls 2.0 import Cura 1.0 as Cura import UM 1.5 as UM +// Simple button for displaying text and changes appearance for various states: enabled, valueError, valueWarning +// - and hovered. Mainly used in CustomConfiguration.qml + Item { UM.I18nCatalog @@ -283,10 +286,7 @@ Item extruderIndex: Cura.ExtruderManager.activeExtruderIndex updateModels: materialSelection.visible } - onClicked: - { - materialsMenu.popup(); - } + onClicked: materialsMenu.popup() } Item { @@ -338,10 +338,7 @@ Item id: nozzlesMenu extruderIndex: Cura.ExtruderManager.activeExtruderIndex } - onClicked: - { - nozzlesMenu.popup(); - } + onClicked: nozzlesMenu.popup() } } diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 819d893e16..a67c48d79f 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -1,6 +1,8 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. +// Button component to be used within the + import QtQuick 2.1 import QtQuick.Controls 2.1 From 7bc109d1f0842ebfe9a0a8db931ad595f1ecfa0b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Jan 2022 10:57:00 +0100 Subject: [PATCH 148/377] Remove outdated comment It's no longer limiting the width to be at least 10 pixels, due to how it has to scale with the width of the table. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 2 +- resources/qml/TableView.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 3cde4e4e1c..2e4c89dfa1 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -79,7 +79,7 @@ Item { if(drag.active) { - let new_width = parent.parent.width + mouseX; //Don't go smaller than 10 pixels, to make sure you can still scale it back. + let new_width = parent.parent.width + mouseX; let sum_widths = mouseX; for(let i = 0; i < headerBar.children.length; ++i) { diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 6499a4f668..cd787a6fd6 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -80,7 +80,7 @@ Item { if(drag.active) { - let new_width = parent.parent.width + mouseX; //Don't go smaller than 10 pixels, to make sure you can still scale it back. + let new_width = parent.parent.width + mouseX; let sum_widths = mouseX; for(let i = 0; i < headerBar.children.length; ++i) { From 92ed791f53c96fcf99c4908423de0b5a651e70de Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Jan 2022 11:06:07 +0100 Subject: [PATCH 149/377] Simplify anchors of background rectangle Contributes to issue CURA-8686. --- resources/qml/Widgets/ScrollableTextArea.qml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml index c0801651ea..7d8f6b886d 100644 --- a/resources/qml/Widgets/ScrollableTextArea.qml +++ b/resources/qml/Widgets/ScrollableTextArea.qml @@ -26,17 +26,8 @@ Flickable background: Rectangle //Providing the background color and border. { - anchors - { - top: parent.top - topMargin: -border.width - bottom: parent.bottom - bottomMargin: -border.width - left: parent.left - leftMargin: -border.width - right: parent.right - rightMargin: -border.width - } + anchors.fill: parent + anchors.margins: -border.width color: scrollableTextAreaBase.back_color border.color: UM.Theme.getColor("thick_lining") From 8d10e1d5a7a6905f09fd0d3fefd7076d4338c3f1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Jan 2022 11:34:44 +0100 Subject: [PATCH 150/377] Simplify check for when quality profiles are activated Should behave the same way. Contributes to issue CURA-8686. --- resources/qml/ProfileOverview.qml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index 534c261b5f..ebca4ff22e 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -15,15 +15,7 @@ Cura.TableView property var qualityItem //The quality profile to display here. property int extruderPosition: -1 //The extruder to display. -1 denotes the global stack. - - property bool isQualityItemCurrentlyActivated: - { - if (qualityItem == null) - { - return false; - } - return qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName; - } + property bool isQualityItemCurrentlyActivated: qualityItem != null && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName Cura.QualitySettingsModel { From fbb72d6f0a2ce8bebe3849b768675090f152ba26 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Jan 2022 15:27:47 +0100 Subject: [PATCH 151/377] Remove horizontal scrollbar policies from Cura.ScrollableTextArea There is no horizontal scrollbar any more so these are giving errors now. Contributes to issue CURA-8686. --- resources/qml/WelcomePages/ChangelogContent.qml | 2 -- resources/qml/WelcomePages/WhatsNewContent.qml | 2 -- 2 files changed, 4 deletions(-) diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 6af6137887..7c3b1adfc3 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -37,8 +37,6 @@ Item anchors.left: parent.left anchors.right: parent.right - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - textArea.text: CuraApplication.getTextManager().getChangeLogText() textArea.textFormat: Text.RichText textArea.wrapMode: Text.WordWrap diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index 179fc372c9..c56f8880ed 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -113,8 +113,6 @@ Item right: subpageImage.right } - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - back_color: UM.Theme.getColor("viewport_overlay") do_borders: false From f62a5e7340ab4cc4a8c4804c8dbb2dda400fb235 Mon Sep 17 00:00:00 2001 From: casper Date: Sun, 30 Jan 2022 23:19:11 +0100 Subject: [PATCH 152/377] Allow decimal point for values input in materials view CURA-8684 --- resources/qml/Preferences/Materials/MaterialsView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index aca8af0cda..fc706beec3 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -270,7 +270,7 @@ OldControls.TabView valueFromText: function(text) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); var precision = Math.pow(10, spoolCostSpinBox.decimals); return Math.round(value * precision) / precision; } @@ -298,7 +298,7 @@ OldControls.TabView valueFromText: function(text, locale) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); return Math.round(value); } From ac080f3cd7fa16b3ab084266280404709d1691de Mon Sep 17 00:00:00 2001 From: casper Date: Sun, 30 Jan 2022 23:22:58 +0100 Subject: [PATCH 153/377] Provide height in the line type combobox of the simulation view CURA-8684 --- plugins/SimulationView/SimulationViewMenuComponent.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index ba2c62153f..74d539ba1d 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -133,6 +133,7 @@ Cura.ExpandableComponent textRole: "text" valueRole: "type_id" width: parent.width + implicitHeight: UM.Theme.getSize("setting_control").height; model: layerViewTypes visible: !UM.SimulationView.compatibilityMode From 89796324579b3e1b770cbb58bdd86344f5fec50b Mon Sep 17 00:00:00 2001 From: casper Date: Sun, 30 Jan 2022 23:30:39 +0100 Subject: [PATCH 154/377] Resolve Qt warning CURA-8684 --- 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 cf130487dd..b25bb5f5eb 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -278,7 +278,7 @@ Item width: selectors.controlWidth height: parent.height - focusPolicy: ClickFocus + focusPolicy: Qt.ClickFocus Cura.MaterialMenu { @@ -330,7 +330,7 @@ Item tooltip: text height: parent.height width: selectors.controlWidth - focusPolicy: ClickFocus + focusPolicy: Qt.ClickFocus enabled: enabledCheckbox.checked Cura.NozzleMenu From f94813a98e26b2825ccdc299743f764713c9d5c1 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 08:59:23 +0100 Subject: [PATCH 155/377] Fix description CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index a67c48d79f..2a595aa06f 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -1,7 +1,8 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -// Button component to be used within the +// Button with a label-like appearance that displays different states (these can be displayed by setting the +// `valueError` or `valueWarning` properties). Mainly used within the `CustomConfiguration` component. import QtQuick 2.1 import QtQuick.Controls 2.1 From 5aa67770a2cfd9bcac21bb1172b13bd5ff860b6a Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 09:00:30 +0100 Subject: [PATCH 156/377] Add properties (with defaults) to the PrintSetupHeaderButton state-props Resolves 2 QML-warnings CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 2a595aa06f..2583c6b84e 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -16,6 +16,9 @@ ToolButton property alias tooltip: tooltip.text + property bool valueError: false; + property bool valueWarning: false; + Cura.ToolTip { id: tooltip From 264ce3bdd16832f8d84e206fbd2b650c5c3d5439 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 10:28:00 +0100 Subject: [PATCH 157/377] Make texts fields selectable by mouse for various components This enables mouse-selectable for - The image reader dialog - Layer view text field (in simulation view) - The TextField with unit component (for instace used to set the scale of models) - Rename dialog(s) - Currency text field - The settings filter text field CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 5 +++++ plugins/PerObjectSettingsTool/SettingPickDialog.qml | 1 + plugins/SimulationView/SimulationSliderLabel.qml | 4 +++- resources/qml/Preferences/GeneralPage.qml | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 1195f0c046..2de1de224c 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -42,6 +42,7 @@ UM.Dialog TextField { id: peak_height + selectByMouse: true objectName: "Peak_Height" validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} width: 180 * screenScaleFactor @@ -65,6 +66,7 @@ UM.Dialog TextField { id: base_height + selectByMouse: true objectName: "Base_Height" validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} width: 180 * screenScaleFactor @@ -88,6 +90,7 @@ UM.Dialog TextField { id: width + selectByMouse: true objectName: "Width" focus: true validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} @@ -111,6 +114,7 @@ UM.Dialog } TextField { id: depth + selectByMouse: true objectName: "Depth" focus: true validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} @@ -180,6 +184,7 @@ UM.Dialog } TextField { id: transmittance + selectByMouse: true objectName: "Transmittance" focus: true validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 0e9202a900..6d5a4be099 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -46,6 +46,7 @@ UM.Dialog TextField { id: filterInput + selectByMouse: true anchors { diff --git a/plugins/SimulationView/SimulationSliderLabel.qml b/plugins/SimulationView/SimulationSliderLabel.qml index 850fff7440..1c434ae935 100644 --- a/plugins/SimulationView/SimulationSliderLabel.qml +++ b/plugins/SimulationView/SimulationSliderLabel.qml @@ -1,5 +1,6 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. + import QtQuick 2.5 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.1 @@ -62,6 +63,7 @@ UM.PointingRectangle font: UM.Theme.getFont("default") renderType: Text.NativeRendering background: Item {} + selectByMouse: true onEditingFinished: { diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 9c002b1d80..c916f096e6 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -216,6 +216,7 @@ UM.PreferencesPage TextField { id: currencyField + selectByMouse: true text: UM.Preferences.getValue("cura/currency") onTextChanged: UM.Preferences.setValue("cura/currency", text) } From 1ecc1ad7535b631c8b159cb0a356ebb819463223 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 13:43:08 +0100 Subject: [PATCH 158/377] Update styling in image loader plugin CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 412 +++++++++++++++++-------------- 1 file changed, 232 insertions(+), 180 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 2de1de224c..16b0827ae8 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -2,227 +2,279 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 import QtQuick.Window 2.1 -import UM 1.1 as UM +import UM 1.5 as UM +import Cura 1.0 as Cura UM.Dialog { - width: minimumWidth; - minimumWidth: 350 * screenScaleFactor; - - height: minimumHeight; - minimumHeight: 250 * screenScaleFactor; - title: catalog.i18nc("@title:window", "Convert Image...") + minimumWidth: grid.width + 2 * UM.Theme.getSize("default_margin").height + minimumHeight: UM.Theme.getSize("modal_window_minimum").height + width: minimumWidth + height: minimumHeight + GridLayout { - UM.I18nCatalog{id: catalog; name: "cura"} - anchors.fill: parent; - Layout.fillWidth: true - columnSpacing: 16 * screenScaleFactor - rowSpacing: 4 * screenScaleFactor - columns: 1 + UM.I18nCatalog { id: catalog; name: "cura" } + id: grid + columnSpacing: UM.Theme.getSize("default_margin").width + rowSpacing: UM.Theme.getSize("thin_margin").height + columns: 2 - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"") - Row { - width: parent.width + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Height (mm)") + Layout.alignment: Qt.AlignVCenter - Label { - text: catalog.i18nc("@action:label", "Height (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - - TextField { - id: peak_height - selectByMouse: true - objectName: "Peak_Height" - validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onPeakHeightChanged(text) } - } + MouseArea { + id: peak_height_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.") - Row { - width: parent.width + TextField + { + id: peak_height + Layout.fillWidth: true + selectByMouse: true + objectName: "Peak_Height" +// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + onTextChanged: manager.onPeakHeightChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Base (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The maximum distance of each pixel from \"Base.\"") + visible: peak_height.hovered || peak_height_label.containsMouse + targetPoint: Qt.point(peak_height.x + Math.round(peak_height.width / 2), 0) + y: peak_height.y + peak_height.height + UM.Theme.getSize("default_margin").height + } - TextField { - id: base_height - selectByMouse: true - objectName: "Base_Height" - validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onBaseHeightChanged(text) } - } + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Base (mm)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: base_height_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.") - Row { - width: parent.width + TextField + { + id: base_height + selectByMouse: true + Layout.fillWidth: true + objectName: "Base_Height" +// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + onTextChanged: manager.onBaseHeightChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Width (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The base height from the build plate in millimeters.") + visible: base_height.hovered || base_height_label.containsMouse + targetPoint: Qt.point(base_height.x + Math.round(base_height.width / 2), 0) + y: base_height.y + base_height.height + UM.Theme.getSize("default_margin").height + } - TextField { - id: width - selectByMouse: true - objectName: "Width" - focus: true - validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onWidthChanged(text) } - } + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Width (mm)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: width_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate") - Row { - width: parent.width + TextField + { + id: width + selectByMouse: true + objectName: "Width" + Layout.fillWidth: true + focus: true +// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + onTextChanged: manager.onWidthChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Depth (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - TextField { - id: depth - selectByMouse: true - objectName: "Depth" - focus: true - validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onDepthChanged(text) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The width in millimeters on the build plate") + visible: width.hovered || width_label.containsMouse + targetPoint: Qt.point(width.x + Math.round(width.width / 2), 0) + y: width.y + width.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Depth (mm)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: depth_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.") - Row { - width: parent.width + TextField + { + id: depth + Layout.fillWidth: true + selectByMouse: true + objectName: "Depth" + focus: true +// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + onTextChanged: manager.onDepthChanged(text) + } - //Empty label so 2 column layout works. - Label { - text: "" - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - ComboBox { - id: lighter_is_higher - objectName: "Lighter_Is_Higher" - model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ] - width: 180 * screenScaleFactor - onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The depth in millimeters on the build plate") + visible: depth.hovered || depth_label.containsMouse + targetPoint: Qt.point(depth.x + Math.round(depth.width / 2), 0) + y: depth.y + depth.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: "" + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: lighter_is_higher_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.") - Row { - width: parent.width + ComboBox + { + id: lighter_is_higher + Layout.fillWidth: true + Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height + objectName: "Lighter_Is_Higher" + model: [catalog.i18nc("@item:inlistbox", "Darker is higher"), catalog.i18nc("@item:inlistbox", "Lighter is higher")] + onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) } + } - Label { - text: "Color Model" - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - ComboBox { - id: color_model - objectName: "ColorModel" - model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ] - width: 180 * screenScaleFactor - onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.") + visible: lighter_is_higher.hovered || lighter_is_higher_label.containsMouse + targetPoint: Qt.point(lighter_is_higher.x + Math.round(lighter_is_higher.width / 2), 0) + y: lighter_is_higher.y + lighter_is_higher.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Color Model") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: color_model_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") - visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency") - Row { - width: parent.width + ComboBox + { + id: color_model + Layout.fillWidth: true + objectName: "ColorModel" + model: [catalog.i18nc("@item:inlistbox", "Linear"), catalog.i18nc("@item:inlistbox", "Translucency")] + onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) } + Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height + } - Label { - text: catalog.i18nc("@action:label", "1mm Transmittance (%)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - TextField { - id: transmittance - selectByMouse: true - objectName: "Transmittance" - focus: true - validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onTransmittanceChanged(text) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.") + visible: color_model.hovered || color_model_label.containsMouse + targetPoint: Qt.point(color_model.x + Math.round(color_model.width / 2), 0) + y: color_model.y + color_model.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "1mm Transmittance (%)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: transmittance_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.") - Row { - width: parent.width + TextField + { + id: transmittance + Layout.fillWidth: true + selectByMouse: true + objectName: "Transmittance" +// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + onTextChanged: manager.onTransmittanceChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Smoothing") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") + visible: transmittance.hovered || transmittance_label.containsMouse + targetPoint: Qt.point(transmittance.x + Math.round(transmittance.width / 2), 0) + y: transmittance.y + transmittance.height + UM.Theme.getSize("default_margin").height + } - Item { - width: 180 * screenScaleFactor - height: 20 * screenScaleFactor - Layout.fillWidth: true + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Smoothing") + Layout.alignment: Qt.AlignVCenter - Slider { - id: smoothing - objectName: "Smoothing" - to: 100.0 - stepSize: 1.0 - width: 180 - onValueChanged: { manager.onSmoothingChanged(value) } - } - } + MouseArea { + id: smoothing_label + anchors.fill: parent + hoverEnabled: true } } + + Slider + { + id: smoothing + Layout.fillWidth: true + objectName: "Smoothing" + to: 100.0 + stepSize: 1.0 + onValueChanged: { manager.onSmoothingChanged(value) } + } + + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The amount of smoothing to apply to the image.") + visible: smoothing.hovered || smoothing_label.containsMouse + targetPoint: Qt.point(smoothing.x + Math.round(smoothing.width / 2), 0) + y: smoothing.y + smoothing.height + UM.Theme.getSize("default_margin").height + } } Item @@ -240,14 +292,14 @@ UM.Dialog rightButtons: [ Button { - id:ok_button - text: catalog.i18nc("@action:button","OK"); + id: ok_button + text: catalog.i18nc("@action:button", "OK") onClicked: manager.onOkButtonClicked() }, Button { - id:cancel_button - text: catalog.i18nc("@action:button","Cancel"); + id: cancel_button + text: catalog.i18nc("@action:button", "Cancel") onClicked: manager.onCancelButtonClicked() } ] From 14767a92c69c8b9fda3aa6727b29c129d87fc239 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 14:35:21 +0100 Subject: [PATCH 159/377] Allow mouse selection in SpinBox CURA-8684 --- .../qml/Preferences/Materials/MaterialsView.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index fc706beec3..b19814a1a0 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -266,6 +266,13 @@ OldControls.TabView to: 100000000 editable: true + contentItem: TextField + { + text: spoolCostSpinBox.textFromValue(spoolCostSpinBox.value, spoolCostSpinBox.locale) + selectByMouse: true + background: Item {} + } + property int decimals: 2 valueFromText: function(text) { @@ -296,6 +303,13 @@ OldControls.TabView to: 10000 editable: true + contentItem: TextField + { + text: spoolWeightSpinBox.textFromValue(spoolWeightSpinBox.value, spoolWeightSpinBox.locale) + selectByMouse: true + background: Item {} + } + valueFromText: function(text, locale) { // remove all non-number tokens from input string so value can be parsed correctly var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); From b2af6308e565bcef875816b3152621d9789f52c1 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 15:18:58 +0100 Subject: [PATCH 160/377] Add validator to material cost/weight spinboxes This way only valid numbers can be entered CURA-8684 --- resources/qml/Preferences/Materials/MaterialsView.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index b19814a1a0..ab152a0fe3 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -271,13 +271,14 @@ OldControls.TabView text: spoolCostSpinBox.textFromValue(spoolCostSpinBox.value, spoolCostSpinBox.locale) selectByMouse: true background: Item {} + validator: RegExpValidator { regExp: new RegExp("^" + base.currency + " ([0-9]+[.]?[0-9]*)?$") } } property int decimals: 2 valueFromText: function(text) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.]+/g, "")); var precision = Math.pow(10, spoolCostSpinBox.decimals); return Math.round(value * precision) / precision; } @@ -308,11 +309,12 @@ OldControls.TabView text: spoolWeightSpinBox.textFromValue(spoolWeightSpinBox.value, spoolWeightSpinBox.locale) selectByMouse: true background: Item {} + validator: RegExpValidator { regExp: new RegExp("^([0-9]+[.]?[0-9]*)? g$") } } valueFromText: function(text, locale) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.]+/g, "")); return Math.round(value); } From 4cb4e0e38c9c8a5b2221f4d99a63f4b559fcd185 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 15:47:42 +0100 Subject: [PATCH 161/377] Re-enable validators in ImageLoaderPlugin CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 16b0827ae8..0d05135b08 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -45,7 +45,7 @@ UM.Dialog Layout.fillWidth: true selectByMouse: true objectName: "Peak_Height" -// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } onTextChanged: manager.onPeakHeightChanged(text) } @@ -76,7 +76,7 @@ UM.Dialog selectByMouse: true Layout.fillWidth: true objectName: "Base_Height" -// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } onTextChanged: manager.onBaseHeightChanged(text) } @@ -108,7 +108,7 @@ UM.Dialog objectName: "Width" Layout.fillWidth: true focus: true -// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onWidthChanged(text) } @@ -140,7 +140,7 @@ UM.Dialog selectByMouse: true objectName: "Depth" focus: true -// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onDepthChanged(text) } @@ -233,7 +233,7 @@ UM.Dialog Layout.fillWidth: true selectByMouse: true objectName: "Transmittance" -// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onTransmittanceChanged(text) } From 6ef28db4585f1d832847b489785d6eb8c664135e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 31 Jan 2022 17:06:59 +0100 Subject: [PATCH 162/377] Remove unneeded semicolon CURA-8684 --- plugins/SimulationView/SimulationViewMenuComponent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 74d539ba1d..ba13a75ea7 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -133,7 +133,7 @@ Cura.ExpandableComponent textRole: "text" valueRole: "type_id" width: parent.width - implicitHeight: UM.Theme.getSize("setting_control").height; + implicitHeight: UM.Theme.getSize("setting_control").height model: layerViewTypes visible: !UM.SimulationView.compatibilityMode From ee81326d6a25765c6e0707e1cf7a9ef550194185 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 31 Jan 2022 17:08:56 +0100 Subject: [PATCH 163/377] Fix remaining merge conflicts - When both branches added Controls1 as OldControls, it's not marked as a merge conflict. But the merge removed the need for OldControls, so the import can be removed. - There was one instance where I had removed the OldControls for a checkbox but there it should remain since the checkboxes are updated in a separate ticket. Contributes to issue CURA-8684. --- .../DigitalLibrary/resources/qml/CreateNewProjectPopup.qml | 4 ++-- .../resources/qml/DigitalFactoryOpenDialog.qml | 4 ++-- .../resources/qml/DigitalFactorySaveDialog.qml | 4 ++-- plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml | 5 ++--- plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 1 - resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml | 1 - resources/qml/Preferences/Materials/MaterialsView.qml | 2 -- resources/qml/Preferences/ProfilesPage.qml | 1 - resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml | 1 - .../Recommended/RecommendedSupportSelector.qml | 1 - resources/qml/ProfileOverview.qml | 1 - 11 files changed, 8 insertions(+), 17 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml b/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml index ee40c55356..74bc52b69e 100644 --- a/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml +++ b/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml @@ -1,8 +1,8 @@ -// Copyright (C) 2021 Ultimaker B.V. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM diff --git a/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml b/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml index 435e8d3f86..11c5d687e8 100644 --- a/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml +++ b/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml @@ -1,8 +1,8 @@ -// Copyright (C) 2021 Ultimaker B.V. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM diff --git a/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml b/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml index 5271db3174..56109dbcbe 100644 --- a/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml +++ b/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml @@ -1,8 +1,8 @@ -// Copyright (C) 2021 Ultimaker B.V. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM diff --git a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml index 25f25e2bbe..1e4b97fb33 100644 --- a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml @@ -1,9 +1,8 @@ -// Copyright (C) 2021 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import QtQuick.Layouts 1.1 diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 943c58ce76..8bf39f6804 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.2 as OldControls import QtQuick.Controls.Styles 1.2 import UM 1.5 as UM diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 422d831a7d..506dd85fac 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -3,7 +3,6 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.1 -import QtQuick.Controls 1.1 as OldControls import QtQuick.Controls 2.15 import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 6fe7d78ebe..d1ea251ab8 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Dialogs 1.2 import UM 1.5 as UM @@ -326,7 +325,6 @@ Item id: spoolWeightSpinBox width: informationPage.columnWidth value: base.getMaterialPreferenceValue(properties.guid, "spool_weight", Cura.ContainerManager.getContainerMetaDataEntry(properties.container_id, "properties/weight")) - suffix: " g" stepSize: 100 to: 10000 editable: true diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index e00c1ee3b0..3d7ceeda5e 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -2,7 +2,6 @@ //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index 2925a10f17..94d55d563d 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 4d23561bf0..49be0fae1c 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Controls 2.3 import UM 1.5 as UM diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index ebca4ff22e..d3aa07ed06 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -3,7 +3,6 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.7 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Controls 2.15 import UM 1.5 as UM From cef3b5db16ca946a95d00d59c79c887fecc19b4b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 31 Jan 2022 17:30:03 +0100 Subject: [PATCH 164/377] Fix mergeconflict CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index eb8b481dd7..ecfc86fc05 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -<<<<<<< HEAD import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import QtQuick.Window 2.1 From ecba5b409ca6615da2a4aeea1311201703ee22b1 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 31 Jan 2022 17:32:10 +0100 Subject: [PATCH 165/377] Fix binding loop in objectItemButton CURA-8684 --- resources/qml/ObjectItemButton.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ObjectItemButton.qml b/resources/qml/ObjectItemButton.qml index 00fe88dd7e..73295b2e69 100644 --- a/resources/qml/ObjectItemButton.qml +++ b/resources/qml/ObjectItemButton.qml @@ -82,7 +82,7 @@ Button right: parent.right rightMargin: 0 } - width: contentItem.width + width: meshTypeIcon.width + perObjectSettingsCountLabel.width + UM.Theme.getSize("narrow_margin").width height: parent.height padding: 0 leftPadding: UM.Theme.getSize("thin_margin").width @@ -131,7 +131,7 @@ Button contentItem: Item { height: parent.height - width: meshTypeIcon.width + perObjectSettingsCountLabel.width + UM.Theme.getSize("narrow_margin").width + width: perObjectSettingsInfo.width Cura.NotificationIcon { From 8de1f923a4564d898ca807660f8b81aa273d322b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 1 Feb 2022 11:54:43 +0100 Subject: [PATCH 166/377] Fix clicking, and don't allow dragging if not needed When I changed the MouseArea into a TooltipArea, the clicking broke because the tooltip area doesn't catch mouse events. I could add another mouse area on top, but for better efficiency it's nice to re-use the TooltipArea. Just need to remember to allow clicking it. I also found a small issue where you could flick the table even if it's not big enough to scroll. This should fix that. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 2 ++ resources/qml/TableView.qml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 2e4c89dfa1..b503bb8e2f 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -115,6 +115,7 @@ Item bottom: parent.bottom } + flickableDirection: Flickable.AutoFlickIfNeeded clip: true ScrollBar.vertical: ScrollBar { @@ -173,6 +174,7 @@ Item { anchors.fill: parent + acceptedButtons: Qt.LeftButton text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided. onClicked: { diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index cd787a6fd6..1fedc34ca0 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -116,6 +116,7 @@ Item bottom: parent.bottom } + flickableDirection: Flickable.AutoFlickIfNeeded clip: true ScrollBar.vertical: UM.ScrollBar {} columnWidthProvider: function(column) @@ -152,6 +153,7 @@ Item { anchors.fill: parent + acceptedButtons: Qt.LeftButton text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided. onClicked: { From 02c517a841b90264dc232c369b53ea0500fede32 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 1 Feb 2022 13:04:16 +0100 Subject: [PATCH 167/377] Enforce minimum column width through binding formula We can't enforce it when resizing, due to the width rescaling with the width. But we can enforce it through the binding formula after applying the width scale. Contributes to issue CURA-8686. --- plugins/DigitalLibrary/resources/qml/Table.qml | 2 +- resources/qml/TableView.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index b503bb8e2f..0f539675a0 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -90,7 +90,7 @@ Item new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. } let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized. - parent.parent.width = Qt.binding(function() { return tableBase.width * width_fraction }); + parent.parent.width = Qt.binding(function() { return Math.max(10, Math.round(tableBase.width * width_fraction)) }); } } } diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 1fedc34ca0..1075ce1f8a 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -91,7 +91,7 @@ Item new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view. } let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized. - parent.parent.width = Qt.binding(function() { return tableBase.width * width_fraction }); + parent.parent.width = Qt.binding(function() { return Math.max(10, Math.round(tableBase.width * width_fraction)) }); } } } From b8e4baba0edb5866ea82dce25d963772a8aabbaf Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 2 Feb 2022 10:13:33 +0100 Subject: [PATCH 168/377] Clean up the manual printer control QML The QML could be simplified quite a bit to get the same results. CURA-8684 --- .../PrinterOutput/ManualPrinterControl.qml | 87 ++++++------------- 1 file changed, 27 insertions(+), 60 deletions(-) diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index 33717ad76c..e70160f716 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -95,80 +95,55 @@ Item { Layout.row: 1 Layout.column: 1 - Layout.preferredWidth: width - Layout.preferredHeight: height - iconSource: UM.Theme.getIcon("ChevronSingleUp"); - width: height - height: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: UM.Theme.getSize("setting_control").height + Layout.preferredHeight: UM.Theme.getSize("setting_control").height + iconSource: UM.Theme.getIcon("ChevronSingleUp") - onClicked: - { - printerModel.moveHead(0, distancesRow.currentDistance, 0) - } + onClicked: printerModel.moveHead(0, distancesRow.currentDistance, 0) } Cura.SecondaryButton { Layout.row: 2 Layout.column: 0 - Layout.preferredWidth: width - Layout.preferredHeight: height - iconSource: UM.Theme.getIcon("ChevronSingleLeft"); - width: height - height: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: UM.Theme.getSize("setting_control").height + Layout.preferredHeight: UM.Theme.getSize("setting_control").height + iconSource: UM.Theme.getIcon("ChevronSingleLeft") - onClicked: - { - printerModel.moveHead(-distancesRow.currentDistance, 0, 0) - } + onClicked: printerModel.moveHead(-distancesRow.currentDistance, 0, 0) } Cura.SecondaryButton { Layout.row: 2 Layout.column: 2 - Layout.preferredWidth: width - Layout.preferredHeight: height - iconSource: UM.Theme.getIcon("ChevronSingleRight"); - width: height - height: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: UM.Theme.getSize("setting_control").height + Layout.preferredHeight: UM.Theme.getSize("setting_control").height + iconSource: UM.Theme.getIcon("ChevronSingleRight") - onClicked: - { - printerModel.moveHead(distancesRow.currentDistance, 0, 0) - } + onClicked: printerModel.moveHead(distancesRow.currentDistance, 0, 0) } Cura.SecondaryButton { Layout.row: 3 Layout.column: 1 - Layout.preferredWidth: width - Layout.preferredHeight: height - iconSource: UM.Theme.getIcon("ChevronSingleDown"); - width: height - height: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: UM.Theme.getSize("setting_control").height + Layout.preferredHeight: UM.Theme.getSize("setting_control").height + iconSource: UM.Theme.getIcon("ChevronSingleDown") - onClicked: - { - printerModel.moveHead(0, -distancesRow.currentDistance, 0) - } + onClicked: printerModel.moveHead(0, -distancesRow.currentDistance, 0) } Cura.SecondaryButton { Layout.row: 2 Layout.column: 1 - Layout.preferredWidth: width - Layout.preferredHeight: height - iconSource: UM.Theme.getIcon("House"); - width: height - height: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: UM.Theme.getSize("setting_control").height + Layout.preferredHeight: UM.Theme.getSize("setting_control").height + iconSource: UM.Theme.getIcon("House") - onClicked: - { - printerModel.homeHead() - } + onClicked: printerModel.homeHead() } } @@ -188,38 +163,30 @@ Item Cura.SecondaryButton { - iconSource: UM.Theme.getIcon("ChevronSingleUp"); + iconSource: UM.Theme.getIcon("ChevronSingleUp") width: height height: UM.Theme.getSize("setting_control").height - onClicked: - { - printerModel.moveHead(0, 0, distancesRow.currentDistance) - } + onClicked: printerModel.moveHead(0, 0, distancesRow.currentDistance) + } Cura.SecondaryButton { - iconSource: UM.Theme.getIcon("House"); + iconSource: UM.Theme.getIcon("House") width: height height: UM.Theme.getSize("setting_control").height - onClicked: - { - printerModel.homeBed() - } + onClicked: printerModel.homeBed() } Cura.SecondaryButton { - iconSource: UM.Theme.getIcon("ChevronSingleDown"); + iconSource: UM.Theme.getIcon("ChevronSingleDown") width: height height: UM.Theme.getSize("setting_control").height - onClicked: - { - printerModel.moveHead(0, 0, -distancesRow.currentDistance) - } + onClicked: printerModel.moveHead(0, 0, -distancesRow.currentDistance) } } } From b18582e1fb2322df5c7a7ff35ef6381bf07b1df8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 2 Feb 2022 10:23:00 +0100 Subject: [PATCH 169/377] Fix size of USB manual control buttons CURA-8684 --- .../PrinterOutput/ManualPrinterControl.qml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index e70160f716..9024d177a0 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -16,7 +16,7 @@ Item property var printerModel: null property var activePrintJob: printerModel != null ? printerModel.activePrintJob : null property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null - + property var _buttonSize: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("thin_margin").height implicitWidth: parent.width implicitHeight: childrenRect.height @@ -95,8 +95,8 @@ Item { Layout.row: 1 Layout.column: 1 - Layout.preferredWidth: UM.Theme.getSize("setting_control").height - Layout.preferredHeight: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: _buttonSize + Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleUp") onClicked: printerModel.moveHead(0, distancesRow.currentDistance, 0) @@ -106,8 +106,8 @@ Item { Layout.row: 2 Layout.column: 0 - Layout.preferredWidth: UM.Theme.getSize("setting_control").height - Layout.preferredHeight: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: _buttonSize + Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleLeft") onClicked: printerModel.moveHead(-distancesRow.currentDistance, 0, 0) @@ -117,8 +117,8 @@ Item { Layout.row: 2 Layout.column: 2 - Layout.preferredWidth: UM.Theme.getSize("setting_control").height - Layout.preferredHeight: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: _buttonSize + Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleRight") onClicked: printerModel.moveHead(distancesRow.currentDistance, 0, 0) @@ -128,8 +128,8 @@ Item { Layout.row: 3 Layout.column: 1 - Layout.preferredWidth: UM.Theme.getSize("setting_control").height - Layout.preferredHeight: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: _buttonSize + Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleDown") onClicked: printerModel.moveHead(0, -distancesRow.currentDistance, 0) @@ -139,8 +139,8 @@ Item { Layout.row: 2 Layout.column: 1 - Layout.preferredWidth: UM.Theme.getSize("setting_control").height - Layout.preferredHeight: UM.Theme.getSize("setting_control").height + Layout.preferredWidth: _buttonSize + Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("House") onClicked: printerModel.homeHead() @@ -165,7 +165,7 @@ Item { iconSource: UM.Theme.getIcon("ChevronSingleUp") width: height - height: UM.Theme.getSize("setting_control").height + height: _buttonSize onClicked: printerModel.moveHead(0, 0, distancesRow.currentDistance) @@ -175,7 +175,7 @@ Item { iconSource: UM.Theme.getIcon("House") width: height - height: UM.Theme.getSize("setting_control").height + height: _buttonSize onClicked: printerModel.homeBed() } @@ -184,7 +184,7 @@ Item { iconSource: UM.Theme.getIcon("ChevronSingleDown") width: height - height: UM.Theme.getSize("setting_control").height + height: _buttonSize onClicked: printerModel.moveHead(0, 0, -distancesRow.currentDistance) } From 9a3cab1ec2c71ec1a16370015664326324197c16 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 4 Feb 2022 13:24:14 +0100 Subject: [PATCH 170/377] Change easy dialogs to UM.MessageDialog A few fields have changed. There's also a harder one, a generic one that is re-usable. I want to do that one in a separate commit since it'll need to be checked all over the code for its usage. Contributes to issue CURA-8687. --- resources/qml/Cura.qml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index f959e62977..7e347df4ee 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 @@ -253,7 +253,6 @@ UM.MainWindow // Try to install plugin & close. CuraApplication.installPackageViaDragAndDrop(filename); packageInstallDialog.text = catalog.i18nc("@label", "This package will be installed after restarting."); - packageInstallDialog.icon = StandardIcon.Information; packageInstallDialog.open(); } else @@ -586,18 +585,15 @@ UM.MainWindow } } - MessageDialog + UM.MessageDialog { id: exitConfirmationDialog title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName) text: catalog.i18nc("@label %1 is the application name", "Are you sure you want to exit %1?").arg(CuraApplication.applicationDisplayName) - icon: StandardIcon.Question - modality: Qt.ApplicationModal - standardButtons: StandardButton.Yes | StandardButton.No - onYes: CuraApplication.callConfirmExitDialogCallback(true) - onNo: CuraApplication.callConfirmExitDialogCallback(false) + standardButtons: Dialog.Yes | Dialog.No + onAccepted: CuraApplication.callConfirmExitDialogCallback(true) onRejected: CuraApplication.callConfirmExitDialogCallback(false) - onVisibilityChanged: + onClosed: { if (!visible) { @@ -747,20 +743,18 @@ UM.MainWindow } } - MessageDialog + UM.MessageDialog { id: packageInstallDialog title: catalog.i18nc("@window:title", "Install Package"); standardButtons: StandardButton.Ok - modality: Qt.ApplicationModal } - MessageDialog + UM.MessageDialog { id: infoMultipleFilesWithGcodeDialog title: catalog.i18nc("@title:window", "Open File(s)") - icon: StandardIcon.Information - standardButtons: StandardButton.Ok + standardButtons: Dialog.Ok text: catalog.i18nc("@text:window", "We have found one or more G-Code files within the files you have selected. You can only open one G-Code file at a time. If you want to open a G-Code file, please just select only one.") property var selectedMultipleFiles From 7f8591718db7189c8879746502e8eba8f8732d88 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 4 Feb 2022 14:31:27 +0100 Subject: [PATCH 171/377] Remove central messageBox in favour of local box The profile import/export was the only place where it was used, in our code base. Contributes to issue CURA-8687. --- cura/CuraApplication.py | 16 ------------ resources/qml/Cura.qml | 29 ---------------------- resources/qml/Preferences/ProfilesPage.qml | 22 +++++++--------- 3 files changed, 9 insertions(+), 58 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index ca708709aa..9145cd771e 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -675,22 +675,6 @@ class CuraApplication(QtApplication): self._setLoadingHint(self._i18n_catalog.i18nc("@info:progress", "Initializing Active Machine...")) super().setGlobalContainerStack(stack) - showMessageBox = pyqtSignal(str,str, str, str, int, int, - arguments = ["title", "text", "informativeText", "detailedText","buttons", "icon"]) - """A reusable dialogbox""" - - def messageBox(self, title, text, - informativeText = "", - detailedText = "", - buttons = QMessageBox.Ok, - icon = QMessageBox.NoIcon, - callback = None, - callback_arguments = [] - ): - self._message_box_callback = callback - self._message_box_callback_arguments = callback_arguments - self.showMessageBox.emit(title, text, informativeText, detailedText, buttons, icon) - showDiscardOrKeepProfileChanges = pyqtSignal() def discardOrKeepProfileChanges(self) -> bool: diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 7e347df4ee..2a5f733dfb 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -813,35 +813,6 @@ UM.MainWindow } } - MessageDialog - { - id: messageDialog - modality: Qt.ApplicationModal - onAccepted: CuraApplication.messageBoxClosed(clickedButton) - onApply: CuraApplication.messageBoxClosed(clickedButton) - onDiscard: CuraApplication.messageBoxClosed(clickedButton) - onHelp: CuraApplication.messageBoxClosed(clickedButton) - onNo: CuraApplication.messageBoxClosed(clickedButton) - onRejected: CuraApplication.messageBoxClosed(clickedButton) - onReset: CuraApplication.messageBoxClosed(clickedButton) - onYes: CuraApplication.messageBoxClosed(clickedButton) - } - - Connections - { - target: CuraApplication - function onShowMessageBox(title, text, informativeText, detailedText, buttons, icon) - { - messageDialog.title = title - messageDialog.text = text - messageDialog.informativeText = informativeText - messageDialog.detailedText = detailedText - messageDialog.standardButtons = buttons - messageDialog.icon = icon - messageDialog.visible = true - } - } - Component { id: discardOrKeepProfileChangesDialogComponent diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 3d7ceeda5e..cf380b33cd 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -311,19 +311,8 @@ Item onAccepted: { var result = Cura.ContainerManager.importProfile(fileUrl); + messageDialog.title = catalog.i18nc("@title:window", "Import Profile") messageDialog.text = result.message; - if (result.status == "ok") - { - messageDialog.icon = StandardIcon.Information; - } - else if (result.status == "warning" || result.status == "duplicate") - { - messageDialog.icon = StandardIcon.Warning; - } - else - { - messageDialog.icon = StandardIcon.Critical; - } messageDialog.open(); CuraApplication.setDefaultPath("dialog_profile_path", folder); } @@ -344,7 +333,7 @@ Item if (result && result.status == "error") { - messageDialog.icon = StandardIcon.Critical; + messageDialog.title = catalog.i18nc("@title:window", "Export Profile") messageDialog.text = result.message; messageDialog.open(); } @@ -354,6 +343,13 @@ Item } } + //Dialogue box for showing the result of importing or exporting profiles. + UM.MessageDialog + { + id: messageDialog + standardButtons: Dialog.Ok + } + Item { id: contentsItem From a03988d146589c52a483fd323b73e2f1ab1a6932 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 4 Feb 2022 14:38:25 +0100 Subject: [PATCH 172/377] Replace MessageDialogs with new custom version Changing a few fields. Contributes to issue CURA-8687. --- .../Preferences/Materials/MaterialsPage.qml | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 819e3a4f8c..dbcef6c573 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -310,17 +310,15 @@ Item } // Dialogs - MessageDialog + UM.MessageDialog { id: confirmRemoveMaterialDialog - icon: StandardIcon.Question; title: catalog.i18nc("@title:window", "Confirm Remove") property string materialName: base.currentItem !== null ? base.currentItem.name : "" text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(materialName) - standardButtons: StandardButton.Yes | StandardButton.No - modality: Qt.ApplicationModal - onYes: + standardButtons: Dialog.Yes | Dialog.No + onAccepted: { // Set the active material as the fallback. It will be selected when the current material is deleted base.newRootMaterialIdToSwitchTo = base.active_root_material_id @@ -340,19 +338,13 @@ Item var result = Cura.ContainerManager.importMaterialContainer(fileUrl); messageDialog.title = catalog.i18nc("@title:window", "Import Material"); - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags or !", "Could not import material %1: %2").arg(fileUrl).arg(result.message); - if (result.status == "success") + if(result.status == "success") { - messageDialog.icon = StandardIcon.Information; messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully imported material %1").arg(fileUrl); } - else if (result.status == "duplicate") - { - messageDialog.icon = StandardIcon.Warning; - } else { - messageDialog.icon = StandardIcon.Critical; + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags or !", "Could not import material %1: %2").arg(fileUrl).arg(result.message); } messageDialog.open(); CuraApplication.setDefaultPath("dialog_material_path", folder); @@ -371,15 +363,13 @@ Item var result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl); messageDialog.title = catalog.i18nc("@title:window", "Export Material"); - if (result.status == "error") + if(result.status == "error") { - messageDialog.icon = StandardIcon.Critical; messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags and !", "Failed to export material to %1: %2").arg(fileUrl).arg(result.message); messageDialog.open(); } - else if (result.status == "success") + else if(result.status == "success") { - messageDialog.icon = StandardIcon.Information; messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully exported material to %1").arg(result.path); messageDialog.open(); } @@ -387,7 +377,7 @@ Item } } - MessageDialog + UM.MessageDialog { id: messageDialog } From 2606a3b847e3a1ef96c60d20785ca56287dd541a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 4 Feb 2022 15:49:06 +0100 Subject: [PATCH 173/377] Change remaining MessageDialogs to our version Contributes to issue CURA-8687. --- .../src/qml/components/BackupListItem.qml | 15 ++++---- .../resources/qml/DiscoverUM3Action.qml | 8 ++--- .../resources/qml/MonitorContextMenu.qml | 34 ++++++++----------- resources/qml/MainWindow/ApplicationMenu.qml | 12 +++---- resources/qml/MonitorButton.qml | 12 +++---- .../Preferences/Materials/MaterialsView.qml | 13 +++---- resources/qml/Preferences/ProfilesPage.qml | 2 +- 7 files changed, 41 insertions(+), 55 deletions(-) diff --git a/plugins/CuraDrive/src/qml/components/BackupListItem.qml b/plugins/CuraDrive/src/qml/components/BackupListItem.qml index ced85d53bd..41e3fb0bf6 100644 --- a/plugins/CuraDrive/src/qml/components/BackupListItem.qml +++ b/plugins/CuraDrive/src/qml/components/BackupListItem.qml @@ -1,10 +1,9 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.1 import UM 1.5 as UM import Cura 1.0 as Cura @@ -88,21 +87,21 @@ Item anchors.top: dataRow.bottom } - MessageDialog + UM.MessageDialog { id: confirmDeleteDialog title: catalog.i18nc("@dialog:title", "Delete Backup") text: catalog.i18nc("@dialog:info", "Are you sure you want to delete this backup? This cannot be undone.") - standardButtons: StandardButton.Yes | StandardButton.No - onYes: CuraDrive.deleteBackup(modelData.backup_id) + standardButtons: Dialog.Yes | Dialog.No + onAccepted: CuraDrive.deleteBackup(modelData.backup_id) } - MessageDialog + UM.MessageDialog { id: confirmRestoreDialog title: catalog.i18nc("@dialog:title", "Restore Backup") text: catalog.i18nc("@dialog:info", "You will need to restart Cura before your backup is restored. Do you want to close Cura now?") - standardButtons: StandardButton.Yes | StandardButton.No - onYes: CuraDrive.restoreBackup(modelData.backup_id) + standardButtons: Dialog.Yes | Dialog.No + onAccepted: CuraDrive.restoreBackup(modelData.backup_id) } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 30d3db0715..9c06388f4b 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -8,7 +8,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.9 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 -import QtQuick.Dialogs 1.2 Cura.MachineAction { @@ -281,15 +280,12 @@ Cura.MachineAction } } - MessageDialog + UM.MessageDialog { id: invalidIPAddressMessageDialog - x: parent ? (parent.x + (parent.width) / 2) : 0 - y: parent ? (parent.y + (parent.height) / 2) : 0 title: catalog.i18nc("@title:window", "Invalid IP address") text: catalog.i18nc("@text", "Please enter a valid IP address.") - icon: StandardIcon.Warning - standardButtons: StandardButton.Ok + standardButtons: Dialog.Ok } UM.Dialog diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml index 34ca3c6df2..d95ca8a88e 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml @@ -1,10 +1,9 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.3 -import QtQuick.Controls 2.0 -import QtQuick.Dialogs 1.1 -import UM 1.3 as UM +import QtQuick.Controls 2.15 +import UM 1.5 as UM /** * A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context @@ -134,32 +133,29 @@ Item } } - MessageDialog { + UM.MessageDialog + { id: sendToTopConfirmationDialog - Component.onCompleted: visible = false - icon: StandardIcon.Warning - onYes: OutputDevice.sendJobToTop(printJob.key) - standardButtons: StandardButton.Yes | StandardButton.No + onAccepted: OutputDevice.sendJobToTop(printJob.key) + standardButtons: Dialog.Yes | Dialog.No text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to move %1 to the top of the queue?").arg(printJob.name) : "" title: catalog.i18nc("@window:title", "Move print job to top") } - MessageDialog { + UM.MessageDialog + { id: deleteConfirmationDialog - Component.onCompleted: visible = false - icon: StandardIcon.Warning - onYes: OutputDevice.deleteJobFromQueue(printJob.key) - standardButtons: StandardButton.Yes | StandardButton.No + onAccepted: OutputDevice.deleteJobFromQueue(printJob.key) + standardButtons: Dialog.Yes | Dialog.No text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to delete %1?").arg(printJob.name) : "" title: catalog.i18nc("@window:title", "Delete print job") } - MessageDialog { + UM.MessageDialog + { id: abortConfirmationDialog - Component.onCompleted: visible = false - icon: StandardIcon.Warning - onYes: printJob.setState("abort") - standardButtons: StandardButton.Yes | StandardButton.No + onAccepted: printJob.setState("abort") + standardButtons: Dialog.Yes | Dialog.No text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to abort %1?").arg(printJob.name) : "" title: catalog.i18nc("@window:title", "Abort print") } diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 269f918ad2..81cf25faa6 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 @@ -61,15 +61,15 @@ Item onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) } - MessageDialog + UM.MessageDialog { id: newProjectDialog - modality: Qt.ApplicationModal + anchors.centerIn: base + title: catalog.i18nc("@title:window", "New project") text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.") - standardButtons: StandardButton.Yes | StandardButton.No - icon: StandardIcon.Question - onYes: + standardButtons: Dialog.Yes | Dialog.No + onAccepted: { CuraApplication.resetWorkspace() Cura.Actions.resetProfile.trigger() diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index db10b2b2bc..02c8c18f7a 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -1,4 +1,4 @@ -//Copyright (c) 2018 Ultimaker B.V. +//Copyright (c) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -325,16 +325,14 @@ Item onClicked: confirmationDialog.visible = true } - MessageDialog + UM.MessageDialog { id: confirmationDialog title: catalog.i18nc("@window:title", "Abort print") - icon: StandardIcon.Warning text: catalog.i18nc("@label", "Are you sure you want to abort the print?") - standardButtons: StandardButton.Yes | StandardButton.No - Component.onCompleted: visible = false - onYes: activePrintJob.setState("abort") + standardButtons: Dialog.Yes | Dialog.No + onAccepted: activePrintJob.setState("abort") } } } diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index d1ea251ab8..39997659e1 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -119,21 +119,20 @@ Item width: base.width property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height - MessageDialog + UM.MessageDialog { id: confirmDiameterChangeDialog + anchors.centerIn: base - icon: StandardIcon.Question; title: catalog.i18nc("@title:window", "Confirm Diameter Change") text: catalog.i18nc("@label (%1 is a number)", "The new filament diameter is set to %1 mm, which is not compatible with the current extruder. Do you wish to continue?".arg(new_diameter_value)) - standardButtons: StandardButton.Yes | StandardButton.No - modality: Qt.ApplicationModal + standardButtons: Dialog.Yes | Dialog.No property var new_diameter_value: null; property var old_diameter_value: null; property var old_approximate_diameter_value: null; - onYes: + onAccepted: { base.setMetaDataEntry("approximate_diameter", old_approximate_diameter_value, getApproximateDiameter(new_diameter_value).toString()); base.setMetaDataEntry("properties/diameter", properties.diameter, new_diameter_value); @@ -142,13 +141,11 @@ Item base.resetSelectedMaterial() } - onNo: + onRejected: { base.properties.diameter = old_diameter_value; diameterSpinBox.value = Qt.binding(function() { return base.properties.diameter }) } - - onRejected: no() } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") } diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index cf380b33cd..fb186dabf1 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -269,7 +269,7 @@ Item } // Confirmation dialog for removing a profile - MessageDialog + UM.MessageDialog { id: confirmRemoveQualityDialog From 1746e24dd9225c6ab0862db4a0b9b1ef7aa6aaf9 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 7 Feb 2022 19:59:57 +0100 Subject: [PATCH 174/377] Make `SpinBox` a reusable component Forgot to update Readonly `SpinBox`es to Qt 2 when implementing Cura 8684. As the spinbox is used in various places with the same functionality it made sense to create a reusable component. There is still a feature gap in the implementation; The `SpinBox`es from QtControls 2.x value is defined as an integer. For some use-cases we do require a fractional value in the `SpinBox`. The only two places where this is required are the `material_diameter` and `material_density` fields in the material prefference page. Cura 8684 --- .../Preferences/Materials/MaterialsView.qml | 67 +++++-------------- resources/qml/Preferences/ReadOnlySpinBox.qml | 54 --------------- resources/qml/SpinBox.qml | 47 +++++++++++++ 3 files changed, 63 insertions(+), 105 deletions(-) delete mode 100644 resources/qml/Preferences/ReadOnlySpinBox.qml create mode 100644 resources/qml/SpinBox.qml diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index d1ea251ab8..283d7a84d2 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -234,30 +234,31 @@ Item Label { width: parent.width; height: parent.rowHeight; font.bold: true; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Properties") } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Density") } - ReadOnlySpinBox + + Cura.SpinBox { + enabled: base.editingEnabled id: densitySpinBox width: informationPage.columnWidth value: properties.density decimals: 2 suffix: " g/cm³" - stepSize: 0.01 - readOnly: !base.editingEnabled + stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size onEditingFinished: base.setMetaDataEntry("properties/density", properties.density, value) onValueChanged: updateCostPerMeter() } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Diameter") } - ReadOnlySpinBox + Cura.SpinBox { + enabled: base.editingEnabled id: diameterSpinBox width: informationPage.columnWidth value: properties.diameter decimals: 2 suffix: " mm" - stepSize: 0.01 - readOnly: !base.editingEnabled + stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size onEditingFinished: { @@ -283,44 +284,26 @@ Item } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament Cost") } - SpinBox + + Cura.SpinBox { id: spoolCostSpinBox width: informationPage.columnWidth value: base.getMaterialPreferenceValue(properties.guid, "spool_cost") to: 100000000 editable: true - - contentItem: TextField - { - text: spoolCostSpinBox.textFromValue(spoolCostSpinBox.value, spoolCostSpinBox.locale) - selectByMouse: true - background: Item {} - validator: RegExpValidator { regExp: new RegExp("^" + base.currency + " ([0-9]+[.]?[0-9]*)?$") } - } - - property int decimals: 2 - - valueFromText: function(text) { - // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(",", ".").replace(/[^0-9.]+/g, "")); - var precision = Math.pow(10, spoolCostSpinBox.decimals); - return Math.round(value * precision) / precision; - } - - textFromValue: function(value) { - return base.currency + " " + value.toFixed(spoolCostSpinBox.decimals) - } + prefix: base.currency + " " + decimals: 2 onValueChanged: { - base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value, decimals)) + base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value)) updateCostPerMeter() } } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament weight") } - SpinBox + Cura.SpinBox { id: spoolWeightSpinBox width: informationPage.columnWidth @@ -328,24 +311,7 @@ Item stepSize: 100 to: 10000 editable: true - - contentItem: TextField - { - text: spoolWeightSpinBox.textFromValue(spoolWeightSpinBox.value, spoolWeightSpinBox.locale) - selectByMouse: true - background: Item {} - validator: RegExpValidator { regExp: new RegExp("^([0-9]+[.]?[0-9]*)? g$") } - } - - valueFromText: function(text, locale) { - // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(",", ".").replace(/[^0-9.]+/g, "")); - return Math.round(value); - } - - textFromValue: function(value, locale) { - return value + " g" - } + suffix: " g" onValueChanged: { @@ -465,7 +431,7 @@ Item elide: Text.ElideRight verticalAlignment: Qt.AlignVCenter } - ReadOnlySpinBox + Cura.SpinBox { id: spinBox anchors.left: label.right @@ -489,9 +455,8 @@ Item return 0; } width: base.secondColumnWidth - readOnly: !base.editingEnabled suffix: " " + model.unit - maximumValue: 99999 + to: 99999 decimals: model.unit == "mm" ? 2 : 0 onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) diff --git a/resources/qml/Preferences/ReadOnlySpinBox.qml b/resources/qml/Preferences/ReadOnlySpinBox.qml deleted file mode 100644 index 11e47b38b2..0000000000 --- a/resources/qml/Preferences/ReadOnlySpinBox.qml +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2016 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Dialogs 1.2 - -Item -{ - id: base - - property alias value: spinBox.value - property alias minimumValue: spinBox.minimumValue - property alias maximumValue: spinBox.maximumValue - property alias stepSize: spinBox.stepSize - property alias prefix: spinBox.prefix - property alias suffix: spinBox.suffix - property alias decimals: spinBox.decimals - - signal editingFinished(); - - property bool readOnly: false - - width: spinBox.width - height: spinBox.height - - SpinBox - { - id: spinBox - - enabled: !base.readOnly - opacity: base.readOnly ? 0.5 : 1.0 - - anchors.fill: parent - - onEditingFinished: base.editingFinished() - Keys.onEnterPressed: spinBox.focus = false - Keys.onReturnPressed: spinBox.focus = false - } - - Label - { - visible: base.readOnly - text: base.prefix + base.value.toFixed(spinBox.decimals) + base.suffix - - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: spinBox.__style ? spinBox.__style.padding.left : 0 - - color: palette.buttonText - } - - SystemPalette { id: palette } -} diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml new file mode 100644 index 0000000000..e71435d8c9 --- /dev/null +++ b/resources/qml/SpinBox.qml @@ -0,0 +1,47 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.2 +import QtQuick.Controls 2.15 + +SpinBox +{ + id: base + + property string prefix: "" + property string suffix: "" + property int decimals: 0 + + signal editingFinished() + + valueFromText: function(text) + { + return parseFloat(text.substring(prefix.length, text.length - suffix.length), decimals); + } + + textFromValue: function(value) + { + return prefix + value.toFixed(decimals) + suffix + } + + validator: RegExpValidator + { + regExp: new RegExp("^" + prefix + "([0-9]+[.|,]?[0-9]*)?" + suffix + "$") + } + + contentItem: TextField + { + text: base.textFromValue(base.value, base.locale) + selectByMouse: true + background: Item {} + validator: base.validator + + onActiveFocusChanged: + { + if(!activeFocus) + { + base.editingFinished() + } + } + } +} \ No newline at end of file From 7b8e73ae3495d85df74ea5309c54c839ba7c249d Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 7 Feb 2022 21:23:17 +0100 Subject: [PATCH 175/377] Update UM.ConfirmRemoveDialog Cura 8687 --- resources/qml/Preferences/MachinesPage.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 166e6c4346..48f53169f3 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -136,8 +136,9 @@ UM.ManagementPage { id: confirmDialog object: base.currentItem && base.currentItem.name ? base.currentItem.name : "" - text: base.currentItem ? base.currentItem.removalWarning : ""; - onYes: + text: base.currentItem ? base.currentItem.removalWarning : "" + + onAccepted: { Cura.MachineManager.removeMachine(base.currentItem.id) if(!base.currentItem) From f957cc289e591b7514e70dbc9816522a4179baef Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 7 Feb 2022 22:01:45 +0100 Subject: [PATCH 176/377] Fix Qt warnings resolve binding loo in `SyncState` move `updateCostPerMeter` function to root of `MaterialView` such that it is available of all sub components Cura 8687 --- resources/qml/Account/SyncState.qml | 4 ++-- .../qml/Preferences/Materials/MaterialsView.qml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index f09759f845..e370c653f7 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -82,8 +82,8 @@ Row // Sync state icon + message id: stateLabel // text is determined by State font: UM.Theme.getFont("medium") - width: contentWidth + UM.Theme.getSize("default_margin").height - height: contentHeight + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.rightMargin: UM.Theme.getSize("default_margin").width visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled } diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 39997659e1..c43b31bbcb 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -420,12 +420,6 @@ Item Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } } - - function updateCostPerMeter() - { - base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); - base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); - } } ListView @@ -518,6 +512,12 @@ Item } } + function updateCostPerMeter() + { + base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); + base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); + } + function calculateSpoolLength(diameter, density, spoolWeight) { if(!diameter) From c10d7d7537a10495c7c5e1416b1b82af97420c2d Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 7 Feb 2022 22:03:37 +0100 Subject: [PATCH 177/377] Fix ProfilesPage The properties were not (fully) updated to the updated properties Cura 8687 --- resources/qml/Preferences/ProfilesPage.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index fb186dabf1..a1a88a4c0b 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -273,13 +273,12 @@ Item { id: confirmRemoveQualityDialog - icon: StandardIcon.Question; title: catalog.i18nc("@title:window", "Confirm Remove") text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItemName) standardButtons: StandardButton.Yes | StandardButton.No - modality: Qt.ApplicationModal + modal: true - onYes: + onAccepted: { base.qualityManagementModel.removeQualityChangesGroup(base.currentItem.quality_changes_group); // reset current item to the first if available From 50820048f7046e65eac2c4d5ee6a815d11f6761b Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 8 Feb 2022 11:34:54 +0100 Subject: [PATCH 178/377] Update SpinBox in ContextMenu --- resources/qml/Menus/ContextMenu.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 4ca51c0974..aeb6eb47f9 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -120,9 +120,10 @@ Menu anchors.verticalCenter: copiesField.verticalCenter } - SpinBox + Cura.SpinBox { id: copiesField + editable: true focus: true from: 1 to: 99 From a0e5d662998641af1b5155182b949f308c194263 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 8 Feb 2022 12:01:42 +0100 Subject: [PATCH 179/377] Disable stepSize in all SpinBoxes where stepSize is a non integer value This should be enabled. However this is a feature gap of QtControls 2.x --- resources/qml/Preferences/Materials/MaterialsView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 283d7a84d2..a3aa451963 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -243,7 +243,7 @@ Item value: properties.density decimals: 2 suffix: " g/cm³" - stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size +// stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size onEditingFinished: base.setMetaDataEntry("properties/density", properties.density, value) onValueChanged: updateCostPerMeter() @@ -258,7 +258,7 @@ Item value: properties.diameter decimals: 2 suffix: " mm" - stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size +// stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size onEditingFinished: { From 9c2d370e724deba3eed2af0273407eee7cfd4cf9 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 8 Feb 2022 15:52:49 +0100 Subject: [PATCH 180/377] Allow `SpinBox` components to contain fractional values --- .../Preferences/Materials/MaterialsView.qml | 16 ++--- resources/qml/SpinBox.qml | 70 +++++++++++++------ 2 files changed, 58 insertions(+), 28 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index a3aa451963..6511812057 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -243,7 +243,7 @@ Item value: properties.density decimals: 2 suffix: " g/cm³" -// stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size + stepSize: 0.01 onEditingFinished: base.setMetaDataEntry("properties/density", properties.density, value) onValueChanged: updateCostPerMeter() @@ -258,7 +258,7 @@ Item value: properties.diameter decimals: 2 suffix: " mm" -// stepSize: 0.01 // spinboxes can only cointain reals, a non-integer value can not be entered as the step size + stepSize: 0.01 onEditingFinished: { @@ -389,12 +389,6 @@ Item Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } } - - function updateCostPerMeter() - { - base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); - base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); - } } ListView @@ -606,4 +600,10 @@ Item base.setMetaDataEntry("brand", old_brand, new_brand) properties.brand = new_brand } + + function updateCostPerMeter() + { + base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); + base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); + } } diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index e71435d8c9..956ffdaa10 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -4,44 +4,74 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 -SpinBox +Item { id: base + height: spinBox.height + property string prefix: "" property string suffix: "" property int decimals: 0 + property real stepSize: 1 + property real value: 0 + property real from: 0 + property real to: 99 - signal editingFinished() + property alias wrap: spinBox.wrap - valueFromText: function(text) - { - return parseFloat(text.substring(prefix.length, text.length - suffix.length), decimals); - } + property bool editable: true - textFromValue: function(value) - { - return prefix + value.toFixed(decimals) + suffix - } - - validator: RegExpValidator + property var validator: RegExpValidator { regExp: new RegExp("^" + prefix + "([0-9]+[.|,]?[0-9]*)?" + suffix + "$") } - contentItem: TextField + signal editingFinished() + + SpinBox { - text: base.textFromValue(base.value, base.locale) - selectByMouse: true - background: Item {} + id: spinBox + anchors.fill: base + + stepSize: 1 + + value: Math.floor(base.value / base.stepSize) + from: Math.floor(base.from / base.stepSize) + to: Math.floor(base.to / base.stepSize) + editable: base.editable + + valueFromText: function(text) + { + return parseFloat(text.substring(prefix.length, text.length - suffix.length)) / base.stepSize; + } + + textFromValue: function(value) + { + return prefix + (value * base.stepSize).toFixed(decimals) + suffix; + } + validator: base.validator - onActiveFocusChanged: + onValueModified: { - if(!activeFocus) + base.value = value * base.stepSize; + } + + contentItem: TextField + { + text: spinBox.textFromValue(spinBox.value, spinBox.locale) + selectByMouse: base.editable + background: Item {} + validator: base.validator + + onActiveFocusChanged: { - base.editingFinished() + if(!activeFocus) + { + base.editingFinished(); + } } } } -} \ No newline at end of file +} From 3a74417e6e2cd0f77dbed757c79b33993dd8d3ed Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 8 Feb 2022 16:01:29 +0100 Subject: [PATCH 181/377] Add comments --- resources/qml/SpinBox.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index 956ffdaa10..4f927d2f25 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -4,6 +4,11 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 +// This component extends the funtionality of QtControls 2.x Spinboxes to +// - be able to contain fractional values +// - hava a "prefix" and a "suffix". A validator is added that recognizes this pre-, suf-fix combo. When adding a custom +// validator the pre-, suf-fix should be added (e.g. new RegExp("^" + prefix + \regex\ + suffix + "$") + Item { id: base @@ -33,13 +38,16 @@ Item { id: spinBox anchors.fill: base + editable: base.editable + // The stepSize of the SpinBox is intentionally set to be always `1` + // As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution + // increasing the spinBox.value by one increases the actual/real value of the component by `base.stepSize` + // as such spinBox.value * base.stepSizes produces the real value of the component stepSize: 1 - value: Math.floor(base.value / base.stepSize) from: Math.floor(base.from / base.stepSize) to: Math.floor(base.to / base.stepSize) - editable: base.editable valueFromText: function(text) { From 4737fed9d4914d0641eded413704572cc2342b55 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 8 Feb 2022 16:48:10 +0100 Subject: [PATCH 182/377] Allow commas as number input --- resources/qml/SpinBox.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index 4f927d2f25..7f30109380 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -51,7 +51,7 @@ Item valueFromText: function(text) { - return parseFloat(text.substring(prefix.length, text.length - suffix.length)) / base.stepSize; + return parseFloat(text.substring(prefix.length, text.length - suffix.length).replace(",", ".")) / base.stepSize; } textFromValue: function(value) From 30bd9e7d6788cd11e543f46f841128421ca8ef32 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 11:17:19 +0100 Subject: [PATCH 183/377] Update Dialog in context menu CURA 8687 --- resources/qml/Menus/ContextMenu.qml | 34 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 4ca51c0974..41309ec82f 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.1 -import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 import UM 1.5 as UM @@ -86,29 +85,34 @@ Menu watchedProperties: [ "value" ] } - Dialog + UM.Dialog { id: multiplyDialog - modality: Qt.ApplicationModal title: catalog.i18ncp("@title:window", "Multiply Selected Model", "Multiply Selected Models", UM.Selection.selectionCount) + width: UM.Theme.getSize("small_popup_dialog").width + height: UM.Theme.getSize("small_popup_dialog").height + minimumWidth: UM.Theme.getSize("small_popup_dialog").width + minimumHeight: UM.Theme.getSize("small_popup_dialog").height onAccepted: CuraActions.multiplySelection(copiesField.value) - signal reset() - onReset: - { - copiesField.value = 1; - copiesField.focus = true; - } + buttonSpacing: UM.Theme.getSize("thin_margin").width - onVisibleChanged: - { - copiesField.forceActiveFocus(); - } - - standardButtons: StandardButton.Ok | StandardButton.Cancel + rightButtons: + [ + Cura.SecondaryButton + { + text: "Cancel" + onClicked: multiplyDialog.reject() + }, + Cura.PrimaryButton + { + text: "Ok" + onClicked: multiplyDialog.accept() + } + ] Row { From 6b85423948fdc4e749fb051685cd91526ad9324f Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 12:31:26 +0100 Subject: [PATCH 184/377] Update `WorkSpaceSummaryDialog` CURA 8687 --- .../qml/Dialogs/WorkspaceSummaryDialog.qml | 86 +++++++------------ resources/qml/MainWindow/ApplicationMenu.qml | 2 +- resources/qml/Menus/SaveProjectMenu.qml | 2 +- 3 files changed, 33 insertions(+), 57 deletions(-) diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 5278168a77..27a7fd734f 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.9 import QtQuick.Layouts 1.3 -import QtQuick.Window 2.2 import UM 1.5 as UM import Cura 1.0 as Cura @@ -14,26 +13,14 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Save Project") - minimumWidth: 500 * screenScaleFactor - minimumHeight: 400 * screenScaleFactor + minimumWidth: UM.Theme.getSize("popup_dialog").width + minimumHeight: UM.Theme.getSize("popup_dialog").height width: minimumWidth height: minimumHeight - property int spacerHeight: 10 * screenScaleFactor - property bool dontShowAgain: true - signal yes(); - - function accept() { // pressing enter will call this function - close(); - yes(); - } - - onClosing: - { - UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked) - } + onClosing: UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked) onVisibleChanged: { @@ -78,7 +65,7 @@ UM.Dialog { top: mainHeading.bottom topMargin: UM.Theme.getSize("default_margin").height - bottom: controls.top + bottom: parent.bottom bottomMargin: UM.Theme.getSize("default_margin").height } @@ -280,43 +267,32 @@ UM.Dialog } } } - Item - { - id: controls - width: parent.width - height: childrenRect.height - anchors.bottom: parent.bottom - CheckBox - { - id: dontShowAgainCheckbox - anchors.left: parent.left - text: catalog.i18nc("@action:label", "Don't show project summary on save again") - checked: dontShowAgain - } - Button - { - id: cancel_button - anchors - { - right: ok_button.left - rightMargin: UM.Theme.getSize("default_margin").width - } - text: catalog.i18nc("@action:button","Cancel"); - enabled: true - onClicked: close() - } - Button - { - id: ok_button - anchors.right: parent.right - text: catalog.i18nc("@action:button","Save"); - enabled: true - onClicked: - { - close() - yes() - } - } - } } + + buttonSpacing: UM.Theme.getSize("thin_margin").width + + leftButtons: + [ + CheckBox + { + id: dontShowAgainCheckbox + anchors.left: parent.left + text: catalog.i18nc("@action:label", "Don't show project summary on save again") + checked: dontShowAgain + } + ] + + rightButtons: + [ + Cura.SecondaryButton + { + text: catalog.i18nc("@action:button", "Cancel") + onClicked: base.reject() + }, + Cura.PrimaryButton + { + text: catalog.i18nc("@action:button", "Save") + onClicked: base.accept() + } + ] } diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 81cf25faa6..7280d0b22f 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -58,7 +58,7 @@ Item { id: saveWorkspaceDialog property var args - onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) + onAccepted: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) } UM.MessageDialog diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index 3f43289993..16d54382d1 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -52,6 +52,6 @@ Cura.Menu id: saveWorkspaceDialog property var args property var deviceId - onYes: UM.OutputDeviceManager.requestWriteToDevice(deviceId, PrintInformation.jobName, args) + onAccepted: UM.OutputDeviceManager.requestWriteToDevice(deviceId, PrintInformation.jobName, args) } } From 8fc0fb2737c5139efa630769ec156af97861ab6e Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 12:34:18 +0100 Subject: [PATCH 185/377] Update `AboutDialog` CURA 8687 --- resources/qml/Dialogs/AboutDialog.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index e2a89ece59..95b46eeaf8 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -1,11 +1,11 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 import QtQuick.Controls 2.9 -import QtQuick.Window 2.1 import UM 1.5 as UM +import Cura 1.5 as Cura UM.Dialog { @@ -165,11 +165,11 @@ UM.Dialog } } - rightButtons: Button + rightButtons: Cura.SecondaryButton { //: Close about dialog button id: closeButton - text: catalog.i18nc("@action:button","Close"); + text: catalog.i18nc("@action:button", "Close"); onClicked: base.visible = false; } From f59a23fd8269e747b87db7a185e0117b0e23aadd Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 12:36:00 +0100 Subject: [PATCH 186/377] Update OpenFiles Dialog CURA 8687 --- .../OpenFilesIncludingProjectsDialog.qml | 76 ++++--------------- 1 file changed, 15 insertions(+), 61 deletions(-) diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index b739ad0436..31e3b46599 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -4,11 +4,9 @@ import QtQuick 2.2 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.1 -import UM 1.3 as UM -import Cura 1.0 as Cura +import UM 1.5 as UM +import Cura 1.5 as Cura UM.Dialog { @@ -16,9 +14,9 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Open file(s)") - width: 420 * screenScaleFactor - height: 170 * screenScaleFactor + width: UM.Theme.getSize("small_popup_dialog").width + height: UM.Theme.getSize("small_popup_dialog").height maximumHeight: height maximumWidth: width minimumHeight: height @@ -28,12 +26,6 @@ UM.Dialog property var fileUrls: [] property var addToRecent: true - property int spacerHeight: 10 * screenScaleFactor - - function loadProjectFile(projectFile) - { - UM.WorkspaceFileHandler.readLocalFile(projectFile, base.addToRecent); - } function loadModelFiles(fileUrls) { @@ -43,69 +35,31 @@ UM.Dialog } } - Column + onAccepted: loadModelFiles(base.fileUrls) + + UM.Label { - anchors.fill: parent - anchors.leftMargin: 20 * screenScaleFactor - anchors.rightMargin: 20 * screenScaleFactor - anchors.bottomMargin: 20 * screenScaleFactor + text: catalog.i18nc("@text:window", "We have found one or more project file(s) within the files you have selected. You can open only one project file at a time. We suggest to only import models from those files. Would you like to proceed?") anchors.left: parent.left anchors.right: parent.right - spacing: 10 * screenScaleFactor - - Label - { - text: catalog.i18nc("@text:window", "We have found one or more project file(s) within the files you have selected. You can open only one project file at a time. We suggest to only import models from those files. Would you like to proceed?") - anchors.left: parent.left - anchors.right: parent.right - font: UM.Theme.getFont("default") - wrapMode: Text.WordWrap - } - - Item // Spacer - { - height: base.spacerHeight - width: height - } - - UM.I18nCatalog - { - id: catalog - name: "cura" - } - - ButtonGroup - { - buttons: [cancelButton, importAllAsModelsButton] - checkedButton: importAllAsModelsButton - } + font: UM.Theme.getFont("default") + wrapMode: Text.WordWrap } - onAccepted: loadModelFiles(base.fileUrls) + buttonSpacing: UM.Theme.getSize("thin_margin").width // Buttons rightButtons: [ - Button + Cura.SecondaryButton { - id: cancelButton text: catalog.i18nc("@action:button", "Cancel"); - onClicked: - { - // cancel - base.hide(); - } + onClicked: base.reject() }, - Button + Cura.PrimaryButton { - id: importAllAsModelsButton text: catalog.i18nc("@action:button", "Import all as models"); - onClicked: - { - // load models from all selected file - loadModelFiles(base.fileUrls); - base.hide(); - } + onClicked: base.accept() } ] } \ No newline at end of file From 72c038a8b118018e14ce12d8ffe82767efc12670 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 12:36:56 +0100 Subject: [PATCH 187/377] Update `AskOpenAsProjectOrModelsDialog` CURA 8687 --- .../AskOpenAsProjectOrModelsDialog.qml | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 725b25e1e1..b398f2e584 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -4,12 +4,9 @@ import QtQuick 2.2 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.1 import UM 1.3 as UM -import Cura 1.0 as Cura - +import Cura 1.5 as Cura UM.Dialog { @@ -76,17 +73,13 @@ UM.Dialog Column { anchors.fill: parent - anchors.leftMargin: 20 * screenScaleFactor - anchors.rightMargin: 20 * screenScaleFactor - anchors.bottomMargin: 10 * screenScaleFactor - spacing: 10 * screenScaleFactor + spacing: UM.Theme.getSize("default_margin").height Label { id: questionText + width: parent.width text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?") - anchors.left: parent.left - anchors.right: parent.right font: UM.Theme.getFont("default") wrapMode: Text.WordWrap } @@ -99,28 +92,20 @@ UM.Dialog } } - Item - { - ButtonGroup - { - buttons: [openAsProjectButton, importModelsButton] - checkedButton: openAsProjectButton - } - } - onAccepted: loadProjectFile() onRejected: loadModelFiles() - rightButtons: [ - Button + buttonSpacing: UM.Theme.getSize("thin_margin").width + + rightButtons: + [ + Cura.PrimaryButton { - id: openAsProjectButton text: catalog.i18nc("@action:button", "Open as project") onClicked: loadProjectFile() }, - Button + Cura.SecondaryButton { - id: importModelsButton text: catalog.i18nc("@action:button", "Import models") onClicked: loadModelFiles() } From 6ca14ecbaea195c1d2d2cc4a13ee7abecc953ad4 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 13:05:48 +0100 Subject: [PATCH 188/377] Update `DiscardOrKeepProfileChangesDialog` CURA 8687 --- .../DiscardOrKeepProfileChangesDialog.qml | 70 ++++++------------- 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 506dd85fac..568c84b063 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -4,10 +4,8 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.1 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 -import QtQuick.Window 2.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.6 as Cura UM.Dialog @@ -22,7 +20,9 @@ UM.Dialog minimumHeight: UM.Theme.getSize("popup_dialog").height width: minimumWidth height: minimumHeight - property var changesModel: Cura.UserChangesModel{ id: userChangesModel} + + property var changesModel: Cura.UserChangesModel { id: userChangesModel } + onVisibilityChanged: { if(visible) @@ -46,7 +46,6 @@ UM.Dialog { id: infoTextRow height: childrenRect.height - anchors.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left anchors.right: parent.right spacing: UM.Theme.getSize("default_margin").width @@ -57,32 +56,27 @@ UM.Dialog name: "cura" } - Label + UM.Label { text: catalog.i18nc("@text:window, %1 is a profile name", "You have customized some profile settings.\nWould you like to Keep these changed settings after switching profiles?\nAlternatively, you can discard the changes to load the defaults from '%1'.").arg(Cura.MachineManager.activeQualityDisplayNameMap["main"]) - anchors.margins: UM.Theme.getSize("default_margin").width + anchors.left: parent.left + anchors.right: parent.right wrapMode: Text.WordWrap } } Item { - anchors.margins: UM.Theme.getSize("default_margin").width + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.top: infoTextRow.bottom - anchors.bottom: optionRow.top + anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right Cura.TableView { id: tableView - anchors - { - top: parent.top - left: parent.left - right: parent.right - } - height: base.height - 150 + anchors.fill: parent columnHeaders: [ catalog.i18nc("@title:column", "Profile settings"), @@ -100,15 +94,9 @@ UM.Dialog } } - Item - { - id: optionRow - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: parent.left - anchors.margins: UM.Theme.getSize("default_margin").width - height: childrenRect.height + buttonSpacing: UM.Theme.getSize("thin_margin").width + leftButtons: [ ComboBox { id: discardOrKeepProfileChangesDropDownButton @@ -145,37 +133,21 @@ UM.Dialog } } } - } + ] - Item - { - ButtonGroup - { - buttons: [discardButton, keepButton] - checkedButton: discardButton - } - } - - rightButtons: [ - Button + rightButtons: + [ + Cura.PrimaryButton { id: discardButton - text: catalog.i18nc("@action:button", "Discard changes"); - onClicked: - { - CuraApplication.discardOrKeepProfileChangesClosed("discard") - base.hide() - } + text: catalog.i18nc("@action:button", "Discard changes") + onClicked: base.accept() }, - Button + Cura.SecondaryButton { id: keepButton - text: catalog.i18nc("@action:button", "Keep changes"); - onClicked: - { - CuraApplication.discardOrKeepProfileChangesClosed("keep") - base.hide() - } + text: catalog.i18nc("@action:button", "Keep changes") + onClicked: base.reject() } ] } From adcf312de741cbfc719e01f1344bde0095ec79cb Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 13:11:17 +0100 Subject: [PATCH 189/377] Resolve Qt warnings CURA 8687 --- .../DiscardOrKeepProfileChangesDialog.qml | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 568c84b063..18517d5e96 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -42,33 +42,25 @@ UM.Dialog } } - Row + UM.Label { - id: infoTextRow - height: childrenRect.height + id: infoText + text: catalog.i18nc("@text:window, %1 is a profile name", "You have customized some profile settings. Would you like to Keep these changed settings after switching profiles? Alternatively, you can discard the changes to load the defaults from '%1'.").arg(Cura.MachineManager.activeQualityDisplayNameMap["main"]) anchors.left: parent.left anchors.right: parent.right - spacing: UM.Theme.getSize("default_margin").width + wrapMode: Text.WordWrap UM.I18nCatalog { - id: catalog; + id: catalog name: "cura" } - - UM.Label - { - text: catalog.i18nc("@text:window, %1 is a profile name", "You have customized some profile settings.\nWould you like to Keep these changed settings after switching profiles?\nAlternatively, you can discard the changes to load the defaults from '%1'.").arg(Cura.MachineManager.activeQualityDisplayNameMap["main"]) - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - } } Item { anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.top: infoTextRow.bottom + anchors.top: infoText.bottom anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right From 1375b1c65743831e0ed6cf560afbec68fa9163be Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 9 Feb 2022 14:56:06 +0100 Subject: [PATCH 190/377] Remove unused QtQuick.Dialogs imports Cura-8687 --- plugins/PostProcessingPlugin/PostProcessingPlugin.qml | 1 - plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml | 1 - .../resources/qml/MonitorConfigOverrideDialog.qml | 1 - resources/qml/Preferences/Materials/MaterialsBrandSection.qml | 1 - resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml | 1 - resources/qml/Preferences/Materials/MaterialsList.qml | 1 - resources/qml/Preferences/Materials/MaterialsTypeSection.qml | 1 - resources/qml/Preferences/ReadOnlySpinBox.qml | 1 - resources/qml/Preferences/ReadOnlyTextField.qml | 1 - 9 files changed, 9 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index d4ed30dea6..cee80f288e 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -5,7 +5,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 import QtQml.Models 2.15 as Models import QtQuick.Layouts 1.1 -import QtQuick.Dialogs 1.1 import QtQuick.Window 2.2 import UM 1.5 as UM diff --git a/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml b/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml index 6b03072e04..580338ae0c 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/GenericPopUp.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.0 -import QtQuick.Dialogs 1.1 import QtGraphicalEffects 1.0 import UM 1.3 as UM diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 690c50c275..343e3f79e1 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -4,7 +4,6 @@ import QtQuick 2.3 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 import UM 1.5 as UM UM.Dialog diff --git a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml index f0747e697c..1e1ae088e8 100644 --- a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml @@ -5,7 +5,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml b/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml index e821dfb955..04c722cd40 100644 --- a/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml +++ b/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml @@ -4,7 +4,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Preferences/Materials/MaterialsList.qml b/resources/qml/Preferences/Materials/MaterialsList.qml index 2e09ad58d9..6cbb42ad15 100644 --- a/resources/qml/Preferences/Materials/MaterialsList.qml +++ b/resources/qml/Preferences/Materials/MaterialsList.qml @@ -4,7 +4,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml index d1d424b290..0f438cf7e7 100644 --- a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml @@ -5,7 +5,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Preferences/ReadOnlySpinBox.qml b/resources/qml/Preferences/ReadOnlySpinBox.qml index 11e47b38b2..df066ef3ab 100644 --- a/resources/qml/Preferences/ReadOnlySpinBox.qml +++ b/resources/qml/Preferences/ReadOnlySpinBox.qml @@ -3,7 +3,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 -import QtQuick.Dialogs 1.2 Item { diff --git a/resources/qml/Preferences/ReadOnlyTextField.qml b/resources/qml/Preferences/ReadOnlyTextField.qml index 38d07d7d6a..6f5a66d2a9 100644 --- a/resources/qml/Preferences/ReadOnlyTextField.qml +++ b/resources/qml/Preferences/ReadOnlyTextField.qml @@ -4,7 +4,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 -import QtQuick.Dialogs 1.2 Item { From 84ecc8d16859bf4f6365d44be0d35968d76beb4f Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 15:50:05 +0100 Subject: [PATCH 191/377] Remove unused imports CURA 8687 --- plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml | 1 - resources/qml/MainWindow/ApplicationMenu.qml | 1 - resources/qml/MonitorButton.qml | 1 - resources/qml/Preferences/Materials/MaterialsSlot.qml | 1 - 4 files changed, 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index e115cb14ee..3297b16beb 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -3,7 +3,6 @@ import QtQuick 2.3 import QtQuick.Controls 2.0 -import QtQuick.Dialogs 1.1 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 7280d0b22f..1298b6bdf1 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.2 import UM 1.5 as UM import Cura 1.1 as Cura diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 02c8c18f7a..16c0ae086f 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -4,7 +4,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 -import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 import UM 1.5 as UM diff --git a/resources/qml/Preferences/Materials/MaterialsSlot.qml b/resources/qml/Preferences/Materials/MaterialsSlot.qml index 52728181b6..cd8c05fbf9 100644 --- a/resources/qml/Preferences/Materials/MaterialsSlot.qml +++ b/resources/qml/Preferences/Materials/MaterialsSlot.qml @@ -4,7 +4,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 import UM 1.2 as UM import Cura 1.0 as Cura From 2e1f2a37a3fafaec9557812342ed135c96f97818 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 9 Feb 2022 16:45:34 +0100 Subject: [PATCH 192/377] Fix centering of `MessageDialog` Instead of centering in the parent the dialog is now center within the `Overlay.overlay`. This is the window container. CURA 8687 --- resources/qml/MainWindow/ApplicationMenu.qml | 1 - resources/qml/Preferences/Materials/MaterialsView.qml | 1 - 2 files changed, 2 deletions(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 1298b6bdf1..707111309c 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -63,7 +63,6 @@ Item UM.MessageDialog { id: newProjectDialog - anchors.centerIn: base title: catalog.i18nc("@title:window", "New project") text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.") diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index c43b31bbcb..14890b2d9f 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -122,7 +122,6 @@ Item UM.MessageDialog { id: confirmDiameterChangeDialog - anchors.centerIn: base title: catalog.i18nc("@title:window", "Confirm Diameter Change") text: catalog.i18nc("@label (%1 is a number)", "The new filament diameter is set to %1 mm, which is not compatible with the current extruder. Do you wish to continue?".arg(new_diameter_value)) From ddc43446e6baf5e81c99ecbe743f97e32b519a69 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Feb 2022 10:37:26 +0100 Subject: [PATCH 193/377] Fix wrapping in sync menu --- resources/qml/Account/SyncState.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index f09759f845..dedb0d597c 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -83,6 +83,7 @@ Row // Sync state icon + message // text is determined by State font: UM.Theme.getFont("medium") width: contentWidth + UM.Theme.getSize("default_margin").height + wrapMode: Text.NoWrap height: contentHeight visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled } @@ -94,6 +95,7 @@ Row // Sync state icon + message color: UM.Theme.getColor("text_link") font: UM.Theme.getFont("medium") height: contentHeight + wrapMode: Text.NoWrap width: contentWidth + UM.Theme.getSize("default_margin").height visible: Cura.API.account.updatePackagesEnabled @@ -113,6 +115,7 @@ Row // Sync state icon + message text: catalog.i18nc("@button", "Check for account updates") color: UM.Theme.getColor("text_link") font: UM.Theme.getFont("medium") + wrapMode: Text.NoWrap height: contentHeight width: contentWidth + UM.Theme.getSize("default_margin").height visible: Cura.API.account.manualSyncEnabled From 5615ec82a3811c8b1f44aad2e30f23a00c7c21cc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Feb 2022 10:45:51 +0100 Subject: [PATCH 194/377] Prevent text in configuration menu from spilling out of the menu --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 9860a522e5..c9d0cd3e1b 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -195,6 +195,7 @@ Cura.ExpandablePopup text: model.material_brand + " " + model.material_name elide: Text.ElideRight + wrapMode: Text.NoWrap width: parent.width visible: !truncated } From 78523789e7f49c43a6a9f40c172df5ee06ea3cdc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Feb 2022 10:49:18 +0100 Subject: [PATCH 195/377] Use correct styling in settingmenu --- resources/qml/Menus/SettingsMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index e02d146296..6ee126890c 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -19,7 +19,7 @@ Cura.Menu { id: extruderInstantiator model: activeMachine == null ? null : activeMachine.extruderList - Menu + Cura.Menu { title: modelData.name property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index] From 1b9c86603c461aa6039d80272c1579117d350f2b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Feb 2022 10:59:21 +0100 Subject: [PATCH 196/377] Fix layout of multiply object dialog --- resources/qml/Menus/ContextMenu.qml | 4 +++- resources/qml/SpinBox.qml | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index aeb6eb47f9..16ce00fa05 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -114,10 +114,12 @@ Menu { spacing: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@label", "Number of Copies") anchors.verticalCenter: copiesField.verticalCenter + width: contentWidth + wrapMode: Text.NoWrap } Cura.SpinBox diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index 7f30109380..d064da4f18 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -13,8 +13,6 @@ Item { id: base - height: spinBox.height - property string prefix: "" property string suffix: "" property int decimals: 0 @@ -33,7 +31,8 @@ Item } signal editingFinished() - + implicitWidth: spinBox.implicitWidth + implicitHeight: spinBox.implicitHeight SpinBox { id: spinBox From f15f01e32f3f78cfcaf22a8db1173e5749d238d1 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Feb 2022 11:24:07 +0100 Subject: [PATCH 197/377] Fix styling of visibilityPresetCombobox --- .../qml/Preferences/SettingVisibilityPage.qml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index dcd5c154d9..06f7dfcc36 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -11,7 +11,7 @@ import Cura 1.0 as Cura UM.PreferencesPage { - title: catalog.i18nc("@title:tab", "Setting Visibility"); + title: catalog.i18nc("@title:tab", "Setting Visibility") property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel() @@ -31,16 +31,16 @@ UM.PreferencesPage Item { - id: base; - anchors.fill: parent; + id: base + anchors.fill: parent OldControls.CheckBox { id: toggleVisibleSettings anchors { - verticalCenter: filter.verticalCenter; - left: parent.left; + verticalCenter: filter.verticalCenter + left: parent.left leftMargin: UM.Theme.getSize("default_margin").width } text: catalog.i18nc("@label:textbox", "Check all") @@ -80,7 +80,7 @@ UM.PreferencesPage TextField { - id: filter; + id: filter anchors { @@ -96,7 +96,7 @@ UM.PreferencesPage onTextChanged: definitionsModel.filter = {"i18n_label|i18n_description": "*" + text} } - ComboBox + Cura.ComboBox { id: visibilityPreset width: 150 * screenScaleFactor @@ -104,7 +104,7 @@ UM.PreferencesPage { top: parent.top right: parent.right - bottom: settingsListView.top + verticalCenter: filter.verticalCenter } model: settingVisibilityPresetsModel.items @@ -136,11 +136,11 @@ UM.PreferencesPage id: settingsListView anchors { - top: filter.bottom; + top: filter.bottom topMargin: UM.Theme.getSize("default_margin").height - left: parent.left; - right: parent.right; - bottom: parent.bottom; + left: parent.left + right: parent.right + bottom: parent.bottom } clip: true @@ -182,8 +182,8 @@ UM.PreferencesPage } } - UM.I18nCatalog { name: "cura"; } - SystemPalette { id: palette; } + UM.I18nCatalog { name: "cura" } + SystemPalette { id: palette } Component { From 7abe62a8ec7c2c4ee015012992524422cac78999 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Feb 2022 11:29:14 +0100 Subject: [PATCH 198/377] Fix weird wrapping in monitor page --- .../resources/qml/MonitorPrintJobProgressBar.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index 4f4fd1c027..93c34cf603 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -44,7 +44,7 @@ Item text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" color: printJob && printJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") width: contentWidth - + wrapMode: Text.NoWrap // FIXED-LINE-HEIGHT: height: UM.Theme.getSize("monitor_text_line").height } @@ -57,6 +57,7 @@ Item leftMargin: UM.Theme.getSize("monitor_margin").width verticalCenter: parent.verticalCenter } + wrapMode: Text.NoWrap text: { if (!printJob) From 9bad66b6ce5ed226aad3f8aa00cbc80848423a9e Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 10 Feb 2022 17:28:29 +0100 Subject: [PATCH 199/377] Add custom ColorDialog.qml with simple hex value selector. Cura-8681 --- resources/qml/Preferences/Materials/MaterialsView.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 14890b2d9f..1706487bd0 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -217,7 +217,7 @@ Item // popup dialog to select a new color // if successful it sets the properties.color_code value to the new color - ColorDialog + UM.ColorDialog { id: colorDialog color: properties.color_code @@ -569,6 +569,11 @@ Item } } + function getMetaDataEntry(entry_name) + { + return + } + function setMaterialPreferenceValue(material_guid, entry_name, new_value) { if(!(material_guid in materialPreferenceValues)) From fca6ef29aead485a5cebd19f47ac876e33c07dc9 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 10 Feb 2022 18:06:43 +0100 Subject: [PATCH 200/377] Move `ColorDialog` to Cura repo Move component to the Cura repo as `Cura.SecondaryButton` and `Cura.PrimaryButton` are used. CURA 8687 --- resources/qml/ColorDialog.qml | 63 +++++++++++++++++++ .../Preferences/Materials/MaterialsView.qml | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 resources/qml/ColorDialog.qml diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml new file mode 100644 index 0000000000..a7f05c4a0b --- /dev/null +++ b/resources/qml/ColorDialog.qml @@ -0,0 +1,63 @@ +import QtQuick 2.10 +import QtQuick.Controls 2.2 +import QtQuick.Window 2.1 +import QtQuick.Layouts 1.1 + +import UM 1.5 as UM +import Cura 1.1 as Cura + +UM.Dialog +{ + id: base + + minimumHeight: UM.Theme.getSize("small_popup_dialog").height + minimumWidth: UM.Theme.getSize("small_popup_dialog").width / 1.5 + height: minimumHeight + width: minimumWidth + + property alias color: colorInput.text + + margin: UM.Theme.getSize("default_margin").width + buttonSpacing: UM.Theme.getSize("default_margin").width + + UM.Label + { + id: colorLabel + font: UM.Theme.getFont("large") + text: "Color Code (HEX)" + } + + TextField + { + id: colorInput + text: "#FFFFFF" + anchors.top: colorLabel.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{6})$/ } + } + + Rectangle + { + id: swatch + color: base.color + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors { + left: colorInput.right + top: colorInput.top + bottom: colorInput.bottom + } + width: height + } + + rightButtons: + [ + Cura.PrimaryButton { + text: catalog.i18nc("@action:button", "OK") + onClicked: base.accept() + }, + Cura.SecondaryButton { + text: catalog.i18nc("@action:button", "Cancel") + onClicked: base.close() + } + ] +} \ No newline at end of file diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 1706487bd0..4e88dbc9bd 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -217,7 +217,7 @@ Item // popup dialog to select a new color // if successful it sets the properties.color_code value to the new color - UM.ColorDialog + Cura.ColorDialog { id: colorDialog color: properties.color_code From 1eabf251f4034f799b6e65b26093ec57f24396ee Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 10 Feb 2022 18:07:42 +0100 Subject: [PATCH 201/377] Remove unused function CURA 8687 --- resources/qml/Preferences/Materials/MaterialsView.qml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 4e88dbc9bd..72a78fe03b 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -569,11 +569,6 @@ Item } } - function getMetaDataEntry(entry_name) - { - return - } - function setMaterialPreferenceValue(material_guid, entry_name, new_value) { if(!(material_guid in materialPreferenceValues)) From 91c95a0ed62c0ea7eb64d715327c2a4fe05f2f01 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 10:47:37 +0100 Subject: [PATCH 202/377] Remove duplicate function CURA 8687 --- resources/qml/Preferences/Materials/MaterialsView.qml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index cbbe5828bb..560c88ce4d 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -602,10 +602,4 @@ Item base.setMetaDataEntry("brand", old_brand, new_brand) properties.brand = new_brand } - - function updateCostPerMeter() - { - base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); - base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); - } } From c1d55265379987e011a2de93106a9a80863362cc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 11 Feb 2022 11:07:51 +0100 Subject: [PATCH 203/377] Add some documentation to ColorDialog CURA-8687 --- resources/qml/ColorDialog.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index a7f05c4a0b..2b5669db5f 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -6,6 +6,11 @@ import QtQuick.Layouts 1.1 import UM 1.5 as UM import Cura 1.1 as Cura + +/* +* A dialog that provides the option to pick a color. Currently it only asks for a hex code and shows the color +* in a color swath +*/ UM.Dialog { id: base From b2f3b365c958802be3a021c9ba0a6725544b8ba0 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Fri, 11 Feb 2022 11:31:30 +0100 Subject: [PATCH 204/377] Remove setting duplicate properties of `UM.Label` default settings Co-authored-by: Jaime van Kessel --- resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 31e3b46599..8e4cea1bdd 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -42,8 +42,6 @@ UM.Dialog text: catalog.i18nc("@text:window", "We have found one or more project file(s) within the files you have selected. You can open only one project file at a time. We suggest to only import models from those files. Would you like to proceed?") anchors.left: parent.left anchors.right: parent.right - font: UM.Theme.getFont("default") - wrapMode: Text.WordWrap } buttonSpacing: UM.Theme.getSize("thin_margin").width From 02f648d40a13775f075e01673fdeb35ffb82ca79 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Fri, 11 Feb 2022 11:31:54 +0100 Subject: [PATCH 205/377] Remove superfluous semicolumn Co-authored-by: Jaime van Kessel --- resources/qml/Cura.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 2a5f733dfb..67a3617033 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -746,7 +746,7 @@ UM.MainWindow UM.MessageDialog { id: packageInstallDialog - title: catalog.i18nc("@window:title", "Install Package"); + title: catalog.i18nc("@window:title", "Install Package") standardButtons: StandardButton.Ok } From 8c0b0ddc5b67ef2525b9cfd59497ebfec838c37e Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Fri, 11 Feb 2022 11:32:03 +0100 Subject: [PATCH 206/377] Remove superfluous semicolumn Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/Materials/MaterialsView.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 560c88ce4d..94fbe0be48 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -127,9 +127,9 @@ Item text: catalog.i18nc("@label (%1 is a number)", "The new filament diameter is set to %1 mm, which is not compatible with the current extruder. Do you wish to continue?".arg(new_diameter_value)) standardButtons: Dialog.Yes | Dialog.No - property var new_diameter_value: null; - property var old_diameter_value: null; - property var old_approximate_diameter_value: null; + property var new_diameter_value: null + property var old_diameter_value: null + property var old_approximate_diameter_value: null onAccepted: { From 5063b84c9a61ef9d24b835fcbd0c13826d7fbc8e Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Fri, 11 Feb 2022 11:32:12 +0100 Subject: [PATCH 207/377] Remove superfluous semicolumn Co-authored-by: Jaime van Kessel --- resources/qml/Dialogs/AboutDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index 95b46eeaf8..d917656c9f 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -169,7 +169,7 @@ UM.Dialog { //: Close about dialog button id: closeButton - text: catalog.i18nc("@action:button", "Close"); + text: catalog.i18nc("@action:button", "Close") onClicked: base.visible = false; } From 46fac4263b0017549873e513143510f0e815c2a0 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 13:10:24 +0100 Subject: [PATCH 208/377] Fix styling issues in the material sync dialog CURA 8939 --- .../Materials/MaterialsSyncDialog.qml | 361 +++++++++--------- 1 file changed, 177 insertions(+), 184 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index cc2985a8a8..0360e2c94b 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -20,6 +20,7 @@ Window width: minimumWidth height: minimumHeight modality: Qt.ApplicationModal + color: UM.Theme.getColor("main_background") property variant syncModel property alias pageIndex: swipeView.currentIndex @@ -32,11 +33,11 @@ Window anchors.fill: parent interactive: false - Rectangle + Item { id: introPage - color: UM.Theme.getColor("main_background") - Column + + ColumnLayout { spacing: UM.Theme.getSize("default_margin").height anchors.fill: parent @@ -46,66 +47,64 @@ Window { text: catalog.i18nc("@title:header", "Sync materials with printers") font: UM.Theme.getFont("large_bold") + Layout.fillWidth: true } UM.Label { text: catalog.i18nc("@text", "Following a few simple steps, you will be able to synchronize all your material profiles with your printers.") font: UM.Theme.getFont("medium") - wrapMode: Text.Wrap - width: parent.width + Layout.fillWidth: true } + Image { + Layout.fillWidth: true + Layout.fillHeight: true source: UM.Theme.getImage("material_ecosystem") - width: parent.width + fillMode: Image.PreserveAspectFit sourceSize.width: width } - } - Cura.PrimaryButton - { - id: startButton - anchors + Item { - right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width - bottom: parent.bottom - bottomMargin: UM.Theme.getSize("default_margin").height - } - text: catalog.i18nc("@button", "Start") - onClicked: - { - if(Cura.API.account.isLoggedIn) + Layout.preferredHeight: childrenRect.height + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + + Cura.TertiaryButton { - swipeView.currentIndex += 2; //Skip sign in page. + text: catalog.i18nc("@button", "Why do I need to sync material profiles?") + iconSource: UM.Theme.getIcon("LinkExternal") + isIconOnRightSide: true + onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360013137919?utm_source=cura&utm_medium=software&utm_campaign=sync-material-printer-why") } - else + + Cura.PrimaryButton { - swipeView.currentIndex += 1; + anchors.right: parent.right + text: catalog.i18nc("@button", "Start") + onClicked: + { + if(Cura.API.account.isLoggedIn) + { + swipeView.currentIndex += 2; //Skip sign in page. + } + else + { + swipeView.currentIndex += 1; + } + } } } } - Cura.TertiaryButton - { - anchors - { - left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width - verticalCenter: startButton.verticalCenter - } - text: catalog.i18nc("@button", "Why do I need to sync material profiles?") - iconSource: UM.Theme.getIcon("LinkExternal") - isIconOnRightSide: true - onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360013137919?utm_source=cura&utm_medium=software&utm_campaign=sync-material-printer-why") - } } - Rectangle + Item { id: signinPage - color: UM.Theme.getColor("main_background") - Connections //While this page is active, continue to the next page if the user logs in. + // While this page is active, continue to the next page if the user logs in. + Connections { target: Cura.API.account function onLoginStateChanged(is_logged_in) @@ -127,34 +126,31 @@ Window { text: catalog.i18nc("@title:header", "Sign in") font: UM.Theme.getFont("large_bold") - Layout.preferredHeight: height + Layout.fillWidth: true } UM.Label { text: catalog.i18nc("@text", "To automatically sync the material profiles with all your printers connected to Digital Factory you need to be signed in in Cura.") font: UM.Theme.getFont("medium") - wrapMode: Text.Wrap - width: parent.width - Layout.maximumWidth: width - Layout.preferredHeight: height + Layout.fillWidth: true } - Item + + Image { - Layout.preferredWidth: parent.width + Layout.alignment: Qt.AlignCenter + Layout.preferredWidth: parent.width / 2 + source: UM.Theme.getImage("first_run_ultimaker_cloud") Layout.fillHeight: true - Image - { - source: UM.Theme.getImage("first_run_ultimaker_cloud") - width: parent.width / 2 - sourceSize.width: width - anchors.centerIn: parent - } + sourceSize.width: width + fillMode: Image.PreserveAspectFit } + Item { - width: parent.width - height: childrenRect.height - Layout.preferredHeight: height + Layout.preferredHeight: childrenRect.height + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + Cura.SecondaryButton { anchors.left: parent.left @@ -171,10 +167,9 @@ Window } } - Rectangle + Item { id: printerListPage - color: UM.Theme.getColor("main_background") ColumnLayout { @@ -185,7 +180,6 @@ Window Row { - Layout.preferredHeight: childrenRect.height spacing: UM.Theme.getSize("default_margin").width states: [ @@ -216,7 +210,7 @@ Window { id: printerListHeaderIcon width: UM.Theme.getSize("section_icon").width - height: width + height: UM.Theme.getSize("section_icon").height anchors.verticalCenter: parent.verticalCenter } UM.Label @@ -229,24 +223,22 @@ Window } Row { - Layout.preferredWidth: parent.width + Layout.fillWidth: true Layout.preferredHeight: childrenRect.height UM.Label { id: syncStatusLabel - - width: parent.width - UM.Theme.getSize("default_margin").width - troubleshootingLink.width - + anchors.left: parent.left wrapMode: Text.Wrap elide: Text.ElideRight visible: text !== "" - text: "" font: UM.Theme.getFont("medium") } Cura.TertiaryButton { id: troubleshootingLink + anchors.right: parent.right text: catalog.i18nc("@button", "Troubleshooting") visible: typeof syncModel !== "undefined" && syncModel.exportUploadStatus == "error" iconSource: UM.Theme.getIcon("LinkExternal") @@ -256,8 +248,7 @@ Window ListView { id: printerList - width: parent.width - Layout.preferredWidth: width + Layout.fillWidth: true Layout.fillHeight: true clip: true @@ -372,94 +363,82 @@ Window footer: Item { - width: printerList.width - printerListScrollBar - height: { - if(!visible) - { - return 0; - } - let h = UM.Theme.getSize("card").height + printerListTroubleshooting.height + UM.Theme.getSize("default_margin").height * 2; //1 margin between content and footer, 1 for troubleshooting link. - return h; - } + width: printerList.width - printerListScrollBar.width + height: childrenRect.height + UM.Theme.getSize("default_margin").height visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0 && typeof syncModel !== "undefined" && syncModel.exportUploadStatus === "idle" Rectangle { - anchors.fill: parent - anchors.topMargin: UM.Theme.getSize("default_margin").height - + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width + anchors.topMargin: UM.Theme.getSize("default_margin").height + height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height + color: "transparent" - Row + GridLayout { - anchors - { - fill: parent - margins: Math.round(UM.Theme.getSize("card").height - UM.Theme.getSize("machine_selector_icon").width) / 2 //Same margin as in other cards. - } - spacing: UM.Theme.getSize("default_margin").width + columns: 3 + rows: 2 + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: UM.Theme.getSize("thick_margin").width + anchors.rightMargin: UM.Theme.getSize("thick_margin").width + anchors.topMargin: UM.Theme.getSize("thick_margin").height + anchors.bottomMargin: UM.Theme.getSize("thick_margin").height + columnSpacing: UM.Theme.getSize("default_margin").width + rowSpacing: UM.Theme.getSize("default_margin").height UM.StatusIcon { - id: infoIcon - width: UM.Theme.getSize("section_icon").width - height: width - //Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings. - anchors.top: parent.top - anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2) - + Layout.preferredWidth: UM.Theme.getSize("section_icon").width + Layout.preferredHeight: UM.Theme.getSize("section_icon").height status: UM.StatusIcon.Status.WARNING } - Column + UM.Label { - //Fill the total width. Can't use layouts because we need the anchors for vertical alignment. - width: parent.width - infoIcon.width - refreshListButton.width - parent.spacing * 2 - - spacing: UM.Theme.getSize("default_margin").height - - UM.Label - { - id: printersMissingText - text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") - + "\n" - + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") - font: UM.Theme.getFont("medium") - elide: Text.ElideRight - } - Cura.TertiaryButton - { - id: printerListTroubleshooting - leftPadding: 0 //Want to visually align this to the text. - - text: catalog.i18nc("@button", "Troubleshooting") - iconSource: UM.Theme.getIcon("LinkExternal") - onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer") - } + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") + + "\n" + + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") + font: UM.Theme.getFont("medium") + elide: Text.ElideRight } Cura.SecondaryButton { id: refreshListButton - //Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings. - anchors.top: parent.top - anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2) - + Layout.alignment: Qt.AlignVCenter text: catalog.i18nc("@button", "Refresh List") iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") onClicked: Cura.API.account.sync(true) } + + Cura.TertiaryButton + { + id: printerListTroubleshooting + Layout.column: 1 + Layout.row: 1 + Layout.fillWidth: true + leftPadding: 0 + text: catalog.i18nc("@button", "Troubleshooting") + iconSource: UM.Theme.getIcon("LinkExternal") + onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer") + } } } } } Item { - width: parent.width - height: childrenRect.height - Layout.preferredWidth: width - Layout.preferredHeight: height + Layout.fillWidth: true + Layout.preferredHeight: childrenRect.height + Layout.alignment: Qt.AlignBottom Cura.SecondaryButton { @@ -545,7 +524,8 @@ Window } } - ColumnLayout //Placeholder for when the user has no cloud printers. + // Placeholder for when the user has no cloud printers. + ColumnLayout { spacing: UM.Theme.getSize("default_margin").height anchors.fill: parent @@ -556,44 +536,50 @@ Window { text: catalog.i18nc("@title:header", "No printers found") font: UM.Theme.getFont("large_bold") - Layout.preferredWidth: width - Layout.preferredHeight: height + Layout.fillWidth: true } - Image + + Item { - source: UM.Theme.getImage("3d_printer_faded") - sourceSize.width: width - fillMode: Image.PreserveAspectFit - Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: parent.width / 3 + Layout.fillWidth: true + Layout.fillHeight: true + + Image + { + anchors.fill: parent + source: UM.Theme.getImage("3d_printer_faded") + sourceSize.width: width + fillMode: Image.PreserveAspectFit + } } + UM.Label { text: catalog.i18nc("@text", "It seems like you don't have any compatible printers connected to Digital Factory. Make sure your printer is connected and it's running the latest firmware.") - width: parent.width + Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap - Layout.preferredWidth: width - Layout.preferredHeight: height } + Item { - Layout.preferredWidth: parent.width - Layout.fillHeight: true + Layout.fillWidth: true + Layout.preferredHeight: parent.height / 4 Cura.TertiaryButton { text: catalog.i18nc("@button", "Learn how to connect your printer to Digital Factory") iconSource: UM.Theme.getIcon("LinkExternal") onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-add-cloud-printer") anchors.horizontalCenter: parent.horizontalCenter + maximumWidth: parent.width } } + Item { - width: parent.width - height: childrenRect.height - Layout.preferredWidth: width - Layout.preferredHeight: height + Layout.preferredHeight: childrenRect.height + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true Cura.SecondaryButton { @@ -601,30 +587,34 @@ Window text: catalog.i18nc("@button", "Sync materials with USB") onClicked: swipeView.currentIndex = removableDriveSyncPage.SwipeView.index } - Cura.PrimaryButton + + RowLayout { - id: disabledSyncButton anchors.right: parent.right - text: catalog.i18nc("@button", "Sync") - enabled: false //If there are no printers, always disable this button. - } - Cura.SecondaryButton - { - anchors.right: disabledSyncButton.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width - text: catalog.i18nc("@button", "Refresh") - iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") - outlineColor: "transparent" - onClicked: Cura.API.account.sync(true) + spacing: UM.Theme.getSize("default_margin").width + + Cura.SecondaryButton + { + text: catalog.i18nc("@button", "Refresh") + iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") + outlineColor: "transparent" + onClicked: Cura.API.account.sync(true) + } + + Cura.PrimaryButton + { + id: disabledSyncButton + text: catalog.i18nc("@button", "Sync") + enabled: false // If there are no printers, always disable this button. + } } } } } - Rectangle + Item { id: removableDriveSyncPage - color: UM.Theme.getColor("main_background") ColumnLayout { @@ -636,46 +626,52 @@ Window { text: catalog.i18nc("@title:header", "Sync material profiles via USB") font: UM.Theme.getFont("large_bold") - Layout.preferredHeight: height + Layout.fillWidth: true } UM.Label { text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.") font: UM.Theme.getFont("medium") wrapMode: Text.Wrap - width: parent.width - Layout.maximumWidth: width - Layout.preferredHeight: height + Layout.fillWidth: true } - Row + + RowLayout { - width: parent.width - Layout.preferredWidth: width + Layout.fillWidth: true Layout.fillHeight: true spacing: UM.Theme.getSize("default_margin").width - Image + Item { - source: UM.Theme.getImage("insert_usb") - width: parent.width / 3 - height: width - anchors.verticalCenter: parent.verticalCenter - sourceSize.width: width + Layout.preferredWidth: parent.width / 3 + Layout.fillHeight: true + + Image + { + anchors.fill: parent + source: UM.Theme.getImage("insert_usb") + verticalAlignment: Image.AlignVCenter + horizontalAlignment: Image.AlignHCenter + fillMode: Image.PreserveAspectFit + sourceSize.width: width + } } + UM.Label { + Layout.alignment: Qt.AlignCenter + Layout.fillWidth: true text: "1. " + catalog.i18nc("@text", "Click the export material archive button.") + "\n2. " + catalog.i18nc("@text", "Save the .umm file on a USB stick.") + "\n3. " + catalog.i18nc("@text", "Insert the USB stick into your printer and launch the procedure to load new material profiles.") font: UM.Theme.getFont("medium") - wrapMode: Text.Wrap - width: parent.width * 2 / 3 - UM.Theme.getSize("default_margin").width - anchors.verticalCenter: parent.verticalCenter } } Cura.TertiaryButton { + Layout.fillWidth: true text: catalog.i18nc("@button", "How to load new material profiles to my printer") iconSource: UM.Theme.getIcon("LinkExternal") onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/4403319801106/?utm_source=cura&utm_medium=software&utm_campaign=add-material-profiles-via-usb") @@ -683,10 +679,9 @@ Window Item { - width: parent.width - height: childrenRect.height - Layout.preferredWidth: width - Layout.preferredHeight: height + Layout.preferredHeight: childrenRect.height + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true Cura.SecondaryButton { @@ -719,24 +714,22 @@ Window } } - Cura.GlobalStacksModel + property variant cloudPrinterList: Cura.GlobalStacksModel { - id: cloudPrinterList filterConnectionType: 3 //Only show cloud connections. filterOnlineOnly: true //Only show printers that are online. filterCapabilities: ["import_material"] //Only show printers that can receive the material profiles. } - Cura.GlobalStacksModel + + property variant includeOfflinePrinterList: Cura.GlobalStacksModel { //In order to show a refresh button only when there are offline cloud printers, we need to know if there are any offline printers. //A global stacks model without the filter for online-only printers allows this. - id: includeOfflinePrinterList filterConnectionType: 3 //Still only show cloud connections. } - FileDialog + property variant exportUsbDialog: FileDialog { - id: exportUsbDialog title: catalog.i18nc("@title:window", "Export All Materials") selectExisting: false nameFilters: ["Material archives (*.umm)", "All files (*)"] From 7f95dc98e6ac820adcb1d005c63e6e4007e6ad23 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 13:27:29 +0100 Subject: [PATCH 209/377] Translate text within the color picker CURA 8687 --- resources/qml/ColorDialog.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 2b5669db5f..4f86168f7d 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -15,6 +15,8 @@ UM.Dialog { id: base + property variant catalog: UM.I18nCatalog { name: "cura" } + minimumHeight: UM.Theme.getSize("small_popup_dialog").height minimumWidth: UM.Theme.getSize("small_popup_dialog").width / 1.5 height: minimumHeight @@ -29,7 +31,7 @@ UM.Dialog { id: colorLabel font: UM.Theme.getFont("large") - text: "Color Code (HEX)" + text: catalog.i18nc("@label", "Color Code (HEX)") } TextField From 2edd6349095ded52f50a0430f55b501b5ac03770 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 13:27:41 +0100 Subject: [PATCH 210/377] Provide a title with the color picker CURA 8687 --- resources/qml/Preferences/Materials/MaterialsView.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 94fbe0be48..6d153f5960 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -220,6 +220,7 @@ Item Cura.ColorDialog { id: colorDialog + title: catalog.i18nc("@title", "Material color picker") color: properties.color_code onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) } From 86392ab471676bde486f26662bd3e2be1e9c4e17 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 13:31:19 +0100 Subject: [PATCH 211/377] Remove empty file CURA 8687 --- resources/qml/Preferences/ReadOnlySpinBox.qml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 resources/qml/Preferences/ReadOnlySpinBox.qml diff --git a/resources/qml/Preferences/ReadOnlySpinBox.qml b/resources/qml/Preferences/ReadOnlySpinBox.qml deleted file mode 100644 index e69de29bb2..0000000000 From 959caece9084bce6f0ccd62f90111a3c14ed9acc Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 13:45:03 +0100 Subject: [PATCH 212/377] Make input field in ColorDialog selectable by mouse CURA 8687 --- resources/qml/ColorDialog.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 4f86168f7d..fabd4caad3 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -38,6 +38,7 @@ UM.Dialog { id: colorInput text: "#FFFFFF" + selectByMouse: true anchors.top: colorLabel.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{6})$/ } From ca0d84dcaebcd19631844496e768818874ddc607 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 13:48:57 +0100 Subject: [PATCH 213/377] Always prefix text in ColorDialog with a hashtag CURA 8687 --- resources/qml/ColorDialog.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index fabd4caad3..358e8b9ef5 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -41,7 +41,13 @@ UM.Dialog selectByMouse: true anchors.top: colorLabel.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{6})$/ } + onTextChanged: { + if (!text.startsWith("#")) + { + text = `#${text}`; + } + } + validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ } } Rectangle From 3f658a491486beece454e044ebc8d546075ba176 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 11 Feb 2022 14:37:32 +0100 Subject: [PATCH 214/377] Change UM.Dialog to Controls.Dialog in connect to printer by ip window As `UM.Dialog` is opened using in a new window, the error-confirmation that was displayed in a `UM.Dialog` was displayed _behind_ the window object. CURA 8687 --- .../resources/qml/DiscoverUM3Action.qml | 87 ++++++++----------- 1 file changed, 37 insertions(+), 50 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 9c06388f4b..94e265e4b8 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -288,7 +288,7 @@ Cura.MachineAction standardButtons: Dialog.Ok } - UM.Dialog + Dialog { id: manualPrinterDialog property string printerKey @@ -296,17 +296,18 @@ Cura.MachineAction title: catalog.i18nc("@title:window", "Printer Address") - minimumWidth: 400 * screenScaleFactor - minimumHeight: 130 * screenScaleFactor - width: minimumWidth - height: minimumHeight + width: UM.Theme.getSize("small_popup_dialog").width + + anchors.centerIn: Overlay.overlay + + standardButtons: Dialog.Yes | Dialog.No signal showDialog(string key, string address) onShowDialog: { printerKey = key; addressText = address; - manualPrinterDialog.show(); + manualPrinterDialog.open(); addressField.selectAll(); addressField.focus = true; } @@ -327,54 +328,40 @@ Cura.MachineAction { id: addressField width: parent.width - validator: RegExpValidator - { - regExp: /[a-zA-Z0-9\.\-\_]*/ - } - + validator: RegExpValidator { regExp: /[a-zA-Z0-9\.\-\_]*/ } onAccepted: btnOk.clicked() } } - rightButtons: [ - Button { - text: catalog.i18nc("@action:button","Cancel") - onClicked: - { - manualPrinterDialog.reject() - manualPrinterDialog.hide() - } - }, - Button { - id: btnOk - text: catalog.i18nc("@action:button", "OK") - onClicked: - { - // Validate the input first - if (!networkingUtil.isValidIP(manualPrinterDialog.addressText)) - { - invalidIPAddressMessageDialog.open() - return - } - - // if the entered IP address has already been discovered, switch the current item to that item - // and do nothing else. - for (var i = 0; i < manager.foundDevices.length; i++) - { - var device = manager.foundDevices[i] - if (device.address == manualPrinterDialog.addressText) - { - currentItemIndex = i - manualPrinterDialog.hide() - return - } - } - - manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText) - manualPrinterDialog.hide() - } - enabled: manualPrinterDialog.addressText.trim() != "" + onRejected: + { + manualPrinterDialog.reject() + manualPrinterDialog.hide() + } + onAccepted: + { + // Validate the input first + if (!networkingUtil.isValidIP(manualPrinterDialog.addressText)) + { + invalidIPAddressMessageDialog.open() + return } - ] + + // if the entered IP address has already been discovered, switch the current item to that item + // and do nothing else. + for (var i = 0; i < manager.foundDevices.length; i++) + { + var device = manager.foundDevices[i] + if (device.address == manualPrinterDialog.addressText) + { + currentItemIndex = i + manualPrinterDialog.hide() + return + } + } + + manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText) + manualPrinterDialog.hide() + } } } From aeb433b2a1eb6bd8a2e2e42dde1ec1d48fc3b2c4 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 15 Feb 2022 09:29:32 +0100 Subject: [PATCH 215/377] Keep showing ip enter dialog after wrongly entered ip address In component discover um 3 dialog. After a "complete" action the dialog will immediately close. This was undesired behaviour as we want to keep the dialog active if an IP address is wrongly added. Additionally, it is no longer necessary to close/hide the dialog after a reject/accept as this is done by default. CURA-8955 --- .../resources/qml/DiscoverUM3Action.qml | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 94e265e4b8..3117775eaf 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -333,18 +333,16 @@ Cura.MachineAction } } - onRejected: - { - manualPrinterDialog.reject() - manualPrinterDialog.hide() - } onAccepted: { // Validate the input first if (!networkingUtil.isValidIP(manualPrinterDialog.addressText)) { - invalidIPAddressMessageDialog.open() - return + // prefent closing of element, as we want to keep the dialog active after a wrongly entered IP adress + manualPrinterDialog.open() + // show invalid ip warning + invalidIPAddressMessageDialog.open(); + return; } // if the entered IP address has already been discovered, switch the current item to that item @@ -354,14 +352,12 @@ Cura.MachineAction var device = manager.foundDevices[i] if (device.address == manualPrinterDialog.addressText) { - currentItemIndex = i - manualPrinterDialog.hide() - return + currentItemIndex = i; + return; } } - manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText) - manualPrinterDialog.hide() + manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText); } } } From 99478d6a15acd9728482295e1bab131d543fc0a9 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 15 Feb 2022 11:18:02 +0100 Subject: [PATCH 216/377] Add "Ok" button in export/import materials popup dialog Proposed solution takes a different approach compared to the previous solution. Previously there was one message dialog that was hidden by default. When the import/export material confirm dialog was triggered the text and body of this message dialog would change. I did deviate from this pattern as this might introduce hard to debug issues when a property would be set on this dialog. As this dialog is used for various instances every instance should update the same properties. If one property is missed then the popup might show unwanted information. I propose a different solution instead. Here a popup is created dynamically. This way the properties used for each instance is clear. This might add a delay when showing the popup as the whole component needs to be created when called. CURA-8959 --- .../Preferences/Materials/MaterialsPage.qml | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index dbcef6c573..2e4ded685d 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -335,16 +335,19 @@ Item folder: CuraApplication.getDefaultPath("dialog_material_path") onAccepted: { - var result = Cura.ContainerManager.importMaterialContainer(fileUrl); + const result = Cura.ContainerManager.importMaterialContainer(fileUrl); + const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base); + messageDialog.standardButtons = Dialog.Ok; messageDialog.title = catalog.i18nc("@title:window", "Import Material"); - if(result.status == "success") + switch (result.status) { - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully imported material %1").arg(fileUrl); - } - else - { - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags or !", "Could not import material %1: %2").arg(fileUrl).arg(result.message); + case "success": + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully imported material %1").arg(fileUrl); + break; + default: + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags or !", "Could not import material %1: %2").arg(fileUrl).arg(result.message); + break; } messageDialog.open(); CuraApplication.setDefaultPath("dialog_material_path", folder); @@ -360,25 +363,23 @@ Item folder: CuraApplication.getDefaultPath("dialog_material_path") onAccepted: { - var result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl); + const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl); + const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base); messageDialog.title = catalog.i18nc("@title:window", "Export Material"); - if(result.status == "error") + messageDialog.standardButtons = Dialog.Ok; + switch (result.status) { - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags and !", "Failed to export material to %1: %2").arg(fileUrl).arg(result.message); - messageDialog.open(); - } - else if(result.status == "success") - { - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully exported material to %1").arg(result.path); - messageDialog.open(); + case "error": + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags and !", "Failed to export material to %1: %2").arg(fileUrl).arg(result.message); + break; + case "success": + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully exported material to %1").arg(result.path); + break; } + messageDialog.open(); + CuraApplication.setDefaultPath("dialog_material_path", folder); } } - - UM.MessageDialog - { - id: messageDialog - } } From a20dac4c9b95d8308f38af08397318ee23599e45 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:08:06 +0100 Subject: [PATCH 217/377] Update ReadOnlyTextArea to controls 2 CURA-8685 --- .../qml/Preferences/Materials/MaterialsView.qml | 11 ++++++----- resources/qml/Preferences/ReadOnlyTextArea.qml | 17 +++++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 6d153f5960..ecb9870fcf 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -363,10 +363,11 @@ Item ReadOnlyTextArea { text: properties.description; - width: 2 * informationPage.columnWidth + width: informationPage.columnWidth * 2 + height: 0.75 * informationPage.columnWidth wrapMode: Text.WordWrap - readOnly: !base.editingEnabled; + readOnly: !base.editingEnabled onEditingFinished: base.setMetaDataEntry("description", properties.description, text) } @@ -375,11 +376,11 @@ Item ReadOnlyTextArea { - text: properties.adhesion_info; + text: properties.adhesion_info width: 2 * informationPage.columnWidth wrapMode: Text.WordWrap - - readOnly: !base.editingEnabled; + height: 0.75 * informationPage.columnWidth + readOnly: !base.editingEnabled onEditingFinished: base.setMetaDataEntry("adhesion_info", properties.adhesion_info, text) } diff --git a/resources/qml/Preferences/ReadOnlyTextArea.qml b/resources/qml/Preferences/ReadOnlyTextArea.qml index 2c553ac2ca..97a89ff080 100644 --- a/resources/qml/Preferences/ReadOnlyTextArea.qml +++ b/resources/qml/Preferences/ReadOnlyTextArea.qml @@ -2,9 +2,9 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.15 -Item +ScrollView { id: base @@ -15,17 +15,22 @@ Item property bool readOnly: false - width: textArea.width - height: textArea.height - TextArea { id: textArea enabled: !base.readOnly opacity: base.readOnly ? 0.5 : 1.0 + selectByMouse: true - anchors.fill: parent + background: Rectangle + { + radius: UM.Theme.getSize("setting_control_radius").width + color: enabled ? UM.Theme.getColor("setting_control_disabled") : UM.Theme.getColor("setting_control") + } + + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default") Keys.onReturnPressed: { From da96cb833c11594cf10fba73431ebbeb97bf2652 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:16:16 +0100 Subject: [PATCH 218/377] Swap ReadOnlyTextfield to controls 2 CURA-8685 --- .../qml/Preferences/ReadOnlyTextArea.qml | 3 ++- .../qml/Preferences/ReadOnlyTextField.qml | 25 +++++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/resources/qml/Preferences/ReadOnlyTextArea.qml b/resources/qml/Preferences/ReadOnlyTextArea.qml index 97a89ff080..e2a0da24f2 100644 --- a/resources/qml/Preferences/ReadOnlyTextArea.qml +++ b/resources/qml/Preferences/ReadOnlyTextArea.qml @@ -3,6 +3,7 @@ import QtQuick 2.1 import QtQuick.Controls 2.15 +import UM 1.5 as UM ScrollView { @@ -26,7 +27,7 @@ ScrollView background: Rectangle { radius: UM.Theme.getSize("setting_control_radius").width - color: enabled ? UM.Theme.getColor("setting_control_disabled") : UM.Theme.getColor("setting_control") + color: textArea.enabled ? UM.Theme.getColor("setting_control") : UM.Theme.getColor("setting_control_disabled") } color: UM.Theme.getColor("text") diff --git a/resources/qml/Preferences/ReadOnlyTextField.qml b/resources/qml/Preferences/ReadOnlyTextField.qml index 6f5a66d2a9..cc8e83647b 100644 --- a/resources/qml/Preferences/ReadOnlyTextField.qml +++ b/resources/qml/Preferences/ReadOnlyTextField.qml @@ -3,7 +3,8 @@ // Different than the name suggests, it is not always read-only. import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 +import UM 1.5 as UM Item { @@ -23,26 +24,18 @@ Item id: textField enabled: !base.readOnly - opacity: base.readOnly ? 0.5 : 1.0 + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default") anchors.fill: parent onEditingFinished: base.editingFinished() Keys.onEnterPressed: base.editingFinished() Keys.onReturnPressed: base.editingFinished() + background: Rectangle + { + radius: UM.Theme.getSize("setting_control_radius").width + color: textField.enabled ? UM.Theme.getColor("setting_control") : UM.Theme.getColor("setting_control_disabled") + } } - - Label - { - visible: base.readOnly - text: textField.text - - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: textField.__panel ? textField.__panel.leftMargin : 0 - - color: palette.buttonText - } - - SystemPalette { id: palette } } From 6be75c75f8fb6fbed0e5ab1c0856dd68ca569026 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:18:04 +0100 Subject: [PATCH 219/377] Simpify Readonly textarea CURA-8685 --- resources/qml/Preferences/ReadOnlyTextArea.qml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/resources/qml/Preferences/ReadOnlyTextArea.qml b/resources/qml/Preferences/ReadOnlyTextArea.qml index e2a0da24f2..c6f253f0ca 100644 --- a/resources/qml/Preferences/ReadOnlyTextArea.qml +++ b/resources/qml/Preferences/ReadOnlyTextArea.qml @@ -21,7 +21,6 @@ ScrollView id: textArea enabled: !base.readOnly - opacity: base.readOnly ? 0.5 : 1.0 selectByMouse: true background: Rectangle @@ -33,15 +32,9 @@ ScrollView color: UM.Theme.getColor("text") font: UM.Theme.getFont("default") - Keys.onReturnPressed: - { - base.editingFinished() - } + Keys.onReturnPressed: base.editingFinished() - Keys.onEnterPressed: - { - base.editingFinished() - } + Keys.onEnterPressed: base.editingFinished() onActiveFocusChanged: { From 77b46868a6b0eb232ae1d0df7757ed2d83a3633c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:24:30 +0100 Subject: [PATCH 220/377] Replace imagereader controls with styled variants CURA-8685 --- plugins/ImageReader/ConfigUI.qml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index ecfc86fc05..c169f7648a 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -26,7 +26,7 @@ UM.Dialog rowSpacing: UM.Theme.getSize("thin_margin").height columns: 2 - Label + UM.Label { Layout.fillWidth: true text: catalog.i18nc("@action:label", "Height (mm)") @@ -39,7 +39,7 @@ UM.Dialog } } - TextField + Cura.TextField { id: peak_height Layout.fillWidth: true @@ -57,7 +57,7 @@ UM.Dialog y: peak_height.y + peak_height.height + UM.Theme.getSize("default_margin").height } - Label + UM.Label { Layout.fillWidth: true text: catalog.i18nc("@action:label", "Base (mm)") @@ -71,7 +71,7 @@ UM.Dialog } } - TextField + Cura.TextField { id: base_height selectByMouse: true @@ -89,7 +89,7 @@ UM.Dialog y: base_height.y + base_height.height + UM.Theme.getSize("default_margin").height } - Label + UM.Label { Layout.fillWidth: true text: catalog.i18nc("@action:label", "Width (mm)") @@ -102,7 +102,7 @@ UM.Dialog } } - TextField + Cura.TextField { id: width selectByMouse: true @@ -121,7 +121,7 @@ UM.Dialog y: width.y + width.height + UM.Theme.getSize("default_margin").height } - Label + UM.Label { Layout.fillWidth: true text: catalog.i18nc("@action:label", "Depth (mm)") @@ -134,7 +134,7 @@ UM.Dialog } } - TextField + Cura.TextField { id: depth Layout.fillWidth: true @@ -153,7 +153,7 @@ UM.Dialog y: depth.y + depth.height + UM.Theme.getSize("default_margin").height } - Label + UM.Label { Layout.fillWidth: true text: "" @@ -166,7 +166,7 @@ UM.Dialog } } - ComboBox + Cura.ComboBox { id: lighter_is_higher Layout.fillWidth: true @@ -184,7 +184,7 @@ UM.Dialog y: lighter_is_higher.y + lighter_is_higher.height + UM.Theme.getSize("default_margin").height } - Label + UM.Label { Layout.fillWidth: true text: catalog.i18nc("@action:label", "Color Model") @@ -197,7 +197,7 @@ UM.Dialog } } - ComboBox + Cura.ComboBox { id: color_model Layout.fillWidth: true @@ -215,7 +215,7 @@ UM.Dialog y: color_model.y + color_model.height + UM.Theme.getSize("default_margin").height } - Label + UM.Label { Layout.fillWidth: true text: catalog.i18nc("@action:label", "1mm Transmittance (%)") @@ -228,7 +228,7 @@ UM.Dialog } } - TextField + Cura.TextField { id: transmittance Layout.fillWidth: true @@ -246,7 +246,7 @@ UM.Dialog y: transmittance.y + transmittance.height + UM.Theme.getSize("default_margin").height } - Label + UM.Label { Layout.fillWidth: true text: catalog.i18nc("@action:label", "Smoothing") From b45b3faa3c92664c39db25eea883fb0389150617 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:32:29 +0100 Subject: [PATCH 221/377] Replace textField in JobSpecs CURA-8685 --- plugins/ImageReader/ConfigUI.qml | 2 ++ resources/qml/JobSpecs.qml | 30 ++++++++++-------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index c169f7648a..4b3035f271 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -18,6 +18,8 @@ UM.Dialog width: minimumWidth height: minimumHeight + + GridLayout { UM.I18nCatalog { id: catalog; name: "cura" } diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 878051a4d0..2fe0c7c4a8 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import UM 1.5 as UM @@ -29,7 +28,8 @@ Item { if (!activity) { - //When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file) + // When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't + // set an empty string as a jobName (which is later used for saving the file) PrintInformation.baseName = "" } } @@ -66,7 +66,7 @@ Item height: UM.Theme.getSize("jobspecs_line").height width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50) maximumLength: 120 - text: (PrintInformation === null) ? "" : PrintInformation.jobName + text: PrintInformation === null ? "" : PrintInformation.jobName horizontalAlignment: TextInput.AlignLeft property string textBeforeEdit: "" @@ -91,17 +91,10 @@ Item validator: RegExpValidator { regExp: /^[^\\\/\*\?\|\[\]]*$/ } - - style: TextFieldStyle - { - textColor: UM.Theme.getColor("text_scene") - font: UM.Theme.getFont("default") - background: Rectangle - { - opacity: 0 - border.width: 0 - } - } + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text_scene") + background: Item {} + selectByMouse: true } } @@ -125,10 +118,7 @@ Item anchors.leftMargin: UM.Theme.getSize("default_margin").width } - Component.onCompleted: - { - base.addAdditionalComponents("jobSpecsButton") - } + Component.onCompleted: base.addAdditionalComponents("jobSpecsButton") Connections { From 713a5cb4e5500e7f96ca7139eb122ce068f0c456 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:38:08 +0100 Subject: [PATCH 222/377] Ensure that settingPickDialog uses the themed controls CURA-8685 --- plugins/PerObjectSettingsTool/PerObjectCategory.qml | 6 +++--- plugins/PerObjectSettingsTool/PerObjectItem.qml | 3 ++- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectCategory.qml b/plugins/PerObjectSettingsTool/PerObjectCategory.qml index d23b0b9458..3f95d4e021 100644 --- a/plugins/PerObjectSettingsTool/PerObjectCategory.qml +++ b/plugins/PerObjectSettingsTool/PerObjectCategory.qml @@ -4,8 +4,8 @@ import QtQuick 2.2 import QtQuick.Controls 2.1 -import UM 1.1 as UM - +import UM 1.5 as UM +import Cura 1.0 as Cura import ".." Button { @@ -33,7 +33,7 @@ Button { source: UM.Theme.getIcon(definition.icon) color: base.hovered ? palette.highlight : palette.buttonText } - Label + UM.Label { id: label anchors.verticalCenter: parent.verticalCenter diff --git a/plugins/PerObjectSettingsTool/PerObjectItem.qml b/plugins/PerObjectSettingsTool/PerObjectItem.qml index dd74721464..5c67a42d01 100644 --- a/plugins/PerObjectSettingsTool/PerObjectItem.qml +++ b/plugins/PerObjectSettingsTool/PerObjectItem.qml @@ -6,6 +6,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.1 import UM 1.2 as UM +import Cura 1.0 as Cura UM.TooltipArea { @@ -15,7 +16,7 @@ UM.TooltipArea width: childrenRect.width; height: childrenRect.height; - CheckBox + Cura.CheckBox { id: check diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 1c79a02c97..46c9825334 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -42,7 +42,7 @@ UM.Dialog listview.model.filter = new_filter } - TextField + Cura.TextField { id: filterInput selectByMouse: true @@ -60,7 +60,7 @@ UM.Dialog onTextChanged: settingPickDialog.updateFilter() } - CheckBox + Cura.CheckBox { id: toggleShowAll anchors From 40f835ed13ceca40b95c70defcfc3acd3044e978 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:50:48 +0100 Subject: [PATCH 223/377] Replace labels for UM.Label in DiscoverUM3Action CURA-8685 --- .../resources/qml/DiscoverUM3Action.qml | 68 ++++++------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 94e265e4b8..2ddb0f7f58 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -37,22 +37,17 @@ Cura.MachineAction SystemPalette { id: palette } UM.I18nCatalog { id: catalog; name:"cura" } - Label + UM.Label { id: pageTitle width: parent.width text: catalog.i18nc("@title:window", "Connect to Networked Printer") - wrapMode: Text.WordWrap - renderType: Text.NativeRendering - font.pointSize: 18 } - Label + UM.Label { id: pageDescription width: parent.width - wrapMode: Text.WordWrap - renderType: Text.NativeRendering text: catalog.i18nc("@label", "To print directly to your printer over the network, please make sure your printer is connected to the network using a network cable or by connecting your printer to your WIFI network. If you don't connect Cura with your printer, you can still use a USB drive to transfer g-code files to your printer.") + "\n\n" + catalog.i18nc("@label", "Select your printer from the list below:") } @@ -158,13 +153,11 @@ Cura.MachineAction } } } - Label + UM.Label { id: discoveryTip anchors.left: parent.left anchors.right: parent.right - wrapMode: Text.WordWrap - renderType: Text.NativeRendering text: catalog.i18nc("@label", "If your printer is not listed, read the network printing troubleshooting guide").arg("https://ultimaker.com/en/cura/troubleshooting/network?utm_source=cura&utm_medium=software&utm_campaign=manage-network-printer"); onLinkActivated: Qt.openUrlExternally(link) } @@ -175,32 +168,27 @@ Cura.MachineAction width: Math.round(parent.width * 0.5) visible: base.selectedDevice ? true : false spacing: UM.Theme.getSize("default_margin").height - Label + UM.Label { width: parent.width - wrapMode: Text.WordWrap text: base.selectedDevice ? base.selectedDevice.name : "" font: UM.Theme.getFont("large_bold") elide: Text.ElideRight - renderType: Text.NativeRendering } Grid { visible: base.completeProperties width: parent.width columns: 2 - Label + property real labelWidth: Math.round(width * 0.5) + UM.Label { - width: Math.round(parent.width * 0.5) - wrapMode: Text.WordWrap - renderType: Text.NativeRendering + width: labelWidth text: catalog.i18nc("@label", "Type") } - Label + UM.Label { - width: Math.round(parent.width * 0.5) - wrapMode: Text.WordWrap - renderType: Text.NativeRendering + width: labelWidth text: { if (base.selectedDevice) { @@ -209,41 +197,31 @@ Cura.MachineAction return "" } } - Label + UM.Label { - width: Math.round(parent.width * 0.5) - wrapMode: Text.WordWrap - renderType: Text.NativeRendering + width: labelWidth text: catalog.i18nc("@label", "Firmware version") } - Label + UM.Label { - width: Math.round(parent.width * 0.5) - wrapMode: Text.WordWrap - renderType: Text.NativeRendering + width: labelWidth text: base.selectedDevice ? base.selectedDevice.firmwareVersion : "" } - Label + UM.Label { - width: Math.round(parent.width * 0.5) - wrapMode: Text.WordWrap - renderType: Text.NativeRendering + width: labelWidth text: catalog.i18nc("@label", "Address") } - Label + UM.Label { - width: Math.round(parent.width * 0.5) - wrapMode: Text.WordWrap - renderType: Text.NativeRendering + width: labelWidth text: base.selectedDevice ? base.selectedDevice.ipAddress : "" } } - Label + UM.Label { width: parent.width - wrapMode: Text.WordWrap - renderType: Text.NativeRendering text:{ // The property cluster size does not exist for older UM3 devices. if(!base.selectedDevice || base.selectedDevice.clusterSize == null || base.selectedDevice.clusterSize == 1) @@ -261,11 +239,9 @@ Cura.MachineAction } } - Label + UM.Label { width: parent.width - wrapMode: Text.WordWrap - renderType: Text.NativeRendering visible: base.selectedDevice != null && !base.completeProperties text: catalog.i18nc("@label", "The printer at this address has not yet responded." ) } @@ -316,15 +292,13 @@ Cura.MachineAction anchors.fill: parent spacing: UM.Theme.getSize("default_margin").height - Label + UM.Label { text: catalog.i18nc("@label", "Enter the IP address of your printer on the network.") - width: parent.width - wrapMode: Text.WordWrap renderType: Text.NativeRendering } - TextField + Cura.TextField { id: addressField width: parent.width From 6ea7622a55d545f508ca46dc94c2ce0773ecd3da Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 15:57:50 +0100 Subject: [PATCH 224/377] Fix reference to property that didn't exist CURA-8685 --- resources/qml/JobSpecs.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 2fe0c7c4a8..03978cb69e 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -64,7 +64,7 @@ Item anchors.left: printJobPencilIcon.right anchors.leftMargin: UM.Theme.getSize("narrow_margin").width height: UM.Theme.getSize("jobspecs_line").height - width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50) + width: Math.max(contentWidth + UM.Theme.getSize("default_margin").width, 50) maximumLength: 120 text: PrintInformation === null ? "" : PrintInformation.jobName horizontalAlignment: TextInput.AlignLeft From 52ff67c1eb45617cd265e4672be6086b30d359a2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Feb 2022 16:09:18 +0100 Subject: [PATCH 225/377] Use separate context menu size for menus Instead of re-using the setting controls. It's not a setting. Contributes to issue CURA-8688. --- resources/qml/Widgets/Menu.qml | 6 +++--- resources/qml/Widgets/MenuItem.qml | 2 +- resources/themes/cura-light/theme.json | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/qml/Widgets/Menu.qml b/resources/qml/Widgets/Menu.qml index 1a6aeff602..8fa326598a 100644 --- a/resources/qml/Widgets/Menu.qml +++ b/resources/qml/Widgets/Menu.qml @@ -14,12 +14,12 @@ UM.Menu id: menu padding: 0 - implicitWidth: UM.Theme.getSize("setting_control").width + width: UM.Theme.getSize("context_menu").width delegate: Cura.MenuItem {} background: Rectangle { - color: UM.Theme.getColor("setting_control") - border.color: UM.Theme.getColor("setting_control_border") + color: UM.Theme.getColor("main_background") + border.color: UM.Theme.getColor("lining") } } \ No newline at end of file diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index 201fd480ce..f58f27fb8f 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -13,7 +13,7 @@ UM.MenuItem { id: menuItem - implicitHeight: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("narrow_margin").height + height: UM.Theme.getSize("context_menu").height opacity: enabled ? 1.0 : 0.5 arrow: UM.RecolorImage diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f59231d960..482c02d2f3 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -573,6 +573,8 @@ "medium_button": [2.5, 2.5], "medium_button_icon": [2, 2], + "context_menu": [20, 2], + "favorites_row": [2, 2], "favorites_button": [2, 2], "favorites_button_icon": [1.2, 1.2], From d7758c0ee967e011dbefa084b9c5540573c77488 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 16:11:06 +0100 Subject: [PATCH 226/377] Swap out the GeneralPage items to use the themed ones CURA-8685 --- resources/qml/Preferences/GeneralPage.qml | 80 +++++++++++------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index b2461aad30..243dc384b7 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -148,7 +148,7 @@ UM.PreferencesPage UM.I18nCatalog{id: catalog; name: "cura"} width: preferencesScrollView.width - preferencesScrollBar.width - Label + UM.Label { font.bold: true text: catalog.i18nc("@label", "Interface") @@ -160,7 +160,7 @@ UM.PreferencesPage columns: 4 width: parent.width - Label + UM.Label { id: languageLabel text: "Language:" //Don't translate this, to make it easier to find the language drop-down if you can't read the current language. @@ -202,7 +202,7 @@ UM.PreferencesPage } } - ComboBox + Cura.ComboBox { id: languageComboBox @@ -233,13 +233,13 @@ UM.PreferencesPage } } - Label + UM.Label { id: currencyLabel text: catalog.i18nc("@label", "Currency:") } - TextField + Cura.TextField { id: currencyField selectByMouse: true @@ -247,7 +247,7 @@ UM.PreferencesPage onTextChanged: UM.Preferences.setValue("cura/currency", text) } - Label + UM.Label { id: themeLabel text: catalog.i18nc("@label","Theme:") @@ -266,7 +266,7 @@ UM.PreferencesPage } } - ComboBox + Cura.ComboBox { id: themeComboBox @@ -290,7 +290,7 @@ UM.PreferencesPage } } - Label + UM.Label { id: languageCaption @@ -314,7 +314,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.") - CheckBox + Cura.CheckBox { id: autoSliceCheckbox checked: boolCheck(UM.Preferences.getValue("general/auto_slice")) @@ -331,7 +331,7 @@ UM.PreferencesPage width: UM.Theme.getSize("default_margin").width } - Label + UM.Label { font.bold: true text: catalog.i18nc("@label", "Viewport behavior") @@ -344,7 +344,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.") - CheckBox + Cura.CheckBox { id: showOverhangCheckbox @@ -363,7 +363,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.") - CheckBox + Cura.CheckBox { id: showXrayErrorCheckbox @@ -380,7 +380,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected") - CheckBox + Cura.CheckBox { id: centerOnSelectCheckbox text: catalog.i18nc("@action:button","Center camera when item is selected"); @@ -395,7 +395,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?") - CheckBox + Cura.CheckBox { id: invertZoomCheckbox text: catalog.i18nc("@action:button", "Invert the direction of camera zoom."); @@ -416,7 +416,7 @@ UM.PreferencesPage height: childrenRect.height; text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.") - CheckBox + Cura.CheckBox { id: zoomToMouseCheckbox text: catalog.i18nc("@action:button", "Zoom toward mouse direction") @@ -447,7 +447,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?") - CheckBox + Cura.CheckBox { id: pushFreeCheckbox text: catalog.i18nc("@option:check", "Ensure models are kept apart") @@ -461,7 +461,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?") - CheckBox + Cura.CheckBox { id: dropDownCheckbox text: catalog.i18nc("@option:check", "Automatically drop models to the build plate") @@ -478,7 +478,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.") - CheckBox + Cura.CheckBox { id: gcodeShowCautionCheckbox @@ -495,7 +495,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?") - CheckBox + Cura.CheckBox { id: forceLayerViewCompatibilityModeCheckbox text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)") @@ -510,7 +510,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?") - CheckBox + Cura.CheckBox { id: restoreWindowPositionCheckbox text: catalog.i18nc("@option:check", "Restore window position on start") @@ -528,7 +528,7 @@ UM.PreferencesPage { spacing: 4 * screenScaleFactor - Label + UM.Label { text: catalog.i18nc("@window:text", "Camera rendering:") } @@ -542,7 +542,7 @@ UM.PreferencesPage } } - ComboBox + Cura.ComboBox { id: cameraComboBox @@ -573,7 +573,7 @@ UM.PreferencesPage width: UM.Theme.getSize("default_margin").height } - Label + UM.Label { font.bold: true text: catalog.i18nc("@label","Opening and saving files") @@ -585,7 +585,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?") - CheckBox + Cura.CheckBox { id: singleInstanceCheckbox text: catalog.i18nc("@option:check","Use a single instance of Cura") @@ -601,7 +601,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?") enabled: singleInstanceCheckbox.checked - CheckBox + Cura.CheckBox { id: singleInstanceClearBeforeLoadCheckbox text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance") @@ -616,7 +616,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?") - CheckBox + Cura.CheckBox { id: scaleToFitCheckbox text: catalog.i18nc("@option:check","Scale large models") @@ -631,7 +631,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?") - CheckBox + Cura.CheckBox { id: scaleTinyCheckbox text: catalog.i18nc("@option:check","Scale extremely small models") @@ -646,7 +646,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?") - CheckBox + Cura.CheckBox { id: selectModelsOnLoadCheckbox text: catalog.i18nc("@option:check","Select models when loaded") @@ -661,7 +661,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?") - CheckBox + Cura.CheckBox { id: prefixJobNameCheckbox text: catalog.i18nc("@option:check", "Add machine prefix to job name") @@ -676,7 +676,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?") - CheckBox + Cura.CheckBox { text: catalog.i18nc("@option:check", "Show summary dialog when saving project") checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save")) @@ -694,12 +694,12 @@ UM.PreferencesPage { spacing: 4 * screenScaleFactor - Label + UM.Label { text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ") } - ComboBox + Cura.ComboBox { id: choiceOnOpenProjectDropDownButton width: Math.round(250 * screenScaleFactor) @@ -755,18 +755,18 @@ UM.PreferencesPage { spacing: 4 * screenScaleFactor - Label + UM.Label { font.bold: true text: catalog.i18nc("@label", "Profiles") } - Label + UM.Label { text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ") } - ComboBox + Cura.ComboBox { id: choiceOnProfileOverrideDropDownButton width: Math.round(250 * screenScaleFactor) @@ -810,7 +810,7 @@ UM.PreferencesPage width: UM.Theme.getSize("default_margin").height } - Label + UM.Label { font.bold: true text: catalog.i18nc("@label", "Privacy") @@ -821,7 +821,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") - CheckBox + Cura.CheckBox { id: sendDataCheckbox text: catalog.i18nc("@option:check","Send (anonymous) print information") @@ -848,7 +848,7 @@ UM.PreferencesPage width: UM.Theme.getSize("default_margin").height } - Label + UM.Label { font.bold: true text: catalog.i18nc("@label", "Updates") @@ -860,7 +860,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?") - CheckBox + Cura.CheckBox { id: checkUpdatesCheckbox text: catalog.i18nc("@option:check","Check for updates on start") @@ -913,7 +913,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!") - CheckBox + Cura.CheckBox { id: pluginNotificationsUpdateCheckbox text: catalog.i18nc("@option:check", "Get notifications for plugin updates") From e5523838639249b855ee0862fb67acb729b9c0ae Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Feb 2022 16:19:39 +0100 Subject: [PATCH 227/377] Consistently use Cura.Menu and Cura.MenuItem Some of these were using the built-in Menu and MenuItem, causing the menus to appear in different sizes. Contributes to issue CURA-8688. --- resources/qml/MainWindow/ApplicationMenu.qml | 11 +++-------- resources/qml/Menus/EditMenu.qml | 2 +- resources/qml/Menus/HelpMenu.qml | 2 +- resources/qml/Menus/MaterialMenu.qml | 4 ++-- resources/qml/Menus/PreferencesMenu.qml | 2 +- resources/qml/Menus/PrinterTypeMenu.qml | 2 +- 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 707111309c..44094521ce 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -20,13 +20,12 @@ Item { id: applicationMenu width: parent.width - FileMenu {} + height: UM.Theme.getSize("context_menu").height + background: Item {} + FileMenu {} EditMenu {} ViewMenu {} - - background: Rectangle {} - SettingsMenu { //On MacOS, don't translate the "Settings" word. @@ -38,13 +37,9 @@ Item //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") } - ExtensionMenu { id: extensionMenu } - PreferencesMenu {} - HelpMenu {} - } diff --git a/resources/qml/Menus/EditMenu.qml b/resources/qml/Menus/EditMenu.qml index c2ec9903f2..5bcedea415 100644 --- a/resources/qml/Menus/EditMenu.qml +++ b/resources/qml/Menus/EditMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.1 import UM 1.6 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit") diff --git a/resources/qml/Menus/HelpMenu.qml b/resources/qml/Menus/HelpMenu.qml index e8a80eeced..4be25fdffe 100644 --- a/resources/qml/Menus/HelpMenu.qml +++ b/resources/qml/Menus/HelpMenu.qml @@ -8,7 +8,7 @@ import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: helpMenu title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index 0834d7b250..e6d7fbc3e9 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -72,7 +72,7 @@ Cura.Menu Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0} - Menu + Cura.Menu { id: genericMenu title: catalog.i18nc("@label:category menu label", "Generic") @@ -108,7 +108,7 @@ Cura.Menu Instantiator { model: brandMaterials - delegate: Menu + delegate: Cura.Menu { id: brandMaterialsMenu title: materialName diff --git a/resources/qml/Menus/PreferencesMenu.qml b/resources/qml/Menus/PreferencesMenu.qml index fd0b5d82c1..3a6dd4b2ce 100644 --- a/resources/qml/Menus/PreferencesMenu.qml +++ b/resources/qml/Menus/PreferencesMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: preferencesMenu diff --git a/resources/qml/Menus/PrinterTypeMenu.qml b/resources/qml/Menus/PrinterTypeMenu.qml index c959b97c5b..17986ac1b8 100644 --- a/resources/qml/Menus/PrinterTypeMenu.qml +++ b/resources/qml/Menus/PrinterTypeMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: menu title: "Printer type" From eb7ab657fe985bbca11b883f216eeb55cc727f4b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 16:26:58 +0100 Subject: [PATCH 228/377] Use Cura.Textfield in readonlyTextfield Less code duplication, which is always good CURA-8685 --- resources/qml/Preferences/ReadOnlyTextField.qml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/resources/qml/Preferences/ReadOnlyTextField.qml b/resources/qml/Preferences/ReadOnlyTextField.qml index cc8e83647b..57789cea3c 100644 --- a/resources/qml/Preferences/ReadOnlyTextField.qml +++ b/resources/qml/Preferences/ReadOnlyTextField.qml @@ -5,6 +5,7 @@ import QtQuick 2.1 import QtQuick.Controls 2.1 import UM 1.5 as UM +import Cura 1.0 as Cura Item { @@ -19,23 +20,16 @@ Item width: textField.width height: textField.height - TextField + Cura.TextField { id: textField enabled: !base.readOnly - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") anchors.fill: parent onEditingFinished: base.editingFinished() Keys.onEnterPressed: base.editingFinished() Keys.onReturnPressed: base.editingFinished() - background: Rectangle - { - radius: UM.Theme.getSize("setting_control_radius").width - color: textField.enabled ? UM.Theme.getColor("setting_control") : UM.Theme.getColor("setting_control_disabled") - } } } From 13227249b5c971112e3741751dd39a1653712755 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 16:28:29 +0100 Subject: [PATCH 229/377] Remove catalog from Textfield The creation of the catalog is rather slow, so it's better not to create it for every component --- resources/qml/Preferences/ReadOnlyTextField.qml | 2 +- resources/qml/Widgets/TextField.qml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/qml/Preferences/ReadOnlyTextField.qml b/resources/qml/Preferences/ReadOnlyTextField.qml index 57789cea3c..325081dd13 100644 --- a/resources/qml/Preferences/ReadOnlyTextField.qml +++ b/resources/qml/Preferences/ReadOnlyTextField.qml @@ -13,7 +13,7 @@ Item property alias text: textField.text - signal editingFinished(); + signal editingFinished() property bool readOnly: false diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index c126c8a6e0..9cb9a021e7 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -16,9 +16,7 @@ TextField id: textField property alias leftIcon: iconLeft.source - - UM.I18nCatalog { id: catalog; name: "cura" } - + hoverEnabled: true selectByMouse: true font: UM.Theme.getFont("default") From 821581bc65f8f072d1146e1cd92a454922087f2e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 17:07:22 +0100 Subject: [PATCH 230/377] Remove ProgressBar style and use UM.ProgressBar instead CURA-8685 --- .../FirmwareUpdaterMachineAction.qml | 4 +- resources/qml/MonitorButton.qml | 4 +- resources/qml/Widgets/TextField.qml | 2 +- resources/themes/cura-light/styles.qml | 51 ------------------- 4 files changed, 4 insertions(+), 57 deletions(-) diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index eb12acce88..23485efb77 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -7,7 +7,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 import QtQuick.Dialogs 1.2 // For filedialog -import UM 1.2 as UM +import UM 1.3 as UM import Cura 1.0 as Cura @@ -157,7 +157,7 @@ Cura.MachineAction wrapMode: Text.Wrap } - ProgressBar + UM.ProgressBar { id: prog value: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareProgress / 100 : 0 diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 16c0ae086f..54b9437a6c 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -183,7 +183,7 @@ Item visible: showProgress } - ProgressBar + UM.ProgressBar { id: progressBar; minimumValue: 0; @@ -218,8 +218,6 @@ Item return false; } } - style: UM.Theme.styles.progressbar; - property string backgroundColor: UM.Theme.getColor("progressbar_background"); property string controlColor: base.statusColor; diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index 9cb9a021e7..b995c34f10 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -16,7 +16,7 @@ TextField id: textField property alias leftIcon: iconLeft.source - + hoverEnabled: true selectByMouse: true font: UM.Theme.getFont("default") diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 11dd2a70eb..2b5e4dc3ac 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -9,57 +9,6 @@ import UM 1.1 as UM QtObject { - property Component progressbar: Component - { - ProgressBarStyle - { - background: Rectangle - { - implicitWidth: UM.Theme.getSize("message").width - (UM.Theme.getSize("default_margin").width * 2) - implicitHeight: UM.Theme.getSize("progressbar").height - color: control.hasOwnProperty("backgroundColor") ? control.backgroundColor : UM.Theme.getColor("progressbar_background") - radius: UM.Theme.getSize("progressbar_radius").width - } - progress: Rectangle - { - color: - { - if(control.indeterminate) - { - return "transparent"; - } - else if(control.hasOwnProperty("controlColor")) - { - return control.controlColor; - } - else - { - return UM.Theme.getColor("progressbar_control"); - } - } - radius: UM.Theme.getSize("progressbar_radius").width - Rectangle - { - radius: UM.Theme.getSize("progressbar_radius").width - color: control.hasOwnProperty("controlColor") ? control.controlColor : UM.Theme.getColor("progressbar_control") - width: UM.Theme.getSize("progressbar_control").width - height: UM.Theme.getSize("progressbar_control").height - visible: control.indeterminate - - SequentialAnimation on x - { - id: xAnim - property int animEndPoint: UM.Theme.getSize("message").width - Math.round((UM.Theme.getSize("default_margin").width * 2.5)) - UM.Theme.getSize("progressbar_control").width - running: control.indeterminate && control.visible - loops: Animation.Infinite - NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;} - NumberAnimation { from: xAnim.animEndPoint; to: 0; duration: 2000;} - } - } - } - } - } - property Component scrollview: Component { ScrollViewStyle From 5f3b35b30da33d136592f81a85fd26e38f66810c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 15 Feb 2022 17:17:54 +0100 Subject: [PATCH 231/377] Use UM label for firmwareUpdater CURA-8685 --- .../FirmwareUpdaterMachineAction.qml | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index 23485efb77..47387daa28 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -7,13 +7,13 @@ import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 import QtQuick.Dialogs 1.2 // For filedialog -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Cura.MachineAction { - anchors.fill: parent; + anchors.fill: parent property bool printerConnected: Cura.MachineManager.printerConnected property var activeOutputDevice: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null property bool canUpdateFirmware: activeOutputDevice ? activeOutputDevice.activePrinter.canUpdateFirmware : false @@ -25,25 +25,22 @@ Cura.MachineAction UM.I18nCatalog { id: catalog; name: "cura"} spacing: UM.Theme.getSize("default_margin").height - Label + UM.Label { width: parent.width text: catalog.i18nc("@title", "Update Firmware") - wrapMode: Text.WordWrap font.pointSize: 18 } - Label + UM.Label { width: parent.width - wrapMode: Text.WordWrap text: catalog.i18nc("@label", "Firmware is the piece of software running directly on your 3D printer. This firmware controls the step motors, regulates the temperature and ultimately makes your printer work.") } - Label + UM.Label { width: parent.width - wrapMode: Text.WordWrap - text: catalog.i18nc("@label", "The firmware shipping with new printers works, but new versions tend to have more features and improvements."); + text: catalog.i18nc("@label", "The firmware shipping with new printers works, but new versions tend to have more features and improvements.") } Row @@ -55,7 +52,7 @@ Cura.MachineAction Button { id: autoUpgradeButton - text: catalog.i18nc("@action:button", "Automatically upgrade Firmware"); + text: catalog.i18nc("@action:button", "Automatically upgrade Firmware") enabled: parent.firmwareName != "" && canUpdateFirmware onClicked: { @@ -66,7 +63,7 @@ Cura.MachineAction Button { id: manualUpgradeButton - text: catalog.i18nc("@action:button", "Upload custom Firmware"); + text: catalog.i18nc("@action:button", "Upload custom Firmware") enabled: canUpdateFirmware onClicked: { @@ -75,20 +72,18 @@ Cura.MachineAction } } - Label + UM.Label { width: parent.width - wrapMode: Text.WordWrap visible: !printerConnected && !updateProgressDialog.visible - text: catalog.i18nc("@label", "Firmware can not be updated because there is no connection with the printer."); + text: catalog.i18nc("@label", "Firmware can not be updated because there is no connection with the printer.") } Label { width: parent.width - wrapMode: Text.WordWrap visible: printerConnected && !canUpdateFirmware - text: catalog.i18nc("@label", "Firmware can not be updated because the connection with the printer does not support upgrading firmware."); + text: catalog.i18nc("@label", "Firmware can not be updated because the connection with the printer does not support upgrading firmware.") } } @@ -122,7 +117,7 @@ Cura.MachineAction { anchors.fill: parent - Label + UM.Label { anchors { @@ -171,8 +166,8 @@ Cura.MachineAction } anchors { - left: parent.left; - right: parent.right; + left: parent.left + right: parent.right } } } @@ -180,9 +175,9 @@ Cura.MachineAction rightButtons: [ Button { - text: catalog.i18nc("@action:button","Close"); - enabled: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareUpdateState != 1 : true; - onClicked: updateProgressDialog.visible = false; + text: catalog.i18nc("@action:button", "Close") + enabled: manager.firmwareUpdater != null ? manager.firmwareUpdater.firmwareUpdateState != 1 : true + onClicked: updateProgressDialog.visible = false } ] } From 02a6cc6e1d69ae6034596073c18c167a5281c880 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 16 Feb 2022 23:43:54 +0100 Subject: [PATCH 232/377] Improve visual appearance of `ColorDialog` According to the figma design CURA-8938 --- resources/qml/ColorDialog.qml | 131 ++++++++++++++++++++++++---------- 1 file changed, 94 insertions(+), 37 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 358e8b9ef5..fd19542b43 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -17,61 +17,118 @@ UM.Dialog property variant catalog: UM.I18nCatalog { name: "cura" } - minimumHeight: UM.Theme.getSize("small_popup_dialog").height - minimumWidth: UM.Theme.getSize("small_popup_dialog").width / 1.5 - height: minimumHeight - width: minimumWidth + margin: UM.Theme.getSize("wide_margin").width property alias color: colorInput.text + property var defaultColors: [ + "#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD", + "#5D88BE", "#5ABD0E", "#E17239", "#F74E46", "#874AF9", + "#50C2EC", "#8DC15A", "#C3977A", "#CD7776", "#9086BA", + "#FFFFFF", "#D3D3D3", "#9E9E9E", "#5A5A5A", "#000000", + ] - margin: UM.Theme.getSize("default_margin").width - buttonSpacing: UM.Theme.getSize("default_margin").width - - UM.Label + Component.onCompleted: { - id: colorLabel - font: UM.Theme.getFont("large") - text: catalog.i18nc("@label", "Color Code (HEX)") + for (let i = 0; i < base.defaultColors.length; i ++) + { + const swatchColor = base.defaultColors[i]; + defaultColorsModel.append({ swatchColor }); + } } - TextField + Column { - id: colorInput - text: "#FFFFFF" - selectByMouse: true - anchors.top: colorLabel.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - onTextChanged: { - if (!text.startsWith("#")) + id: content + width: childrenRect.width + height: childrenRect.height + spacing: UM.Theme.getSize("wide_margin").height + + GridLayout { + columns: 5 + width: childrenRect.width + height: childrenRect.height + columnSpacing: UM.Theme.getSize("thick_margin").width + rowSpacing: UM.Theme.getSize("thick_margin").height + + Repeater { - text = `#${text}`; + model: ListModel + { + id: defaultColorsModel + } + + delegate: Rectangle + { + color: swatchColor + width: 24 + height: 24 + radius: width / 2 + + UM.RecolorImage + { + anchors.fill: parent + visible: swatchColor == base.color + source: UM.Theme.getIcon("Check", "low") + color: UM.Theme.getColor("checkbox") + } + + MouseArea + { + anchors.fill: parent + onClicked: + { + base.color = swatchColor; + } + } + } + } + } + + RowLayout + { + width: parent.width + spacing: UM.Theme.getSize("default_margin").width + + UM.Label + { + text: catalog.i18nc("@label", "Hex") + } + + TextField + { + id: colorInput + Layout.fillWidth: true + text: "#FFFFFF" + selectByMouse: true + onTextChanged: { + if (!text.startsWith("#")) + { + text = `#${text}`; + } + } + validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ } + } + + Rectangle + { + color: base.color + Layout.preferredHeight: parent.height + Layout.preferredWidth: height } } - validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ } } - Rectangle - { - id: swatch - color: base.color - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors { - left: colorInput.right - top: colorInput.top - bottom: colorInput.bottom - } - width: height - } + buttonSpacing: UM.Theme.getSize("default_margin").width rightButtons: [ + Cura.TertiaryButton { + text: catalog.i18nc("@action:button", "Cancel") + onClicked: base.close() + }, Cura.PrimaryButton { text: catalog.i18nc("@action:button", "OK") onClicked: base.accept() - }, - Cura.SecondaryButton { - text: catalog.i18nc("@action:button", "Cancel") - onClicked: base.close() } ] } \ No newline at end of file From 0786ff2c6bc2a4a8dd7f25cfec475b0a74a06323 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 17 Feb 2022 09:50:38 +0100 Subject: [PATCH 233/377] Change variable names "swatch" is a more descriptive variable name for this usecase CURA-8938 --- resources/qml/ColorDialog.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index fd19542b43..f163211f53 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -20,7 +20,7 @@ UM.Dialog margin: UM.Theme.getSize("wide_margin").width property alias color: colorInput.text - property var defaultColors: [ + property var swatchColors: [ "#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD", "#5D88BE", "#5ABD0E", "#E17239", "#F74E46", "#874AF9", "#50C2EC", "#8DC15A", "#C3977A", "#CD7776", "#9086BA", @@ -29,10 +29,9 @@ UM.Dialog Component.onCompleted: { - for (let i = 0; i < base.defaultColors.length; i ++) + for (let i = 0; i < base.swatchColors.length; i ++) { - const swatchColor = base.defaultColors[i]; - defaultColorsModel.append({ swatchColor }); + swatchColorsModel.append({ swatchColor: base.swatchColors[i] }); } } @@ -54,7 +53,7 @@ UM.Dialog { model: ListModel { - id: defaultColorsModel + id: swatchColorsModel } delegate: Rectangle From c528616d12b9687267849384906028bab3a4d0ef Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 17 Feb 2022 14:39:11 +0100 Subject: [PATCH 234/377] Set selection color of textfields CURA-8947 --- resources/qml/Settings/SettingTextField.qml | 3 ++- resources/themes/cura-light/theme.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 9a2930e703..e6afb9e8e3 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -153,8 +153,9 @@ SettingItem } color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + selectedTextColor: UM.Theme.getColor("setting_control_text") font: UM.Theme.getFont("default") - + selectionColor: UM.Theme.getColor("text_selection") selectByMouse: true maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10 diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f59231d960..e3812c6f2c 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -183,6 +183,7 @@ "primary_hover": [48, 182, 231, 255], "primary_text": [255, 255, 255, 255], "border": [127, 127, 127, 255], + "text_selection": [156,195, 255, 127], "secondary": [240, 240, 240, 255], "secondary_shadow": [216, 216, 216, 255], From b5136ba70cf710667aeb26fb05c8f0b745b35656 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 17 Feb 2022 15:07:48 +0100 Subject: [PATCH 235/377] Fix merge conflics --- resources/qml/Actions.qml | 2 +- resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml | 5 ----- resources/qml/Menus/RecentFilesMenu.qml | 5 ----- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 77334d19c2..92c9051491 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -488,6 +488,6 @@ Item { id: openMarketplaceAction text: catalog.i18nc("@action:menu", "&Marketplace") - iconName: "plugins_browse" + icon.name: "plugins_browse" } } diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 0ff56f5bea..3bd72bf68f 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -5,14 +5,9 @@ import QtQuick 2.2 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 -<<<<<<< HEAD -import UM 1.3 as UM -import Cura 1.5 as Cura -======= import UM 1.5 as UM import Cura 1.0 as Cura ->>>>>>> e66628e2da80d38637b58288f5e478f8ae4a74ba UM.Dialog { diff --git a/resources/qml/Menus/RecentFilesMenu.qml b/resources/qml/Menus/RecentFilesMenu.qml index e0b3bfda0c..8f4f328927 100644 --- a/resources/qml/Menus/RecentFilesMenu.qml +++ b/resources/qml/Menus/RecentFilesMenu.qml @@ -32,9 +32,4 @@ Cura.Menu onObjectAdded: menu.insertItem(index, object) onObjectRemoved: menu.removeItem(object) } - - Cura.AskOpenAsProjectOrModelsDialog - { - id: askOpenAsProjectOrModelsDialog - } } From 58e6cde6e859a9c0a5aaf3568a8899c1e7ad7751 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 17 Feb 2022 15:10:18 +0100 Subject: [PATCH 236/377] Remove incorrect refferents to btnOk --- plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 3117775eaf..21f96ff745 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -329,7 +329,6 @@ Cura.MachineAction id: addressField width: parent.width validator: RegExpValidator { regExp: /[a-zA-Z0-9\.\-\_]*/ } - onAccepted: btnOk.clicked() } } From e990e970be3a2b6c23368ffb706f8b7c7a361d1f Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 17 Feb 2022 15:42:25 +0100 Subject: [PATCH 237/377] Revert background to Rectangle as it was in previous versions of this file. This gives the bar a white background, instead of a transparent background. CURA-8688 --- resources/qml/MainWindow/ApplicationMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 5bf2d80e83..763f199902 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -21,7 +21,7 @@ Item id: applicationMenu width: parent.width height: UM.Theme.getSize("context_menu").height - background: Item {} + background: Rectangle {} FileMenu {} EditMenu {} From 9f7581d4e8229e9475b5bdda5ad4015e20a70d76 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 18 Feb 2022 08:57:38 +0100 Subject: [PATCH 238/377] Remove ReadOnlyTextField and use a ``` UM.TextField { enabled: false } ``` instead CURA-8688 --- .../Preferences/Materials/MaterialsView.qml | 28 +++++++-------- .../qml/Preferences/ReadOnlyTextField.qml | 35 ------------------- 2 files changed, 14 insertions(+), 49 deletions(-) delete mode 100644 resources/qml/Preferences/ReadOnlyTextField.qml diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index ecb9870fcf..d71a6f398f 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -148,32 +148,32 @@ Item } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") } - ReadOnlyTextField + Cura.TextField { id: displayNameTextField; width: informationPage.columnWidth; text: properties.name; - readOnly: !base.editingEnabled; + enabled: base.editingEnabled; onEditingFinished: base.updateMaterialDisplayName(properties.name, text) } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") } - ReadOnlyTextField + Cura.TextField { - id: brandTextField; - width: informationPage.columnWidth; - text: properties.brand; - readOnly: !base.editingEnabled; + id: brandTextField + width: informationPage.columnWidth + text: properties.brand + enabled: base.editingEnabled onEditingFinished: base.updateMaterialBrand(properties.brand, text) } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") } - ReadOnlyTextField + Cura.TextField { - id: materialTypeField; - width: informationPage.columnWidth; - text: properties.material; - readOnly: !base.editingEnabled; + id: materialTypeField + width: informationPage.columnWidth + text: properties.material + enabled: base.editingEnabled onEditingFinished: base.updateMaterialType(properties.material, text) } @@ -206,12 +206,12 @@ Item } // pretty color name text field - ReadOnlyTextField + Cura.TextField { id: colorLabel; width: parent.width - colorSelector.width - parent.spacing text: properties.color_name; - readOnly: !base.editingEnabled + enabled: base.editingEnabled onEditingFinished: base.setMetaDataEntry("color_name", properties.color_name, text) } diff --git a/resources/qml/Preferences/ReadOnlyTextField.qml b/resources/qml/Preferences/ReadOnlyTextField.qml deleted file mode 100644 index 325081dd13..0000000000 --- a/resources/qml/Preferences/ReadOnlyTextField.qml +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2016 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. -// Different than the name suggests, it is not always read-only. - -import QtQuick 2.1 -import QtQuick.Controls 2.1 -import UM 1.5 as UM -import Cura 1.0 as Cura - -Item -{ - id: base - - property alias text: textField.text - - signal editingFinished() - - property bool readOnly: false - - width: textField.width - height: textField.height - - Cura.TextField - { - id: textField - - enabled: !base.readOnly - - anchors.fill: parent - - onEditingFinished: base.editingFinished() - Keys.onEnterPressed: base.editingFinished() - Keys.onReturnPressed: base.editingFinished() - } -} From 6e5e5152beb2cd20bb63c512f92d013e477d4d2f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 10:14:47 +0100 Subject: [PATCH 239/377] Change machine actions buttons to secondaryButtons CURA-8949 --- resources/qml/Preferences/MachinesPage.qml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 48f53169f3..419c3abe0d 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -85,10 +85,14 @@ UM.ManagementPage { id: machineActions visible: currentItem && currentItem.id == Cura.MachineManager.activeMachine.id - anchors.left: parent.left - anchors.right: parent.right - anchors.top: machineName.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors + { + left: parent.left + right: parent.right + top: machineName.bottom + topMargin: UM.Theme.getSize("default_margin").height + } + spacing: UM.Theme.getSize("default_margin").height Repeater { @@ -99,7 +103,7 @@ UM.ManagementPage { width: Math.round(childrenRect.width + 2 * screenScaleFactor) height: childrenRect.height - Button + Cura.SecondaryButton { text: machineActionRepeater.model[index].label onClicked: From ee7bcc3f5f386704a0f0e6b44722c25084f031cf Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 10:27:08 +0100 Subject: [PATCH 240/377] Use UM checkbox CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 42 +++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 243dc384b7..8b9f465dea 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -314,7 +314,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.") - Cura.CheckBox + UM.CheckBox { id: autoSliceCheckbox checked: boolCheck(UM.Preferences.getValue("general/auto_slice")) @@ -344,7 +344,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.") - Cura.CheckBox + UM.CheckBox { id: showOverhangCheckbox @@ -363,7 +363,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.") - Cura.CheckBox + UM.CheckBox { id: showXrayErrorCheckbox @@ -380,7 +380,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected") - Cura.CheckBox + UM.CheckBox { id: centerOnSelectCheckbox text: catalog.i18nc("@action:button","Center camera when item is selected"); @@ -395,7 +395,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?") - Cura.CheckBox + UM.CheckBox { id: invertZoomCheckbox text: catalog.i18nc("@action:button", "Invert the direction of camera zoom."); @@ -416,7 +416,7 @@ UM.PreferencesPage height: childrenRect.height; text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.") - Cura.CheckBox + UM.CheckBox { id: zoomToMouseCheckbox text: catalog.i18nc("@action:button", "Zoom toward mouse direction") @@ -447,7 +447,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?") - Cura.CheckBox + UM.CheckBox { id: pushFreeCheckbox text: catalog.i18nc("@option:check", "Ensure models are kept apart") @@ -461,7 +461,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?") - Cura.CheckBox + UM.CheckBox { id: dropDownCheckbox text: catalog.i18nc("@option:check", "Automatically drop models to the build plate") @@ -478,7 +478,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.") - Cura.CheckBox + UM.CheckBox { id: gcodeShowCautionCheckbox @@ -495,7 +495,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?") - Cura.CheckBox + UM.CheckBox { id: forceLayerViewCompatibilityModeCheckbox text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)") @@ -510,7 +510,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?") - Cura.CheckBox + UM.CheckBox { id: restoreWindowPositionCheckbox text: catalog.i18nc("@option:check", "Restore window position on start") @@ -585,7 +585,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?") - Cura.CheckBox + UM.CheckBox { id: singleInstanceCheckbox text: catalog.i18nc("@option:check","Use a single instance of Cura") @@ -601,7 +601,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?") enabled: singleInstanceCheckbox.checked - Cura.CheckBox + UM.CheckBox { id: singleInstanceClearBeforeLoadCheckbox text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance") @@ -616,7 +616,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?") - Cura.CheckBox + UM.CheckBox { id: scaleToFitCheckbox text: catalog.i18nc("@option:check","Scale large models") @@ -631,7 +631,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?") - Cura.CheckBox + UM.CheckBox { id: scaleTinyCheckbox text: catalog.i18nc("@option:check","Scale extremely small models") @@ -646,7 +646,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?") - Cura.CheckBox + UM.CheckBox { id: selectModelsOnLoadCheckbox text: catalog.i18nc("@option:check","Select models when loaded") @@ -661,7 +661,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?") - Cura.CheckBox + UM.CheckBox { id: prefixJobNameCheckbox text: catalog.i18nc("@option:check", "Add machine prefix to job name") @@ -676,7 +676,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?") - Cura.CheckBox + UM.CheckBox { text: catalog.i18nc("@option:check", "Show summary dialog when saving project") checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save")) @@ -821,7 +821,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") - Cura.CheckBox + UM.CheckBox { id: sendDataCheckbox text: catalog.i18nc("@option:check","Send (anonymous) print information") @@ -860,7 +860,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?") - Cura.CheckBox + UM.CheckBox { id: checkUpdatesCheckbox text: catalog.i18nc("@option:check","Check for updates on start") @@ -913,7 +913,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!") - Cura.CheckBox + UM.CheckBox { id: pluginNotificationsUpdateCheckbox text: catalog.i18nc("@option:check", "Get notifications for plugin updates") From 9b05dbdb8523ba7804937033af133714df6ab535 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 18 Feb 2022 10:29:55 +0100 Subject: [PATCH 241/377] MenuItem height has to be set to 0 when visible: false otherwise there is white space in place of the MenuItem. This functionality is included in UM and was being overwritten in Cura.MenuItem. CURA-8688 --- resources/qml/Widgets/MenuItem.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index 294aa8e288..059a30e79c 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -12,8 +12,6 @@ import UM 1.5 as UM UM.MenuItem { id: menuItem - - height: UM.Theme.getSize("context_menu").height opacity: enabled ? 1.0 : 0.5 arrow: UM.RecolorImage From d88f7d4267cc41ad714ee09944070d69d65f4eed Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 18 Feb 2022 10:54:11 +0100 Subject: [PATCH 242/377] Replace `Cura.Checkbox` with `UM.CheckBox` --- resources/qml/Preferences/GeneralPage.qml | 42 +++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 243dc384b7..8b9f465dea 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -314,7 +314,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.") - Cura.CheckBox + UM.CheckBox { id: autoSliceCheckbox checked: boolCheck(UM.Preferences.getValue("general/auto_slice")) @@ -344,7 +344,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.") - Cura.CheckBox + UM.CheckBox { id: showOverhangCheckbox @@ -363,7 +363,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.") - Cura.CheckBox + UM.CheckBox { id: showXrayErrorCheckbox @@ -380,7 +380,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected") - Cura.CheckBox + UM.CheckBox { id: centerOnSelectCheckbox text: catalog.i18nc("@action:button","Center camera when item is selected"); @@ -395,7 +395,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?") - Cura.CheckBox + UM.CheckBox { id: invertZoomCheckbox text: catalog.i18nc("@action:button", "Invert the direction of camera zoom."); @@ -416,7 +416,7 @@ UM.PreferencesPage height: childrenRect.height; text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.") - Cura.CheckBox + UM.CheckBox { id: zoomToMouseCheckbox text: catalog.i18nc("@action:button", "Zoom toward mouse direction") @@ -447,7 +447,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?") - Cura.CheckBox + UM.CheckBox { id: pushFreeCheckbox text: catalog.i18nc("@option:check", "Ensure models are kept apart") @@ -461,7 +461,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?") - Cura.CheckBox + UM.CheckBox { id: dropDownCheckbox text: catalog.i18nc("@option:check", "Automatically drop models to the build plate") @@ -478,7 +478,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.") - Cura.CheckBox + UM.CheckBox { id: gcodeShowCautionCheckbox @@ -495,7 +495,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?") - Cura.CheckBox + UM.CheckBox { id: forceLayerViewCompatibilityModeCheckbox text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)") @@ -510,7 +510,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?") - Cura.CheckBox + UM.CheckBox { id: restoreWindowPositionCheckbox text: catalog.i18nc("@option:check", "Restore window position on start") @@ -585,7 +585,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?") - Cura.CheckBox + UM.CheckBox { id: singleInstanceCheckbox text: catalog.i18nc("@option:check","Use a single instance of Cura") @@ -601,7 +601,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?") enabled: singleInstanceCheckbox.checked - Cura.CheckBox + UM.CheckBox { id: singleInstanceClearBeforeLoadCheckbox text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance") @@ -616,7 +616,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?") - Cura.CheckBox + UM.CheckBox { id: scaleToFitCheckbox text: catalog.i18nc("@option:check","Scale large models") @@ -631,7 +631,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?") - Cura.CheckBox + UM.CheckBox { id: scaleTinyCheckbox text: catalog.i18nc("@option:check","Scale extremely small models") @@ -646,7 +646,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?") - Cura.CheckBox + UM.CheckBox { id: selectModelsOnLoadCheckbox text: catalog.i18nc("@option:check","Select models when loaded") @@ -661,7 +661,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?") - Cura.CheckBox + UM.CheckBox { id: prefixJobNameCheckbox text: catalog.i18nc("@option:check", "Add machine prefix to job name") @@ -676,7 +676,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?") - Cura.CheckBox + UM.CheckBox { text: catalog.i18nc("@option:check", "Show summary dialog when saving project") checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save")) @@ -821,7 +821,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") - Cura.CheckBox + UM.CheckBox { id: sendDataCheckbox text: catalog.i18nc("@option:check","Send (anonymous) print information") @@ -860,7 +860,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?") - Cura.CheckBox + UM.CheckBox { id: checkUpdatesCheckbox text: catalog.i18nc("@option:check","Check for updates on start") @@ -913,7 +913,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!") - Cura.CheckBox + UM.CheckBox { id: pluginNotificationsUpdateCheckbox text: catalog.i18nc("@option:check", "Get notifications for plugin updates") From 3e5a51503e213854848940165b0cc99efb45c1db Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 10:59:23 +0100 Subject: [PATCH 243/377] Change font of the headings in general page CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 8b9f465dea..677fa2ca55 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -150,7 +150,7 @@ UM.PreferencesPage UM.Label { - font.bold: true + font: UM.Theme.getFont("medium_bold") text: catalog.i18nc("@label", "Interface") } @@ -333,7 +333,7 @@ UM.PreferencesPage UM.Label { - font.bold: true + font: UM.Theme.getFont("medium_bold") text: catalog.i18nc("@label", "Viewport behavior") } @@ -575,7 +575,7 @@ UM.PreferencesPage UM.Label { - font.bold: true + font: UM.Theme.getFont("medium_bold") text: catalog.i18nc("@label","Opening and saving files") } @@ -757,7 +757,7 @@ UM.PreferencesPage UM.Label { - font.bold: true + font: UM.Theme.getFont("medium_bold") text: catalog.i18nc("@label", "Profiles") } @@ -812,7 +812,7 @@ UM.PreferencesPage UM.Label { - font.bold: true + font: UM.Theme.getFont("medium_bold") text: catalog.i18nc("@label", "Privacy") } UM.TooltipArea @@ -850,7 +850,7 @@ UM.PreferencesPage UM.Label { - font.bold: true + font: UM.Theme.getFont("medium_bold") text: catalog.i18nc("@label", "Updates") } From 2b220c627f5c8b017d2191de5fa2c848016459fd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 11:06:33 +0100 Subject: [PATCH 244/377] Disable wordwrap in combobox CURA-8949 --- resources/qml/Widgets/ComboBox.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index b92daad9c4..6420f41823 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -72,7 +72,7 @@ ComboBox anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.verticalCenter: parent.verticalCenter anchors.right: downArrow.left - + wrapMode: Text.NoWrap text: { if (control.delegateModel.count == 0) @@ -149,6 +149,7 @@ ComboBox textFormat: Text.PlainText color: UM.Theme.getColor("setting_control_text") elide: Text.ElideRight + wrapMode: Text.NoWrap } background: UM.TooltipArea From 46e7217646a086a19b24707241fe8b72cae13431 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 11:22:19 +0100 Subject: [PATCH 245/377] Layout tweaks for general page CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 37 +++++++++++++++-------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 677fa2ca55..4fe96d180b 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -157,7 +157,7 @@ UM.PreferencesPage GridLayout { id: interfaceGrid - columns: 4 + columns: 2 width: parent.width UM.Label @@ -208,7 +208,8 @@ UM.PreferencesPage textRole: "text" model: languageList - Layout.fillWidth: true + implicitWidth: UM.Theme.getSize("setting_control").width + implicitHeight: currencyField.height function setCurrentIndex() { var code = UM.Preferences.getValue("general/language"); @@ -223,7 +224,9 @@ UM.PreferencesPage currentIndex: setCurrentIndex() - onActivated: if (model.get(index).code != "") + onActivated: + { + if (model.get(index).code != "") { UM.Preferences.setValue("general/language", model.get(index).code); } @@ -231,6 +234,7 @@ UM.PreferencesPage { currentIndex = setCurrentIndex(); } + } } UM.Label @@ -244,6 +248,7 @@ UM.PreferencesPage id: currencyField selectByMouse: true text: UM.Preferences.getValue("cura/currency") + implicitWidth: UM.Theme.getSize("setting_control").width onTextChanged: UM.Preferences.setValue("cura/currency", text) } @@ -272,7 +277,8 @@ UM.PreferencesPage model: themeList textRole: "text" - Layout.fillWidth: true + implicitWidth: UM.Theme.getSize("setting_control").width + implicitHeight: currencyField.height currentIndex: { @@ -526,11 +532,12 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "What type of camera rendering should be used?") Column { - spacing: 4 * screenScaleFactor + spacing: UM.Theme.getSize("narrow_margin").height UM.Label { text: catalog.i18nc("@window:text", "Camera rendering:") + font: UM.Theme.getFont("medium_bold") } ListModel { @@ -548,6 +555,8 @@ UM.PreferencesPage model: comboBoxList textRole: "text" + width: UM.Theme.getSize("setting_control").width + height: UM.Theme.getSize("setting_control").height currentIndex: { @@ -589,6 +598,7 @@ UM.PreferencesPage { id: singleInstanceCheckbox text: catalog.i18nc("@option:check","Use a single instance of Cura") + checked: boolCheck(UM.Preferences.getValue("cura/single_instance")) onCheckedChanged: UM.Preferences.setValue("cura/single_instance", checked) } @@ -692,7 +702,7 @@ UM.PreferencesPage Column { - spacing: 4 * screenScaleFactor + spacing: UM.Theme.getSize("narrow_margin").height UM.Label { @@ -702,7 +712,8 @@ UM.PreferencesPage Cura.ComboBox { id: choiceOnOpenProjectDropDownButton - width: Math.round(250 * screenScaleFactor) + width: UM.Theme.getSize("setting_control").width + height: UM.Theme.getSize("setting_control").height model: ListModel { @@ -746,14 +757,14 @@ UM.PreferencesPage UM.TooltipArea { - width: childrenRect.width; - height: childrenRect.height; + width: childrenRect.width + height: childrenRect.height text: catalog.i18nc("@info:tooltip", "When you have made changes to a profile and switched to a different one, a dialog will be shown asking whether you want to keep your modifications or not, or you can choose a default behaviour and never show that dialog again.") Column { - spacing: 4 * screenScaleFactor + spacing: UM.Theme.getSize("narrow_margin").height UM.Label { @@ -769,8 +780,8 @@ UM.PreferencesPage Cura.ComboBox { id: choiceOnProfileOverrideDropDownButton - width: Math.round(250 * screenScaleFactor) - popup.width: Math.round(350 * screenScaleFactor) + width: UM.Theme.getSize("setting_control").width + height: UM.Theme.getSize("setting_control").height model: ListModel { id: discardOrKeepProfileListModel @@ -829,7 +840,7 @@ UM.PreferencesPage onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked) } - Button + Cura.SecondaryButton { id: showMoreInfo anchors.top: sendDataCheckbox.bottom From 8feaa327696002a6c8a2ec443330b7d47d4b40f9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 11:28:40 +0100 Subject: [PATCH 246/377] Codestyle cleanups Mostly just removing ;'s from QML CURA-8949 --- resources/qml/Preferences/MachinesPage.qml | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 419c3abe0d..d32ba603e7 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -11,9 +11,9 @@ import Cura 1.0 as Cura UM.ManagementPage { - id: base; + id: base - title: catalog.i18nc("@title:tab", "Printers"); + title: catalog.i18nc("@title:tab", "Printers") model: Cura.GlobalStacksModel { } sectionRole: "discoverySource" @@ -37,7 +37,7 @@ UM.ManagementPage Button { id: activateMenuButton - text: catalog.i18nc("@action:button", "Activate"); + text: catalog.i18nc("@action:button", "Activate") icon.name: "list-activate" enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachine.id onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id) @@ -45,25 +45,25 @@ UM.ManagementPage Button { id: addMenuButton - text: catalog.i18nc("@action:button", "Add"); + text: catalog.i18nc("@action:button", "Add") icon.name: "list-add" onClicked: Cura.Actions.addMachine.trigger() }, Button { id: removeMenuButton - text: catalog.i18nc("@action:button", "Remove"); + text: catalog.i18nc("@action:button", "Remove") icon.name: "list-remove" enabled: base.currentItem != null && model.count > 1 - onClicked: confirmDialog.open(); + onClicked: confirmDialog.open() }, Button { id: renameMenuButton - text: catalog.i18nc("@action:button", "Rename"); + text: catalog.i18nc("@action:button", "Rename") icon.name: "edit-rename" enabled: base.currentItem != null && base.currentItem.metadata.group_name == null - onClicked: renameDialog.open(); + onClicked: renameDialog.open() } ] @@ -156,13 +156,13 @@ UM.ManagementPage UM.RenameDialog { - id: renameDialog; - object: base.currentItem && base.currentItem.name ? base.currentItem.name : ""; + id: renameDialog + object: base.currentItem && base.currentItem.name ? base.currentItem.name : "" property var machine_name_validator: Cura.MachineNameValidator { } - validName: renameDialog.newName.match(renameDialog.machine_name_validator.machineNameRegex) != null; + validName: renameDialog.newName.match(renameDialog.machine_name_validator.machineNameRegex) != null onAccepted: { - Cura.MachineManager.renameMachine(base.currentItem.id, newName.trim()); + Cura.MachineManager.renameMachine(base.currentItem.id, newName.trim()) //Force updating currentItem and the details panel objectList.onCurrentIndexChanged() } @@ -177,6 +177,5 @@ UM.ManagementPage objectList.onCurrentIndexChanged() } } - } } From 2d0ce01ff50fde8cb7e802f8c861fcd98a2258d7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 12:28:03 +0100 Subject: [PATCH 247/377] Add menu to react on the hamburger menu CURA-8949 --- resources/qml/Preferences/MachinesPage.qml | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index d32ba603e7..53bf187fba 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -20,6 +20,7 @@ UM.ManagementPage activeId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id: "" activeIndex: activeMachineIndex() + onHamburgeButtonClicked: menu.popup(content_item, content_item.width - menu.width, hamburger_button.height) function activeMachineIndex() { @@ -34,44 +35,21 @@ UM.ManagementPage } buttons: [ - Button - { - id: activateMenuButton - text: catalog.i18nc("@action:button", "Activate") - icon.name: "list-activate" - enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachine.id - onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id) - }, - Button + Cura.SecondaryButton { id: addMenuButton - text: catalog.i18nc("@action:button", "Add") - icon.name: "list-add" + text: catalog.i18nc("@action:button", "Add New") onClicked: Cura.Actions.addMachine.trigger() - }, - Button - { - id: removeMenuButton - text: catalog.i18nc("@action:button", "Remove") - icon.name: "list-remove" - enabled: base.currentItem != null && model.count > 1 - onClicked: confirmDialog.open() - }, - Button - { - id: renameMenuButton - text: catalog.i18nc("@action:button", "Rename") - icon.name: "edit-rename" - enabled: base.currentItem != null && base.currentItem.metadata.group_name == null - onClicked: renameDialog.open() } ] Item { + id: content_item visible: base.currentItem != null anchors.fill: parent + UM.Label { id: machineName @@ -167,6 +145,28 @@ UM.ManagementPage objectList.onCurrentIndexChanged() } } + Cura.Menu + { + id: menu + Cura.MenuItem + { + text: catalog.i18nc("@action:button", "Activate") + enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachine.id + onTriggered: Cura.MachineManager.setActiveMachine(base.currentItem.id) + } + Cura.MenuItem + { + text: catalog.i18nc("@action:button", "Remove") + enabled: base.currentItem != null && model.count > 1 + onTriggered: confirmDialog.open() + } + Cura.MenuItem + { + text: catalog.i18nc("@action:button", "Rename") + enabled: base.currentItem != null && base.currentItem.metadata.group_name == null + onTriggered: renameDialog.open() + } + } Connections { From 5aed6bb3c8ece355d5c405ec22db8d5e03bedff4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 12:33:07 +0100 Subject: [PATCH 248/377] Move reset to defaults button for general page CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 4fe96d180b..67d1468be3 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -100,14 +100,14 @@ UM.PreferencesPage invertZoomCheckbox.checked = boolCheck(UM.Preferences.getValue("view/invert_zoom")) UM.Preferences.resetPreference("view/zoom_to_mouse"); zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) - UM.Preferences.resetPreference("view/top_layer_count"); - topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count")) + //UM.Preferences.resetPreference("view/top_layer_count"); + //topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count")) UM.Preferences.resetPreference("general/restore_window_geometry") restoreWindowPositionCheckbox.checked = boolCheck(UM.Preferences.getValue("general/restore_window_geometry")) UM.Preferences.resetPreference("general/camera_perspective_mode") - var defaultCameraMode = UM.Preferences.getValue("general/camera_perspective_mode") - setDefaultCameraMode(defaultCameraMode) + //var defaultCameraMode = UM.Preferences.getValue("general/camera_perspective_mode") +// /setDefaultCameraMode(defaultCameraMode) UM.Preferences.resetPreference("cura/choice_on_profile_override") setDefaultDiscardOrKeepProfile(UM.Preferences.getValue("cura/choice_on_profile_override")) @@ -125,6 +125,14 @@ UM.PreferencesPage pluginNotificationsUpdateCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check")) } + buttons: [ + Cura.SecondaryButton + { + id: addMenuButton + text: catalog.i18nc("@action:button", "Defaults") + onClicked: reset() + } + ] ScrollView { id: preferencesScrollView From 742f0b7dbb17b76137c97185826557735ffe448c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 12:49:59 +0100 Subject: [PATCH 249/377] Add defaults button to setting visibility page CURA-8949 --- resources/qml/Preferences/SettingVisibilityPage.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 2d433056db..0c8e5798c0 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -17,6 +17,15 @@ UM.PreferencesPage property int scrollToIndex: 0 + buttons: [ + Cura.SecondaryButton + { + id: addMenuButton + text: catalog.i18nc("@action:button", "Defaults") + onClicked: reset() + } + ] + signal scrollToSection( string key ) onScrollToSection: { From 67c80e8a37b61bee2998862f9d6237fd8bf03c8a Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 18 Feb 2022 14:02:09 +0100 Subject: [PATCH 250/377] Update image loader dialog - Changed the slider to a Cura.Spinbox - Use Cura-styled buttons CURA-8688 --- plugins/ImageReader/ConfigUI.qml | 75 +++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 4b3035f271..ff79e4e31d 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -11,26 +11,25 @@ import Cura 1.0 as Cura UM.Dialog { - title: catalog.i18nc("@title:window", "Convert Image...") + title: catalog.i18nc("@title:window", "Convert Image") minimumWidth: grid.width + 2 * UM.Theme.getSize("default_margin").height minimumHeight: UM.Theme.getSize("modal_window_minimum").height width: minimumWidth height: minimumHeight - - GridLayout { UM.I18nCatalog { id: catalog; name: "cura" } id: grid - columnSpacing: UM.Theme.getSize("default_margin").width - rowSpacing: UM.Theme.getSize("thin_margin").height + columnSpacing: UM.Theme.getSize("narrow_margin").width + rowSpacing: UM.Theme.getSize("narrow_margin").height columns: 2 UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: catalog.i18nc("@action:label", "Height (mm)") Layout.alignment: Qt.AlignVCenter @@ -45,6 +44,7 @@ UM.Dialog { id: peak_height Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width selectByMouse: true objectName: "Peak_Height" validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } @@ -62,6 +62,7 @@ UM.Dialog UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: catalog.i18nc("@action:label", "Base (mm)") Layout.alignment: Qt.AlignVCenter @@ -78,6 +79,7 @@ UM.Dialog id: base_height selectByMouse: true Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width objectName: "Base_Height" validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } onTextChanged: manager.onBaseHeightChanged(text) @@ -94,6 +96,7 @@ UM.Dialog UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: catalog.i18nc("@action:label", "Width (mm)") Layout.alignment: Qt.AlignVCenter @@ -110,6 +113,7 @@ UM.Dialog selectByMouse: true objectName: "Width" Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width focus: true validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onWidthChanged(text) @@ -126,6 +130,7 @@ UM.Dialog UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: catalog.i18nc("@action:label", "Depth (mm)") Layout.alignment: Qt.AlignVCenter @@ -140,6 +145,7 @@ UM.Dialog { id: depth Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width selectByMouse: true objectName: "Depth" focus: true @@ -158,6 +164,7 @@ UM.Dialog UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: "" Layout.alignment: Qt.AlignVCenter @@ -172,9 +179,14 @@ UM.Dialog { id: lighter_is_higher Layout.fillWidth: true - Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height + Layout.minimumWidth: UM.Theme.getSize("setting_control").width + Layout.preferredHeight: UM.Theme.getSize("setting_control").height objectName: "Lighter_Is_Higher" - model: [catalog.i18nc("@item:inlistbox", "Darker is higher"), catalog.i18nc("@item:inlistbox", "Lighter is higher")] + textRole: "text" + model: [ + { text: catalog.i18nc("@item:inlistbox", "Darker is higher") }, + { text: catalog.i18nc("@item:inlistbox", "Lighter is higher") } + ] onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) } } @@ -189,6 +201,7 @@ UM.Dialog UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: catalog.i18nc("@action:label", "Color Model") Layout.alignment: Qt.AlignVCenter @@ -203,10 +216,15 @@ UM.Dialog { id: color_model Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width + Layout.preferredHeight: UM.Theme.getSize("setting_control").height objectName: "ColorModel" - model: [catalog.i18nc("@item:inlistbox", "Linear"), catalog.i18nc("@item:inlistbox", "Translucency")] + textRole: "text" + model: [ + { text: catalog.i18nc("@item:inlistbox", "Linear") }, + { text: catalog.i18nc("@item:inlistbox", "Translucency") } + ] onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) } - Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height } Cura.ToolTip @@ -220,6 +238,7 @@ UM.Dialog UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: catalog.i18nc("@action:label", "1mm Transmittance (%)") Layout.alignment: Qt.AlignVCenter @@ -232,25 +251,26 @@ UM.Dialog Cura.TextField { - id: transmittance Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width selectByMouse: true objectName: "Transmittance" validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onTransmittanceChanged(text) - } - Cura.ToolTip - { - text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") - visible: transmittance.hovered || transmittance_label.containsMouse - targetPoint: Qt.point(transmittance.x + Math.round(transmittance.width / 2), 0) - y: transmittance.y + transmittance.height + UM.Theme.getSize("default_margin").height + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") + visible: parent.hovered || transmittance_label.containsMouse + targetPoint: Qt.point(parent.x + Math.round(parent.width / 2), 0) + y: parent.y + parent.height + UM.Theme.getSize("default_margin").height + } } UM.Label { Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width text: catalog.i18nc("@action:label", "Smoothing") Layout.alignment: Qt.AlignVCenter @@ -262,14 +282,15 @@ UM.Dialog } } - Slider + Cura.SpinBox { id: smoothing Layout.fillWidth: true + Layout.minimumWidth: UM.Theme.getSize("setting_control").width objectName: "Smoothing" to: 100.0 stepSize: 1.0 - onValueChanged: { manager.onSmoothingChanged(value) } + onValueChanged: manager.onSmoothingChanged(value) } Cura.ToolTip @@ -293,18 +314,20 @@ UM.Dialog onAccepted: manager.onOkButtonClicked() onRejected: manager.onCancelButtonClicked() + buttonSpacing: UM.Theme.getSize("default_margin").width + rightButtons: [ - Button - { - id: ok_button - text: catalog.i18nc("@action:button", "OK") - onClicked: manager.onOkButtonClicked() - }, - Button + Cura.TertiaryButton { id: cancel_button text: catalog.i18nc("@action:button", "Cancel") onClicked: manager.onCancelButtonClicked() + }, + Cura.PrimaryButton + { + id: ok_button + text: catalog.i18nc("@action:button", "OK") + onClicked: manager.onOkButtonClicked() } ] } From 9df7ccd5cc10ee08f2cd01ec3cdc2aa61fafae6b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 14:20:16 +0100 Subject: [PATCH 251/377] Let profiles page use ManagementPage No idea why it didn't in the first place. This caused a lot of code duplication. CURA-8949 --- resources/qml/Preferences/ProfilesPage.qml | 788 ++++++++------------- 1 file changed, 280 insertions(+), 508 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index a1a88a4c0b..0d2b811f8b 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -10,35 +10,24 @@ import UM 1.5 as UM import Cura 1.6 as Cura -Item +UM.ManagementPage { id: base - property var resetEnabled: false // Keep PreferencesDialog happy property var extrudersModel: CuraApplication.getExtrudersModel() property var qualityManagementModel: CuraApplication.getQualityManagementModel() - UM.I18nCatalog { id: catalog; name: "cura"; } + scrollviewCaption: catalog.i18nc("@label", "Profiles compatible with active printer:") + "" + Cura.MachineManager.activeMachine.name + "" + + onHamburgeButtonClicked: menu.popup(content_item, content_item.width - menu.width, hamburger_button.height) - Label - { - id: titleLabel - anchors - { - top: parent.top - left: parent.left - right: parent.right - margins: 5 * screenScaleFactor - } - font.pointSize: 18 - text: catalog.i18nc("@title:tab", "Profiles") - } property var hasCurrentItem: base.currentItem != null + sectionRole: "section_name" property var currentItem: { - var current_index = qualityListView.currentIndex; + var current_index = objectList.currentIndex; return (current_index == -1) ? null : base.qualityManagementModel.getItem(current_index); } @@ -66,125 +55,29 @@ Item return isCurrentItemActivated && Cura.MachineManager.hasUserSettings; } - Row // Button Row - { - id: buttonRow - anchors + model: qualityManagementModel + buttons: [ + Cura.SecondaryButton { - left: parent.left - right: parent.right - top: titleLabel.bottom - } - height: childrenRect.height - - // Activate button - Button - { - id: activateMenuButton - text: catalog.i18nc("@action:button", "Activate") - icon.name: "list-activate" - enabled: !isCurrentItemActivated && base.currentItem - onClicked: - { - if(base.currentItem.is_read_only) - { - Cura.IntentManager.selectIntent(base.currentItem.intent_category, base.currentItem.quality_type); - } - else - { - Cura.MachineManager.setQualityChangesGroup(base.currentItem.quality_changes_group); - } - } - } - - // Create button - Button + text: catalog.i18nc("@action:button", "Import") + onClicked:importDialog.open() + }, + Cura.SecondaryButton { id: createMenuButton - text: catalog.i18nc("@label", "Create") - icon.name: "list-add" - enabled: base.canCreateProfile && !Cura.MachineManager.stacksHaveErrors + text: catalog.i18nc("@action:button", "Create new") + + enabled: !Cura.MachineManager.stacksHaveErrors visible: base.canCreateProfile onClicked: { - createQualityDialog.object = Cura.ContainerManager.makeUniqueName(base.currentItem.name); - createQualityDialog.open(); - createQualityDialog.selectText(); + createQualityDialog.object = Cura.ContainerManager.makeUniqueName(base.currentItem.name) + createQualityDialog.open() + createQualityDialog.selectText() } } - - // Duplicate button - Button - { - id: duplicateMenuButton - text: catalog.i18nc("@label", "Duplicate") - icon.name: "list-add" - enabled: !base.canCreateProfile - visible: !base.canCreateProfile - - onClicked: - { - duplicateQualityDialog.object = Cura.ContainerManager.makeUniqueName(base.currentItem.name); - duplicateQualityDialog.open(); - duplicateQualityDialog.selectText(); - } - } - - // Remove button - Button - { - id: removeMenuButton - text: catalog.i18nc("@action:button", "Remove") - icon.name: "list-remove" - enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated - onClicked: - { - forceActiveFocus(); - confirmRemoveQualityDialog.open(); - } - } - - // Rename button - Button - { - id: renameMenuButton - text: catalog.i18nc("@action:button", "Rename") - icon.name: "edit-rename" - enabled: base.hasCurrentItem && !base.currentItem.is_read_only - onClicked: - { - renameQualityDialog.object = base.currentItem.name; - renameQualityDialog.open(); - renameQualityDialog.selectText(); - } - } - - // Import button - Button - { - id: importMenuButton - text: catalog.i18nc("@action:button", "Import") - icon.name: "document-import" - onClicked: - { - importDialog.open(); - } - } - - // Export button - Button - { - id: exportMenuButton - text: catalog.i18nc("@action:button", "Export") - icon.name: "document-export" - enabled: base.hasCurrentItem && !base.currentItem.is_read_only - onClicked: - { - exportDialog.open(); - } - } - } + ] // Click create profile from ... in Profile context menu signal createProfile() @@ -195,186 +88,209 @@ Item createQualityDialog.selectText(); } - // Dialog to request a name when creating a new profile - UM.RenameDialog - { - id: createQualityDialog - title: catalog.i18nc("@title:window", "Create Profile") - object: "" - explanation: catalog.i18nc("@info", "Please provide a name for this profile.") - onAccepted: - { - base.newQualityNameToSelect = newName; // We want to switch to the new profile once it's created - base.toActivateNewQuality = true; - base.qualityManagementModel.createQualityChanges(newName); - } - } - property string newQualityNameToSelect: "" property bool toActivateNewQuality: false - // This connection makes sure that we will switch to the correct quality after the model gets updated - Connections + Item { - target: base.qualityManagementModel - function onItemsChanged() + id: content_item + anchors.fill: parent + // This connection makes sure that we will switch to the correct quality after the model gets updated + Connections { - var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name; - if (newQualityNameToSelect != "") + target: base.qualityManagementModel + function onItemsChanged() { - toSelectItemName = newQualityNameToSelect; - } - - var newIdx = -1; // Default to nothing if nothing can be found - if (toSelectItemName != "") - { - // Select the required quality name if given - for (var idx = 0; idx < base.qualityManagementModel.count; ++idx) + var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name; + if (newQualityNameToSelect != "") { - var item = base.qualityManagementModel.getItem(idx); - if (item && item.name == toSelectItemName) + toSelectItemName = newQualityNameToSelect; + } + + var newIdx = -1; // Default to nothing if nothing can be found + if (toSelectItemName != "") + { + // Select the required quality name if given + for (var idx = 0; idx < base.qualityManagementModel.count; ++idx) { - // Switch to the newly created profile if needed - newIdx = idx; - if (base.toActivateNewQuality) + var item = base.qualityManagementModel.getItem(idx); + if (item && item.name == toSelectItemName) { - // Activate this custom quality if required - if(item.quality_changes_group) + // Switch to the newly created profile if needed + newIdx = idx; + if (base.toActivateNewQuality) { - Cura.MachineManager.setQualityChangesGroup(item.quality_changes_group); + // Activate this custom quality if required + if(item.quality_changes_group) + { + Cura.MachineManager.setQualityChangesGroup(item.quality_changes_group); + } } + break; } - break; + } + } + objectList.currentIndex = newIdx; + + // Reset states + base.newQualityNameToSelect = ""; + base.toActivateNewQuality = false; + } + } + UM.MessageDialog + { + id: messageDialog + standardButtons: Dialog.Ok + } + + // Dialog to request a name when creating a new profile + UM.RenameDialog + { + id: createQualityDialog + title: catalog.i18nc("@title:window", "Create Profile") + object: "" + explanation: catalog.i18nc("@info", "Please provide a name for this profile.") + onAccepted: + { + base.newQualityNameToSelect = newName; // We want to switch to the new profile once it's created + base.toActivateNewQuality = true; + base.qualityManagementModel.createQualityChanges(newName); + } + } + + Cura.Menu + { + id: menu + Cura.MenuItem + { + text: catalog.i18nc("@action:button", "Activate") + + enabled: !isCurrentItemActivated && base.currentItem + onTriggered: + { + if(base.currentItem.is_read_only) + { + Cura.IntentManager.selectIntent(base.currentItem.intent_category, base.currentItem.quality_type) + } + else + { + Cura.MachineManager.setQualityChangesGroup(base.currentItem.quality_changes_group) } } } - qualityListView.currentIndex = newIdx; - - // Reset states - base.newQualityNameToSelect = ""; - base.toActivateNewQuality = false; - } - } - - // Dialog to request a name when duplicating a new profile - UM.RenameDialog - { - id: duplicateQualityDialog - title: catalog.i18nc("@title:window", "Duplicate Profile") - object: "" - onAccepted: - { - base.qualityManagementModel.duplicateQualityChanges(newName, base.currentItem); - } - } - - // Confirmation dialog for removing a profile - UM.MessageDialog - { - id: confirmRemoveQualityDialog - - title: catalog.i18nc("@title:window", "Confirm Remove") - text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItemName) - standardButtons: StandardButton.Yes | StandardButton.No - modal: true - - onAccepted: - { - base.qualityManagementModel.removeQualityChangesGroup(base.currentItem.quality_changes_group); - // reset current item to the first if available - qualityListView.currentIndex = -1; // Reset selection. - } - } - - // Dialog to rename a quality profile - UM.RenameDialog - { - id: renameQualityDialog - title: catalog.i18nc("@title:window", "Rename Profile") - object: "" - onAccepted: - { - var actualNewName = base.qualityManagementModel.renameQualityChangesGroup(base.currentItem.quality_changes_group, newName); - base.newQualityNameToSelect = actualNewName; // Select the new name after the model gets updated - } - } - - // Dialog for importing a quality profile - FileDialog - { - id: importDialog - title: catalog.i18nc("@title:window", "Import Profile") - selectExisting: true - nameFilters: base.qualityManagementModel.getFileNameFilters("profile_reader") - folder: CuraApplication.getDefaultPath("dialog_profile_path") - onAccepted: - { - var result = Cura.ContainerManager.importProfile(fileUrl); - messageDialog.title = catalog.i18nc("@title:window", "Import Profile") - messageDialog.text = result.message; - messageDialog.open(); - CuraApplication.setDefaultPath("dialog_profile_path", folder); - } - } - - // Dialog for exporting a quality profile - FileDialog - { - id: exportDialog - title: catalog.i18nc("@title:window", "Export Profile") - selectExisting: false - nameFilters: base.qualityManagementModel.getFileNameFilters("profile_writer") - folder: CuraApplication.getDefaultPath("dialog_profile_path") - onAccepted: - { - var result = Cura.ContainerManager.exportQualityChangesGroup(base.currentItem.quality_changes_group, - fileUrl, selectedNameFilter); - - if (result && result.status == "error") + Cura.MenuItem { - messageDialog.title = catalog.i18nc("@title:window", "Export Profile") + text: catalog.i18nc("@action:button", "Remove") + enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated + onTriggered: + { + forceActiveFocus() + confirmRemoveQualityDialog.open() + } + } + Cura.MenuItem + { + text: catalog.i18nc("@action:button", "Rename") + enabled: base.hasCurrentItem && !base.currentItem.is_read_only + onTriggered: + { + renameQualityDialog.object = base.currentItem.name + renameQualityDialog.open() + renameQualityDialog.selectText() + } + } + Cura.MenuItem + { + text: catalog.i18nc("@action:button", "Export") + enabled: base.hasCurrentItem && !base.currentItem.is_read_only + onTriggered: exportDialog.open() + } + } + + // Dialog for exporting a quality profile + FileDialog + { + id: exportDialog + title: catalog.i18nc("@title:window", "Export Profile") + selectExisting: false + nameFilters: base.qualityManagementModel.getFileNameFilters("profile_writer") + folder: CuraApplication.getDefaultPath("dialog_profile_path") + onAccepted: + { + var result = Cura.ContainerManager.exportQualityChangesGroup(base.currentItem.quality_changes_group, + fileUrl, selectedNameFilter); + + if (result && result.status == "error") + { + messageDialog.title = catalog.i18nc("@title:window", "Export Profile") + messageDialog.text = result.message; + messageDialog.open(); + } + + // else pop-up Message thing from python code + CuraApplication.setDefaultPath("dialog_profile_path", folder); + } + } + + // Dialog to request a name when duplicating a new profile + UM.RenameDialog + { + id: duplicateQualityDialog + title: catalog.i18nc("@title:window", "Duplicate Profile") + object: "" + onAccepted: + { + base.qualityManagementModel.duplicateQualityChanges(newName, base.currentItem); + } + } + + // Confirmation dialog for removing a profile + UM.MessageDialog + { + id: confirmRemoveQualityDialog + + title: catalog.i18nc("@title:window", "Confirm Remove") + text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItemName) + standardButtons: StandardButton.Yes | StandardButton.No + modal: true + + onAccepted: + { + base.qualityManagementModel.removeQualityChangesGroup(base.currentItem.quality_changes_group); + // reset current item to the first if available + qualityListView.currentIndex = -1; // Reset selection. + } + } + + // Dialog to rename a quality profile + UM.RenameDialog + { + id: renameQualityDialog + title: catalog.i18nc("@title:window", "Rename Profile") + object: "" + onAccepted: + { + var actualNewName = base.qualityManagementModel.renameQualityChangesGroup(base.currentItem.quality_changes_group, newName); + base.newQualityNameToSelect = actualNewName; // Select the new name after the model gets updated + } + } + + // Dialog for importing a quality profile + FileDialog + { + id: importDialog + title: catalog.i18nc("@title:window", "Import Profile") + selectExisting: true + nameFilters: base.qualityManagementModel.getFileNameFilters("profile_reader") + folder: CuraApplication.getDefaultPath("dialog_profile_path") + onAccepted: + { + var result = Cura.ContainerManager.importProfile(fileUrl); + messageDialog.title = catalog.i18nc("@title:window", "Import Profile") messageDialog.text = result.message; messageDialog.open(); + CuraApplication.setDefaultPath("dialog_profile_path", folder); } - - // else pop-up Message thing from python code - CuraApplication.setDefaultPath("dialog_profile_path", folder); - } - } - - //Dialogue box for showing the result of importing or exporting profiles. - UM.MessageDialog - { - id: messageDialog - standardButtons: Dialog.Ok - } - - Item - { - id: contentsItem - - anchors - { - top: titleLabel.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - margins: 5 * screenScaleFactor - bottomMargin: 0 - } - - clip: true - } - - Item - { - anchors - { - top: buttonRow.bottom - topMargin: UM.Theme.getSize("default_margin").height - left: parent.left - right: parent.right - bottom: parent.bottom } SystemPalette @@ -382,241 +298,97 @@ Item id: palette } - Label + Column { - id: captionLabel + id: detailsPanelHeaderColumn anchors { - top: parent.top left: parent.left - } - visible: text != "" - text: catalog.i18nc("@label %1 is printer name", "Printer: %1").arg(Cura.MachineManager.activeMachine.name) - width: profileBackground.width - elide: Text.ElideRight - } - - Rectangle - { - id: profileBackground - anchors - { - top: captionLabel.visible ? captionLabel.bottom : parent.top - topMargin: captionLabel.visible ? UM.Theme.getSize("default_margin").height : 0 - bottom: parent.bottom - left: parent.left - } - width: (parent.width * 0.4) | 0 - - color: palette.light - - ListView - { - id: qualityListView - anchors.fill: parent - - ScrollBar.vertical: UM.ScrollBar - { - id: profileScrollBar - } - clip: true - model: base.qualityManagementModel - - Component.onCompleted: - { - var selectedItemName = Cura.MachineManager.activeQualityOrQualityChangesName; - - // Select the required quality name if given - for (var idx = 0; idx < base.qualityManagementModel.count; idx++) - { - var item = base.qualityManagementModel.getItem(idx); - if (item.name == selectedItemName) - { - currentIndex = idx; - break; - } - } - } - - section.property: "section_name" - section.delegate: Rectangle - { - height: childrenRect.height - - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - text: section - font.bold: true - } - } - - delegate: Rectangle - { - width: profileBackground.width - profileScrollBar.width - height: childrenRect.height - - // Added this property to identify custom profiles in automated system tests (Squish) - property bool isReadOnly: model.is_read_only - - property bool isCurrentItem: ListView.isCurrentItem - color: isCurrentItem ? palette.highlight : (model.index % 2) ? palette.base : palette.alternateBase - - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.right: parent.right - width: Math.floor((parent.width * 0.8)) - text: model.name - elide: Text.ElideRight - font.italic: - { - if (model.is_read_only) - { - // For built-in qualities, it needs to match both the intent category and the quality name - return model.name == Cura.MachineManager.activeQualityOrQualityChangesName && model.intent_category == Cura.MachineManager.activeIntentCategory - } - else - { - // For custom qualities, it only needs to match the name - return model.name == Cura.MachineManager.activeQualityOrQualityChangesName - } - } - color: parent.isCurrentItem ? palette.highlightedText : palette.text - } - - MouseArea - { - anchors.fill: parent - onClicked: - { - parent.ListView.view.currentIndex = model.index; - } - } - } - } - } - - // details panel on the right - Item - { - id: detailsPanel - - anchors - { - left: profileBackground.right - leftMargin: UM.Theme.getSize("default_margin").width - top: parent.top - bottom: parent.bottom right: parent.right + top: parent.top } - Column + spacing: UM.Theme.getSize("default_margin").height + visible: base.currentItem != null + UM.Label { - id: detailsPanelHeaderColumn - anchors - { - left: parent.left - right: parent.right - top: parent.top - } - - spacing: UM.Theme.getSize("default_margin").height - visible: base.currentItem != null - - Item // Profile title Label - { - id: profileName - - width: parent.width - height: childrenRect.height - - Label - { - anchors.left: parent.left - anchors.right: parent.right - text: base.currentItemDisplayName - font: UM.Theme.getFont("large_bold") - elide: Text.ElideRight - renderType: Text.NativeRendering - } - } - - Flow - { - id: currentSettingsActions - width: parent.width - - visible: base.hasCurrentItem && base.currentItem.name == Cura.MachineManager.activeQualityOrQualityChangesName && base.currentItem.intent_category == Cura.MachineManager.activeIntentCategory - - Button - { - text: catalog.i18nc("@action:button", "Update profile with current settings/overrides") - enabled: Cura.MachineManager.hasUserSettings && qualityListView.currentItem && !qualityListView.currentItem.is_read_only - onClicked: Cura.ContainerManager.updateQualityChanges() - } - - Button - { - text: catalog.i18nc("@action:button", "Discard current changes"); - enabled: Cura.MachineManager.hasUserSettings - onClicked: Cura.ContainerManager.clearUserContainers(); - } - } - - Label - { - id: defaultsMessage - visible: false - text: catalog.i18nc("@action:label", "This profile uses the defaults specified by the printer, so it has no settings/overrides in the list below.") - wrapMode: Text.WordWrap - width: parent.width - } - Label - { - id: noCurrentSettingsMessage - visible: base.isCurrentItemActivated && !Cura.MachineManager.hasUserSettings - text: catalog.i18nc("@action:label", "Your current settings match the selected profile.") - wrapMode: Text.WordWrap - width: parent.width - } - - UM.TabRow - { - id: profileExtruderTabs - UM.TabRowButton //One extra tab for the global settings. - { - text: catalog.i18nc("@title:tab", "Global Settings") - } - - Repeater - { - model: base.extrudersModel - - UM.TabRowButton - { - text: model.name - } - } - } + anchors.left: parent.left + anchors.right: parent.right + text: base.currentItemDisplayName + font: UM.Theme.getFont("large_bold") + elide: Text.ElideRight } - Cura.ProfileOverview + Flow { - anchors + id: currentSettingsActions + width: parent.width + + visible: base.hasCurrentItem && base.currentItem.name == Cura.MachineManager.activeQualityOrQualityChangesName && base.currentItem.intent_category == Cura.MachineManager.activeIntentCategory + + Cura.SecondaryButton { - top: detailsPanelHeaderColumn.bottom - left: parent.left - right: parent.right - bottom: parent.bottom + text: catalog.i18nc("@action:button", "Update profile with current settings/overrides") + enabled: Cura.MachineManager.hasUserSettings && objectList.currentIndex && !objectList.currentIndex.is_read_only + onClicked: Cura.ContainerManager.updateQualityChanges() } - visible: detailsPanelHeaderColumn.visible - qualityItem: base.currentItem - extruderPosition: profileExtruderTabs.currentIndex - 1 + Cura.SecondaryButton + { + text: catalog.i18nc("@action:button", "Discard current changes"); + enabled: Cura.MachineManager.hasUserSettings + onClicked: Cura.ContainerManager.clearUserContainers(); + } } + + UM.Label + { + id: defaultsMessage + visible: false + text: catalog.i18nc("@action:label", "This profile uses the defaults specified by the printer, so it has no settings/overrides in the list below.") + width: parent.width + } + UM.Label + { + id: noCurrentSettingsMessage + visible: base.isCurrentItemActivated && !Cura.MachineManager.hasUserSettings + text: catalog.i18nc("@action:label", "Your current settings match the selected profile.") + width: parent.width + } + + UM.TabRow + { + id: profileExtruderTabs + UM.TabRowButton //One extra tab for the global settings. + { + text: catalog.i18nc("@title:tab", "Global Settings") + } + + Repeater + { + model: base.extrudersModel + + UM.TabRowButton + { + text: model.name + } + } + } + } + + Cura.ProfileOverview + { + anchors + { + top: detailsPanelHeaderColumn.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + } + + visible: detailsPanelHeaderColumn.visible + qualityItem: base.currentItem + extruderPosition: profileExtruderTabs.currentIndex - 1 } } } From 26470440f08a1bdc71f132993ffcea4e2b399156 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 18 Feb 2022 14:21:37 +0100 Subject: [PATCH 252/377] Update buttons in work space dialog Use Cura-styled buttons Use dialog accecpt-reject handlers CURA-8688 --- plugins/3MFReader/WorkspaceDialog.qml | 48 ++++++++------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 450f01fbd5..781c12ad84 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -432,44 +432,24 @@ UM.Dialog } } } - Item - { - id: buttonsItem - width: parent.width - height: childrenRect.height - anchors.bottom: parent.bottom - anchors.right: parent.right - Button + + buttonSpacing: UM.Theme.getSize("default_margin").width + + rightButtons: [ + Cura.TertiaryButton { id: cancel_button - text: catalog.i18nc("@action:button","Cancel"); - onClicked: { manager.onCancelButtonClicked() } - enabled: true - anchors.bottom: parent.bottom - anchors.right: ok_button.left - anchors.rightMargin: 2 * screenScaleFactor - } - Button + text: catalog.i18nc("@action:button", "Cancel") + onClicked: reject() + }, + Cura.PrimaryButton { id: ok_button - anchors.right: parent.right - anchors.bottom: parent.bottom - text: catalog.i18nc("@action:button","Open"); - onClicked: { manager.closeBackend(); manager.onOkButtonClicked() } + text: catalog.i18nc("@action:button", "Open") + onClicked: accept() } - } + ] - - function accept() { - manager.closeBackend(); - manager.onOkButtonClicked(); - base.visible = false; - base.accept(); - } - - function reject() { - manager.onCancelButtonClicked(); - base.visible = false; - base.rejected(); - } + onRejected: manager.onCancelButtonClicked() + onAccepted: manager.onOkButtonClicked() } From a458155258d52c02e35a422ed6cfcee6dc7186ec Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 15:09:57 +0100 Subject: [PATCH 253/377] Update look of the profilesPage CURA-8949 --- resources/qml/Preferences/ProfilesPage.qml | 1 + resources/qml/TableView.qml | 52 ++++++++++++++-------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 0d2b811f8b..2aa44c827b 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -381,6 +381,7 @@ UM.ManagementPage anchors { top: detailsPanelHeaderColumn.bottom + margins: UM.Theme.getSize("default_margin").height left: parent.left right: parent.right bottom: parent.bottom diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 1075ce1f8a..87f9fbdc05 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -39,22 +39,23 @@ Item width: Math.max(1, Math.round(tableBase.width / headerRepeater.count)) height: UM.Theme.getSize("section").height - color: UM.Theme.getColor("secondary") + color: UM.Theme.getColor("main_background") + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("thick_lining") - Label + UM.Label { id: contentText anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("narrow_margin").width - + wrapMode: Text.NoWrap text: modelData font: UM.Theme.getFont("medium_bold") - color: UM.Theme.getColor("text") elide: Text.ElideRight } - Rectangle //Resize handle. + Item //Resize handle. { anchors { @@ -62,9 +63,7 @@ Item top: parent.top bottom: parent.bottom } - width: UM.Theme.getSize("thick_lining").width - - color: UM.Theme.getColor("thick_lining") + width: UM.Theme.getSize("default_lining").width MouseArea { @@ -97,13 +96,24 @@ Item } } - onWidthChanged: - { - tableView.forceLayout(); //Rescale table cells underneath as well. - } + onWidthChanged: tableView.forceLayout(); //Rescale table cells underneath as well. } } } + Rectangle + { + color: UM.Theme.getColor("main_background") + anchors + { + top: headerBar.bottom + topMargin: -UM.Theme.getSize("default_lining").width + left: parent.left + right: parent.right + bottom: parent.bottom + } + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("thick_lining") + } TableView { @@ -114,6 +124,7 @@ Item left: parent.left right: parent.right bottom: parent.bottom + margins: UM.Theme.getSize("default_lining").width } flickableDirection: Flickable.AutoFlickIfNeeded @@ -128,18 +139,21 @@ Item { implicitHeight: Math.max(1, cellContent.height) - color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background")) + color: UM.Theme.getColor((tableBase.currentRow == row) ? "text_selection" : "main_background") - Label + UM.Label { id: cellContent - width: parent.width - + anchors + { + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + } + wrapMode: Text.NoWrap text: display verticalAlignment: Text.AlignVCenter elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") } TextMetrics { From 7be54a47ec1c4067f7b946a07a0b43adef65045c Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 18 Feb 2022 16:00:03 +0100 Subject: [PATCH 254/377] Use cura-styled button in settings pick dialog CURA-8688 --- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 33710acc06..b14e9f3082 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -13,7 +13,6 @@ UM.Dialog id: settingPickDialog title: catalog.i18nc("@title:window", "Select Settings to Customize for this model") - width: screenScaleFactor * 360 property var additional_excluded_settings @@ -126,10 +125,10 @@ UM.Dialog } rightButtons: [ - Button + Cura.TertiaryButton { text: catalog.i18nc("@action:button", "Close") - onClicked: settingPickDialog.visible = false + onClicked: reject() } ] } \ No newline at end of file From ec186f140b7d5dcdcfeea49474ee76f0ccd5fa7c Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 18 Feb 2022 16:01:51 +0100 Subject: [PATCH 255/377] Use cura-styled button in about page CURA-8688 --- resources/qml/Dialogs/AboutDialog.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index d917656c9f..d08b9658db 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -165,12 +165,11 @@ UM.Dialog } } - rightButtons: Cura.SecondaryButton + rightButtons: Cura.TertiaryButton { //: Close about dialog button id: closeButton text: catalog.i18nc("@action:button", "Close") - - onClicked: base.visible = false; + onClicked: reject() } } From 2ed1894a27d140d25bbb7168f9ea76c21b48e979 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 18 Feb 2022 16:11:18 +0100 Subject: [PATCH 256/377] Set Dialog margin as it was in 4.13 CURA-8688 --- resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 18517d5e96..15540e1964 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -21,6 +21,8 @@ UM.Dialog width: minimumWidth height: minimumHeight + margin: UM.Theme.getSize("thick_margin").width + property var changesModel: Cura.UserChangesModel { id: userChangesModel } onVisibilityChanged: From 84fe432239f17dcb896cce62cba7b0e4db98523e Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 18 Feb 2022 16:11:25 +0100 Subject: [PATCH 257/377] Use cura-styled button in machines page CURA-8688 --- resources/qml/Preferences/MachinesPage.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 48f53169f3..98ed48ed47 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -120,9 +120,7 @@ UM.ManagementPage id: actionDialog minimumWidth: UM.Theme.getSize("modal_window_minimum").width minimumHeight: UM.Theme.getSize("modal_window_minimum").height - maximumWidth: minimumWidth * 3 - maximumHeight: minimumHeight * 3 - rightButtons: Button + rightButtons: Cura.TertiaryButton { text: catalog.i18nc("@action:button", "Close") icon.name: "dialog-close" From 3a1d5a29fa06de6faebf9cfce97648343ad1f26d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 16:12:23 +0100 Subject: [PATCH 258/377] Add background to profiles page CURA-8949 --- resources/qml/Preferences/ProfilesPage.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 2aa44c827b..67cf84de63 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -376,6 +376,21 @@ UM.ManagementPage } } + Rectangle + { + color: UM.Theme.getColor("main_background") + anchors + { + top: detailsPanelHeaderColumn.bottom + topMargin: -UM.Theme.getSize("default_lining").width + left: parent.left + right: parent.right + bottom: parent.bottom + } + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("thick_lining") + } + Cura.ProfileOverview { anchors From d6b2b951f294f77efb13ed5190f8399ccd928597 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 16:15:43 +0100 Subject: [PATCH 259/377] Hide background if no item is selected CURA-8949 --- resources/qml/Preferences/ProfilesPage.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 67cf84de63..f9d5d9c4b3 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -389,6 +389,7 @@ UM.ManagementPage } border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("thick_lining") + visible: base.hasCurrentItem } Cura.ProfileOverview From af99b87bef0772dd5e1c7f58aea37738a3d9cb62 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Feb 2022 16:28:10 +0100 Subject: [PATCH 260/377] Remove close button No idea why it was there in the first place. The dialog itself can be closed... CURA-8949 --- resources/qml/Preferences/MachinesPage.qml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 53bf187fba..d4b2581b33 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -104,12 +104,6 @@ UM.ManagementPage minimumHeight: UM.Theme.getSize("modal_window_minimum").height maximumWidth: minimumWidth * 3 maximumHeight: minimumHeight * 3 - rightButtons: Button - { - text: catalog.i18nc("@action:button", "Close") - icon.name: "dialog-close" - onClicked: actionDialog.reject() - } } UM.I18nCatalog { id: catalog; name: "cura"; } From d333b4639c29937e4ac993b966809aa9bd217c96 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 18 Feb 2022 17:20:49 +0100 Subject: [PATCH 261/377] Align per object settings visibility checkbox with icon CURA-8688 --- plugins/PerObjectSettingsTool/PerObjectItem.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectItem.qml b/plugins/PerObjectSettingsTool/PerObjectItem.qml index ac78da7850..d5582b9643 100644 --- a/plugins/PerObjectSettingsTool/PerObjectItem.qml +++ b/plugins/PerObjectSettingsTool/PerObjectItem.qml @@ -10,16 +10,24 @@ import Cura 1.0 as Cura UM.TooltipArea { - x: model.depth * UM.Theme.getSize("default_margin").width; - text: model.description; + x: model.depth * UM.Theme.getSize("default_margin").width + text: model.description - width: childrenRect.width; - height: childrenRect.height; + width: childrenRect.width + height: childrenRect.height + + Item + { + id: spacer + width: 5 + } UM.CheckBox { id: check + anchors.left: spacer.right + text: definition.label checked: addedSettingsModel.getVisible(model.key) From c00eb5b432c6842ff872e086d6b893e27a967b94 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 18 Feb 2022 18:15:48 +0100 Subject: [PATCH 262/377] Align checkbox with category icon in per object visibility settings dialog and preferences visibility settings. Move "Information" icon to the right of checkboxes in settings visibilty preferences page. This allows clean aligning of checkboxes with category icon. CURA-8688 --- .../PerObjectCategory.qml | 19 +++++++++++++------ .../PerObjectSettingsTool/PerObjectItem.qml | 3 ++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectCategory.qml b/plugins/PerObjectSettingsTool/PerObjectCategory.qml index 3f95d4e021..1800555b9d 100644 --- a/plugins/PerObjectSettingsTool/PerObjectCategory.qml +++ b/plugins/PerObjectSettingsTool/PerObjectCategory.qml @@ -11,19 +11,26 @@ import ".." Button { id: base; - background: Item { } + background: Item {} contentItem: Row { spacing: UM.Theme.getSize("default_lining").width - UM.RecolorImage + Item //Wrapper to give space before icon with fixed width. This allows aligning checkbox with category icon. { - anchors.verticalCenter: parent.verticalCenter - height: (label.height / 2) | 0 + height: label.height width: height - source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); - color: base.hovered ? palette.highlight : palette.buttonText + anchors.verticalCenter: parent.verticalCenter + + UM.RecolorImage + { + anchors.verticalCenter: parent.verticalCenter + height: (label.height / 2) | 0 + width: height + source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); + color: base.hovered ? palette.highlight : palette.buttonText + } } UM.RecolorImage { diff --git a/plugins/PerObjectSettingsTool/PerObjectItem.qml b/plugins/PerObjectSettingsTool/PerObjectItem.qml index d5582b9643..0c8015541e 100644 --- a/plugins/PerObjectSettingsTool/PerObjectItem.qml +++ b/plugins/PerObjectSettingsTool/PerObjectItem.qml @@ -19,7 +19,8 @@ UM.TooltipArea Item { id: spacer - width: 5 + // Align checkbox with PerObjectCategory icon + width: UM.Theme.getSize("default_margin").width } UM.CheckBox From 8e55dda3cca087a0d76011a58f11968b6a5806cf Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 10:03:44 +0100 Subject: [PATCH 263/377] Switch old checkbox over to styled variant CURA-8949 --- resources/qml/Preferences/SettingVisibilityPage.qml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 0c8e5798c0..48580da1ac 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -3,7 +3,6 @@ import QtQuick 2.1 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.1 as OldControls import UM 1.5 as UM @@ -43,7 +42,7 @@ UM.PreferencesPage id: base anchors.fill: parent - OldControls.CheckBox + UM.CheckBox { id: toggleVisibleSettings anchors @@ -53,7 +52,7 @@ UM.PreferencesPage leftMargin: UM.Theme.getSize("default_margin").width } text: catalog.i18nc("@label:textbox", "Check all") - checkedState: + checkState: { if(definitionsModel.visibleCount == definitionsModel.categoryCount) { @@ -68,8 +67,7 @@ UM.PreferencesPage return Qt.PartiallyChecked } } - partiallyCheckedEnabled: true - + tristate: true MouseArea { anchors.fill: parent; From 8b987d9537b29a5ca25ff946ddebae5a40fa12ce Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 10:05:09 +0100 Subject: [PATCH 264/377] Remove id left over from copy paste CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 1 - resources/qml/Preferences/MachinesPage.qml | 1 - resources/qml/Preferences/SettingVisibilityPage.qml | 1 - 3 files changed, 3 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 67d1468be3..a204c53ad3 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -128,7 +128,6 @@ UM.PreferencesPage buttons: [ Cura.SecondaryButton { - id: addMenuButton text: catalog.i18nc("@action:button", "Defaults") onClicked: reset() } diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index d4b2581b33..e51fce09f0 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -37,7 +37,6 @@ UM.ManagementPage buttons: [ Cura.SecondaryButton { - id: addMenuButton text: catalog.i18nc("@action:button", "Add New") onClicked: Cura.Actions.addMachine.trigger() } diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 48580da1ac..0cc10be0f9 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -19,7 +19,6 @@ UM.PreferencesPage buttons: [ Cura.SecondaryButton { - id: addMenuButton text: catalog.i18nc("@action:button", "Defaults") onClicked: reset() } From ec407a81d37709578ce9184ff641b1a20e49eaca Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 10:19:02 +0100 Subject: [PATCH 265/377] Change ordering of some items in general page As per design CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 31 +++++++++-------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index a204c53ad3..1dd988706c 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -170,7 +170,7 @@ UM.PreferencesPage UM.Label { id: languageLabel - text: "Language:" //Don't translate this, to make it easier to find the language drop-down if you can't read the current language. + text: "Language*:" //Don't translate this, to make it easier to find the language drop-down if you can't read the current language. } ListModel @@ -262,7 +262,7 @@ UM.PreferencesPage UM.Label { id: themeLabel - text: catalog.i18nc("@label","Theme:") + text: catalog.i18nc("@label: Please keep the asterix, it's to indicate that a restart is needed.", "Theme*:") } ListModel @@ -303,23 +303,6 @@ UM.PreferencesPage } } - UM.Label - { - id: languageCaption - - //: Language change warning - text: catalog.i18nc("@label", "You will need to restart the application for these changes to have effect.") - wrapMode: Text.WordWrap - font.italic: true - } - - Item - { - //: Spacer - height: UM.Theme.getSize("default_margin").height - width: UM.Theme.getSize("default_margin").width - } - UM.TooltipArea { width: childrenRect.width; @@ -337,6 +320,16 @@ UM.PreferencesPage } } + UM.Label + { + id: languageCaption + + //: Language change warning + text: catalog.i18nc("@label", "*You will need to restart the application for these changes to have effect.") + wrapMode: Text.WordWrap + font.italic: true + } + Item { //: Spacer From 104a34d05ad5bc2a6a5e4f95e2e7ad0af55f5d36 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 21 Feb 2022 10:46:39 +0100 Subject: [PATCH 266/377] Vertically center aligns "Material", "PrintCore" and dropdowns in extruder configuration menu. CURA-8688 --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 8a637f3870..f3cef1a819 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -278,6 +278,7 @@ Item width: selectors.controlWidth height: parent.height + anchors.verticalCenter: parent.verticalCenter focusPolicy: Qt.ClickFocus @@ -289,6 +290,7 @@ Item } onClicked: materialsMenu.popup() } + Item { width: instructionButton.width + 2 * UM.Theme.getSize("narrow_margin").width @@ -331,6 +333,7 @@ Item tooltip: text height: parent.height width: selectors.controlWidth + anchors.verticalCenter: parent.verticalCenter focusPolicy: Qt.ClickFocus enabled: enabledCheckbox.checked From b2494f4d2e01c1cc5ad9923e82eb2a1a21708e49 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 11:07:47 +0100 Subject: [PATCH 267/377] Change the moreInfo button for slice statistics CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 1dd988706c..fb76adb683 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -840,15 +840,17 @@ UM.PreferencesPage onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked) } - Cura.SecondaryButton + + UM.SimpleButton { - id: showMoreInfo - anchors.top: sendDataCheckbox.bottom - text: catalog.i18nc("@action:button", "More information") - onClicked: - { - CuraApplication.showMoreInformationDialogForAnonymousDataCollection(); - } + onClicked: CuraApplication.showMoreInformationDialogForAnonymousDataCollection() + iconSource: UM.Theme.getIcon("Information") + anchors.left: sendDataCheckbox.right + anchors.verticalCenter: sendDataCheckbox.verticalCenter + hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover") + backgroundRadius: width / 2 + height: UM.Theme.getSize("small_button_icon").height + width: height } } From 1343d7bdf919790fa9ea62aec6cb7d18971c5676 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 11:15:30 +0100 Subject: [PATCH 268/377] Change font of camera rendering label CURA-8949 --- resources/qml/Preferences/GeneralPage.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index fb76adb683..d6c1861dde 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -537,7 +537,6 @@ UM.PreferencesPage UM.Label { text: catalog.i18nc("@window:text", "Camera rendering:") - font: UM.Theme.getFont("medium_bold") } ListModel { From 26434f3db9723b3c5c225b1c3e8dea3b9e5dfa79 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 21 Feb 2022 11:19:14 +0100 Subject: [PATCH 269/377] SettingPickDialog was very wide due to the screen factor scaling being removed. This gives it a fixed width the same as other dialogs. CURA-8688 --- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index b14e9f3082..0eb75676eb 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -13,6 +13,7 @@ UM.Dialog id: settingPickDialog title: catalog.i18nc("@title:window", "Select Settings to Customize for this model") + width: UM.Theme.getSize("small_popup_dialog").width property var additional_excluded_settings From beae4f28f744c633cadcfa697e31ccf9a530215e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 11:58:21 +0100 Subject: [PATCH 270/377] Change default sizes of menu CURA-8928 --- resources/qml/Widgets/Menu.qml | 2 +- resources/qml/Widgets/MenuItem.qml | 3 ++- resources/themes/cura-light/theme.json | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/qml/Widgets/Menu.qml b/resources/qml/Widgets/Menu.qml index 1a6aeff602..45af36d3fb 100644 --- a/resources/qml/Widgets/Menu.qml +++ b/resources/qml/Widgets/Menu.qml @@ -14,7 +14,7 @@ UM.Menu id: menu padding: 0 - implicitWidth: UM.Theme.getSize("setting_control").width + implicitWidth: UM.Theme.getSize("menu").width delegate: Cura.MenuItem {} background: Rectangle diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index f072c029ce..755f0717e2 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -13,7 +13,8 @@ UM.MenuItem { id: menuItem - implicitHeight: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("narrow_margin").height + implicitHeight: UM.Theme.getSize("menu").height + UM.Theme.getSize("narrow_margin").height + implicitWidth: UM.Theme.getSize("menu").width opacity: enabled ? 1.0 : 0.5 arrow: UM.RecolorImage diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 293c5edf9e..d79a69dc9f 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -184,10 +184,12 @@ "primary_hover": [48, 182, 231, 255], "primary_text": [255, 255, 255, 255], "border": [127, 127, 127, 255], - "text_selection": [156,195, 255, 127], + "text_selection": [156, 195, 255, 127], "secondary": [240, 240, 240, 255], "secondary_shadow": [216, 216, 216, 255], + "text_lighter": [108, 108, 108, 255], + "icon": [8, 7, 63, 255], "primary_button": [25, 110, 240, 255], @@ -639,6 +641,7 @@ "message_action_button": [0, 2.5], "message_image": [15.0, 10.0], "message_type_icon": [2, 2], + "menu": [18, 2], "infill_button_margin": [0.5, 0.5], From 390d12495e61718059871a81a3c7f61ce5aae48b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 13:08:53 +0100 Subject: [PATCH 271/377] Update highlight color of menu CURA-8928 --- resources/qml/Widgets/MenuItem.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index 755f0717e2..aacc5354cd 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -49,7 +49,6 @@ UM.MenuItem width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height - color: menuItem.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: menuItem.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" + color: menuItem.highlighted ? UM.Theme.getColor("secondary"): UM.Theme.getColor("setting_control_highlight") } } \ No newline at end of file From 58d04420ed70b975296cab55a2caf18a1f60ca28 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 13:13:27 +0100 Subject: [PATCH 272/377] Ensure that edit & help menu have the right styling They were still using the default Qt Menu instead of Cura.Menu CURA-8928 --- resources/qml/Menus/EditMenu.qml | 6 +++--- resources/qml/Menus/HelpMenu.qml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/Menus/EditMenu.qml b/resources/qml/Menus/EditMenu.qml index c2ec9903f2..522c6b27d1 100644 --- a/resources/qml/Menus/EditMenu.qml +++ b/resources/qml/Menus/EditMenu.qml @@ -7,13 +7,13 @@ import QtQuick.Controls 2.1 import UM 1.6 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit") Cura.MenuItem { action: Cura.Actions.undo } Cura.MenuItem { action: Cura.Actions.redo } - MenuSeparator { } + Cura.MenuSeparator { } Cura.MenuItem { action: Cura.Actions.selectAll } Cura.MenuItem { action: Cura.Actions.arrangeAll } Cura.MenuItem { action: Cura.Actions.multiplySelection } @@ -21,7 +21,7 @@ Menu Cura.MenuItem { action: Cura.Actions.deleteAll } Cura.MenuItem { action: Cura.Actions.resetAllTranslation } Cura.MenuItem { action: Cura.Actions.resetAll } - MenuSeparator { } + Cura.MenuSeparator { } Cura.MenuItem { action: Cura.Actions.groupObjects } Cura.MenuItem { action: Cura.Actions.mergeObjects } Cura.MenuItem { action: Cura.Actions.unGroupObjects } diff --git a/resources/qml/Menus/HelpMenu.qml b/resources/qml/Menus/HelpMenu.qml index e8a80eeced..4be25fdffe 100644 --- a/resources/qml/Menus/HelpMenu.qml +++ b/resources/qml/Menus/HelpMenu.qml @@ -8,7 +8,7 @@ import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: helpMenu title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") From c3745b42b65ae3464b35935c34b8fb7c1477252f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 13:15:09 +0100 Subject: [PATCH 273/377] Switch contextMenu to Cura.Menu This fixes all the styling issues that it still had CURA-8928 --- resources/qml/Menus/ContextMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 30e1d206f7..f25b3f70e5 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -8,7 +8,7 @@ import QtQuick.Window 2.1 import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: base From b79c77cb339893478c3f61aa93074386cb8f1cba Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 13:20:04 +0100 Subject: [PATCH 274/377] Add left & right padding for MenuSeperator CURA-8928 --- resources/qml/Widgets/MenuSeparator.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/Widgets/MenuSeparator.qml b/resources/qml/Widgets/MenuSeparator.qml index 04029844a2..ad79fccd6d 100644 --- a/resources/qml/Widgets/MenuSeparator.qml +++ b/resources/qml/Widgets/MenuSeparator.qml @@ -11,8 +11,10 @@ import UM 1.1 as UM // MenuSeparator { - padding: 0 - contentItem: Rectangle { + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width + contentItem: Rectangle + { implicitHeight: UM.Theme.getSize("default_lining").height color: UM.Theme.getColor("setting_control_border") } From b0d944f92dcaa003292e895357f5cfd398997000 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 13:21:51 +0100 Subject: [PATCH 275/377] Change all unstyled menuseperators to styled ones CURA-8928 --- resources/qml/Menus/FileMenu.qml | 6 +++--- resources/qml/Menus/PreferencesMenu.qml | 2 +- resources/qml/Menus/SettingsMenu.qml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/qml/Menus/FileMenu.qml b/resources/qml/Menus/FileMenu.qml index de5c4bfb90..338ada60fc 100644 --- a/resources/qml/Menus/FileMenu.qml +++ b/resources/qml/Menus/FileMenu.qml @@ -69,7 +69,7 @@ Cura.Menu enabled: UM.WorkspaceFileHandler.enabled } - MenuSeparator { } + Cura.MenuSeparator { } Cura.MenuItem { @@ -91,7 +91,7 @@ Cura.Menu onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"}) } - MenuSeparator { } + Cura.MenuSeparator { } Cura.MenuItem { @@ -99,7 +99,7 @@ Cura.Menu action: Cura.Actions.reloadAll } - MenuSeparator { } + Cura.MenuSeparator { } Cura.MenuItem { action: Cura.Actions.quit } } diff --git a/resources/qml/Menus/PreferencesMenu.qml b/resources/qml/Menus/PreferencesMenu.qml index fd0b5d82c1..3a6dd4b2ce 100644 --- a/resources/qml/Menus/PreferencesMenu.qml +++ b/resources/qml/Menus/PreferencesMenu.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.4 import UM 1.5 as UM import Cura 1.0 as Cura -Menu +Cura.Menu { id: preferencesMenu diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 6ee126890c..25bee871f5 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -39,7 +39,7 @@ Cura.Menu onAboutToHide: updateModels = false } - MenuSeparator + Cura.MenuSeparator { visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials } From 85926c6f7a962cdcda1de0af9039dea7282f1e3d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 13:25:00 +0100 Subject: [PATCH 276/377] Add padding to menu CURA-8928 --- resources/qml/Widgets/Menu.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Widgets/Menu.qml b/resources/qml/Widgets/Menu.qml index 45af36d3fb..0aa320df19 100644 --- a/resources/qml/Widgets/Menu.qml +++ b/resources/qml/Widgets/Menu.qml @@ -12,6 +12,8 @@ import Cura 1.0 as Cura UM.Menu { id: menu + topPadding: UM.Theme.getSize("narrow_margin").height + bottomPadding: UM.Theme.getSize("narrow_margin").height padding: 0 implicitWidth: UM.Theme.getSize("menu").width From 6e8c708f35bc7c0892504e92b59e5016b3015703 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 13:26:14 +0100 Subject: [PATCH 277/377] Change genericMaterials menu to customized menu CURA-8928 --- resources/qml/Menus/MaterialMenu.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index 0834d7b250..da5d6a071b 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -72,7 +72,7 @@ Cura.Menu Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0} - Menu + Cura.Menu { id: genericMenu title: catalog.i18nc("@label:category menu label", "Generic") From ba6c0438a1aed332a6c48d28f815840a005d670e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 15:27:27 +0100 Subject: [PATCH 278/377] Fix size of signed out account screen CURA-8940 --- resources/qml/Account/GeneralOperations.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Account/GeneralOperations.qml b/resources/qml/Account/GeneralOperations.qml index 5844864332..da62124f3f 100644 --- a/resources/qml/Account/GeneralOperations.qml +++ b/resources/qml/Account/GeneralOperations.qml @@ -16,7 +16,7 @@ Column { id: title anchors.horizontalCenter: parent.horizontalCenter - text: catalog.i18nc("@label", "Sign in to the Ultimaker platform") + text: catalog.i18nc("@label", "Sign in to the Ultimaker platform") font: UM.Theme.getFont("large_bold") } @@ -38,6 +38,7 @@ Column horizontalAlignment: Text.AlignLeft text: catalog.i18nc("@text", "- Add material profiles and plug-ins from the Marketplace\n- Back-up and sync your material profiles and plug-ins\n- Share ideas and get help from 48,000+ users in the Ultimaker community") lineHeight: 1.4 + wrapMode: Text.NoWrap } Cura.PrimaryButton From 163252765101323552a78f2e3b38d979b5f270bf Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 21 Feb 2022 15:40:08 +0100 Subject: [PATCH 279/377] Prevent crash when switching extruder in profiles page --- cura/Machines/Models/QualitySettingsModel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cura/Machines/Models/QualitySettingsModel.py b/cura/Machines/Models/QualitySettingsModel.py index bdae032f36..2051f1748d 100644 --- a/cura/Machines/Models/QualitySettingsModel.py +++ b/cura/Machines/Models/QualitySettingsModel.py @@ -178,7 +178,10 @@ class QualitySettingsModel(ListModel): label = f"{label}" # Make setting name italic if it's derived from the quality-changes profile. if isinstance(profile_value, SettingFunction): - profile_value_display = self._i18n_catalog.i18nc("@info:status", "Calculated") + if self._i18n_catalog: + profile_value_display = self._i18n_catalog.i18nc("@info:status", "Calculated") + else: + profile_value_display = "Calculated" else: profile_value_display = "" if profile_value is None else str(profile_value) From 30ca9ab46922fd5da6b1ccde299b0e93770d0c3e Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 21 Feb 2022 15:44:16 +0100 Subject: [PATCH 280/377] Update spinbox to new design. Add reusable UnderlineBackground Component for background of newly designed elements. CURA-8688 --- resources/qml/SpinBox.qml | 68 +++++++++++++++++++++++++- resources/themes/cura-light/theme.json | 4 ++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index d064da4f18..c3e6e4fd50 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -4,6 +4,8 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 +import UM 1.5 as UM + // This component extends the funtionality of QtControls 2.x Spinboxes to // - be able to contain fractional values // - hava a "prefix" and a "suffix". A validator is added that recognizes this pre-, suf-fix combo. When adding a custom @@ -33,11 +35,15 @@ Item signal editingFinished() implicitWidth: spinBox.implicitWidth implicitHeight: spinBox.implicitHeight + SpinBox { id: spinBox anchors.fill: base editable: base.editable + topPadding: 0 + bottomPadding: 0 + padding: UM.Theme.getSize("spinbox").height / 4 // The stepSize of the SpinBox is intentionally set to be always `1` // As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution @@ -65,11 +71,21 @@ Item base.value = value * base.stepSize; } + background: Item + { + // Makes space between buttons and textfield transparent + opacity: 0 + } + + + //TextField should be swapped with UM.TextField when it is restyled contentItem: TextField { text: spinBox.textFromValue(spinBox.value, spinBox.locale) + color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") + background: UM.UnderlineBackground {} + selectByMouse: base.editable - background: Item {} validator: base.validator onActiveFocusChanged: @@ -80,5 +96,55 @@ Item } } } + + down.indicator: Rectangle + { + x: spinBox.mirrored ? parent.width - width : 0 + height: parent.height + width: height + + UM.UnderlineBackground { + color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") + } + + // Minus icon + Rectangle + { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: parent.width / 4 + height: 2 + color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") + } + } + + up.indicator: Rectangle + { + x: spinBox.mirrored ? 0 : parent.width - width + height: parent.height + width: height + + UM.UnderlineBackground { + color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") + } + + // Plus Icon + Rectangle + { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: parent.width / 3.5 + height: 2 + color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") + } + Rectangle + { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 2 + height: parent.width / 3.5 + color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") + } + } } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f0b52242dd..1b23ae9307 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -184,6 +184,7 @@ "primary_hover": [48, 182, 231, 255], "primary_text": [255, 255, 255, 255], "border": [127, 127, 127, 255], + "border_field": [180, 180, 180, 255], "text_selection": [156,195, 255, 127], "secondary": [240, 240, 240, 255], "secondary_shadow": [216, 216, 216, 255], @@ -231,6 +232,7 @@ "window_disabled_background": [0, 0, 0, 255], "text": [25, 25, 25, 255], + "text_disabled": [180, 180, 180, 255], "text_detail": [174, 174, 174, 128], "text_link": [25, 110, 240, 255], "text_inactive": [174, 174, 174, 255], @@ -617,6 +619,8 @@ "checkbox_radius": [0.25, 0.25], "checkbox_label_padding": [0.5, 0.5], + "spinbox": [6.0, 3.0], + "tooltip": [20.0, 10.0], "tooltip_margins": [1.0, 1.0], "tooltip_arrow_margins": [2.0, 2.0], From 0b581c0e329861c2ac3546b12eaf34daa8137cd6 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 21 Feb 2022 16:18:44 +0100 Subject: [PATCH 281/377] Update buttons in firmware page. CURA-8688 --- .../FirmwareUpdater/FirmwareUpdaterMachineAction.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index 47387daa28..c2b80bf7cb 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -49,22 +49,22 @@ Cura.MachineAction width: childrenRect.width spacing: UM.Theme.getSize("default_margin").width property string firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName() - Button + Cura.SecondaryButton { id: autoUpgradeButton text: catalog.i18nc("@action:button", "Automatically upgrade Firmware") - enabled: parent.firmwareName != "" && canUpdateFirmware + //enabled: parent.firmwareName != "" && canUpdateFirmware onClicked: { updateProgressDialog.visible = true; activeOutputDevice.updateFirmware(parent.firmwareName); } } - Button + Cura.SecondaryButton { id: manualUpgradeButton text: catalog.i18nc("@action:button", "Upload custom Firmware") - enabled: canUpdateFirmware + //enabled: canUpdateFirmware onClicked: { customFirmwareDialog.open() @@ -173,7 +173,7 @@ Cura.MachineAction } rightButtons: [ - Button + Cura.SecondaryButton { text: catalog.i18nc("@action:button", "Close") enabled: manager.firmwareUpdater != null ? manager.firmwareUpdater.firmwareUpdateState != 1 : true From bc4222c34f7ee5fc8f9012f7bc46885accaae82f Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 22 Feb 2022 09:16:50 +0100 Subject: [PATCH 282/377] Remove comments CURA-8688 --- plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index c2b80bf7cb..c679c4328c 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -53,7 +53,7 @@ Cura.MachineAction { id: autoUpgradeButton text: catalog.i18nc("@action:button", "Automatically upgrade Firmware") - //enabled: parent.firmwareName != "" && canUpdateFirmware + enabled: parent.firmwareName != "" && canUpdateFirmware onClicked: { updateProgressDialog.visible = true; @@ -64,7 +64,7 @@ Cura.MachineAction { id: manualUpgradeButton text: catalog.i18nc("@action:button", "Upload custom Firmware") - //enabled: canUpdateFirmware + enabled: canUpdateFirmware onClicked: { customFirmwareDialog.open() From d40e91cc081751c60957b731a335fdda391d0abb Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 22 Feb 2022 10:37:13 +0100 Subject: [PATCH 283/377] Remove unneccesary opacity assignment. Change padding to styled width CURA-8688 --- resources/qml/SpinBox.qml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index c3e6e4fd50..b93a569e99 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -43,7 +43,7 @@ Item editable: base.editable topPadding: 0 bottomPadding: 0 - padding: UM.Theme.getSize("spinbox").height / 4 + padding: UM.Theme.getSize("narrow_margin").width // The stepSize of the SpinBox is intentionally set to be always `1` // As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution @@ -71,12 +71,7 @@ Item base.value = value * base.stepSize; } - background: Item - { - // Makes space between buttons and textfield transparent - opacity: 0 - } - + background: Item {} //TextField should be swapped with UM.TextField when it is restyled contentItem: TextField From 8cf9fe79416eb370f7362f2c59cbecf6793e644b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 10:55:22 +0100 Subject: [PATCH 284/377] Add noWrap to all labels in configurationMenu CURA-8941 --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index c9d0cd3e1b..6f7ee90733 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -207,6 +207,7 @@ Cura.ExpandablePopup text: model.material_name elide: Text.ElideRight width: parent.width + wrapMode: Text.NoWrap visible: !materialBrandNameLabel.visible && !truncated } @@ -217,6 +218,7 @@ Cura.ExpandablePopup text: model.material_type elide: Text.ElideRight width: parent.width + wrapMode: Text.NoWrap visible: !materialBrandNameLabel.visible && !materialNameLabel.visible } // Label that shows the name of the variant @@ -228,6 +230,7 @@ Cura.ExpandablePopup text: model.variant elide: Text.ElideRight + wrapMode: Text.NoWrap font: UM.Theme.getFont("default_bold") Layout.preferredWidth: parent.width } From a14c160d866b29b8456fcb1a9a095171075523f8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 11:28:33 +0100 Subject: [PATCH 285/377] Expose flickable direction for TableView CURA-8948 --- resources/qml/TableView.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 87f9fbdc05..0ceef11097 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -27,6 +27,7 @@ Item property bool allowSelection: true //Whether to allow the user to select items. property string sectionRole: "" + property alias flickableDirection: tableView.flickableDirection Row { id: headerBar From 25d2ed14dd2b2c0fcf9ea38f6f2d67aad1150dad Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 11:31:46 +0100 Subject: [PATCH 286/377] Ensure contentWidth is calculated correctly CURA-8948 --- resources/qml/TableView.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 0ceef11097..5e0b863f5a 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -129,6 +129,7 @@ Item } flickableDirection: Flickable.AutoFlickIfNeeded + contentWidth: -1 // AUto calculate the contendWidth clip: true ScrollBar.vertical: UM.ScrollBar {} columnWidthProvider: function(column) From 53331f4757e36c3dd86269efad8bf9710e143779 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 11:39:00 +0100 Subject: [PATCH 287/377] Remove unused imports --- .../Recommended/RecommendedAdhesionSelector.qml | 1 - .../PrintSetupSelector/Recommended/RecommendedPrintSetup.qml | 3 --- resources/qml/PrinterOutput/ExtruderBox.qml | 1 - resources/qml/ViewOrientationControls.qml | 2 -- 4 files changed, 7 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml index 08993b80a6..74c496f824 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index b91832cbbc..de8cce6e94 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 import UM 1.2 as UM import Cura 1.0 as Cura @@ -13,8 +12,6 @@ Item height: childrenRect.height + 2 * padding - property Action configureSettings - property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1 property real padding: UM.Theme.getSize("thick_margin").width diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index 7ccab941b8..b36faf262d 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 import UM 1.2 as UM diff --git a/resources/qml/ViewOrientationControls.qml b/resources/qml/ViewOrientationControls.qml index fc0f20fa77..ad3d184028 100644 --- a/resources/qml/ViewOrientationControls.qml +++ b/resources/qml/ViewOrientationControls.qml @@ -2,8 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 import UM 1.4 as UM import Cura 1.1 as Cura From 40a4d617cc5517f1b1ead01940ede740d836caf6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 11:40:23 +0100 Subject: [PATCH 288/377] Remove unused style --- resources/themes/cura-light/styles.qml | 28 -------------------------- 1 file changed, 28 deletions(-) diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 268d149546..45310c8589 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -9,34 +9,6 @@ import UM 1.1 as UM QtObject { - property Component scrollview: Component - { - ScrollViewStyle - { - decrementControl: Item { } - incrementControl: Item { } - - transientScrollBars: false - - scrollBarBackground: Rectangle - { - implicitWidth: UM.Theme.getSize("scrollbar").width - radius: Math.round(implicitWidth / 2) - color: UM.Theme.getColor("scrollbar_background") - } - - handle: Rectangle - { - id: scrollViewHandle - implicitWidth: UM.Theme.getSize("scrollbar").width - radius: Math.round(implicitWidth / 2) - - color: styleData.pressed ? UM.Theme.getColor("scrollbar_handle_down") : styleData.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle") - Behavior on color { ColorAnimation { duration: 50; } } - } - } - } - property Component partially_checkbox: Component { CheckBoxStyle From f347c6aedfe9d141e451bb74a72d7df1e9486476 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 11:42:41 +0100 Subject: [PATCH 289/377] Remove number of unused styles imports --- plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 1 - resources/qml/MonitorButton.qml | 1 - resources/qml/Preferences/Materials/MaterialsBrandSection.qml | 1 - resources/qml/Preferences/Materials/MaterialsTypeSection.qml | 1 - resources/qml/PrinterOutput/HeatedBedBox.qml | 1 - resources/qml/PrinterOutput/MonitorSection.qml | 1 - resources/qml/PrinterOutput/OutputDeviceHeader.qml | 1 - 7 files changed, 7 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 8bf39f6804..94016636db 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 -import QtQuick.Controls.Styles 1.2 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 54b9437a6c..71d6031d96 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 import UM 1.5 as UM diff --git a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml index 1e1ae088e8..7c853c8a05 100644 --- a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml index 0f438cf7e7..0a5d0e89e7 100644 --- a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 12e24024c2..82a8d8c6b7 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.2 as UM diff --git a/resources/qml/PrinterOutput/MonitorSection.qml b/resources/qml/PrinterOutput/MonitorSection.qml index 1d9df777b6..2758853216 100644 --- a/resources/qml/PrinterOutput/MonitorSection.qml +++ b/resources/qml/PrinterOutput/MonitorSection.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.2 as UM diff --git a/resources/qml/PrinterOutput/OutputDeviceHeader.qml b/resources/qml/PrinterOutput/OutputDeviceHeader.qml index cbb9461778..9ad946b6af 100644 --- a/resources/qml/PrinterOutput/OutputDeviceHeader.qml +++ b/resources/qml/PrinterOutput/OutputDeviceHeader.qml @@ -1,7 +1,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 import UM 1.2 as UM From 2c6ba3cd5d4da8489ba98771a0be338032325a0f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 11:58:14 +0100 Subject: [PATCH 290/377] Update some USB printing items to controls 2 --- plugins/USBPrinting/MonitorItem.qml | 1 - resources/qml/MonitorButton.qml | 40 +++++++++---------- resources/qml/PrinterOutput/MonitorItem.qml | 12 ++---- .../qml/PrinterOutput/MonitorSection.qml | 8 +--- 4 files changed, 25 insertions(+), 36 deletions(-) diff --git a/plugins/USBPrinting/MonitorItem.qml b/plugins/USBPrinting/MonitorItem.qml index c86353f814..3ca8140107 100644 --- a/plugins/USBPrinting/MonitorItem.qml +++ b/plugins/USBPrinting/MonitorItem.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.3 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 71d6031d96..6a64003185 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -2,15 +2,13 @@ //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 import UM 1.5 as UM import Cura 1.0 as Cura Item { - id: base; + id: base UM.I18nCatalog { id: catalog; name: "cura"} height: childrenRect.height + UM.Theme.getSize("thick_margin").height @@ -157,7 +155,7 @@ Item } } - Label + UM.Label { id: statusLabel width: parent.width - 2 * UM.Theme.getSize("thick_margin").width @@ -170,7 +168,7 @@ Item text: statusText } - Label + UM.Label { id: percentageLabel anchors.top: parent.top @@ -184,20 +182,20 @@ Item UM.ProgressBar { - id: progressBar; - minimumValue: 0; - maximumValue: 100; - value: 0; + id: progressBar + minimumValue: 0 + maximumValue: 100 + value: 0 //Doing this in an explicit binding since the implicit binding breaks on occasion. Binding { - target: progressBar; - property: "value"; - value: base.progress; + target: progressBar + property: "value" + value: base.progress } - visible: showProgress; + visible: showProgress indeterminate: { if(!printerConnected) @@ -217,15 +215,15 @@ Item return false; } } - property string backgroundColor: UM.Theme.getColor("progressbar_background"); - property string controlColor: base.statusColor; + property string backgroundColor: UM.Theme.getColor("progressbar_background") + property string controlColor: base.statusColor - width: parent.width - 2 * UM.Theme.getSize("thick_margin").width; - height: UM.Theme.getSize("progressbar").height; - anchors.top: statusLabel.bottom; - anchors.topMargin: Math.round(UM.Theme.getSize("thick_margin").height / 4); - anchors.left: parent.left; - anchors.leftMargin: UM.Theme.getSize("thick_margin").width; + width: parent.width - 2 * UM.Theme.getSize("thick_margin").width + height: UM.Theme.getSize("progressbar").height + anchors.top: statusLabel.bottom + anchors.topMargin: Math.round(UM.Theme.getSize("thick_margin").height / 4) + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("thick_margin").width } Row diff --git a/resources/qml/PrinterOutput/MonitorItem.qml b/resources/qml/PrinterOutput/MonitorItem.qml index a26ec20f64..4cf66630e9 100644 --- a/resources/qml/PrinterOutput/MonitorItem.qml +++ b/resources/qml/PrinterOutput/MonitorItem.qml @@ -2,18 +2,16 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item { property string label: "" property string value: "" - height: childrenRect.height; + height: childrenRect.height property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null @@ -24,22 +22,20 @@ Item anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - Label + UM.Label { width: Math.floor(parent.width * 0.4) anchors.verticalCenter: parent.verticalCenter text: label color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - font: UM.Theme.getFont("default") elide: Text.ElideRight } - Label + UM.Label { width: Math.floor(parent.width * 0.6) anchors.verticalCenter: parent.verticalCenter text: value color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - font: UM.Theme.getFont("default") elide: Text.ElideRight } } diff --git a/resources/qml/PrinterOutput/MonitorSection.qml b/resources/qml/PrinterOutput/MonitorSection.qml index 2758853216..219be45d06 100644 --- a/resources/qml/PrinterOutput/MonitorSection.qml +++ b/resources/qml/PrinterOutput/MonitorSection.qml @@ -2,10 +2,8 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -20,14 +18,12 @@ Item width: base.width height: UM.Theme.getSize("section").height - Label + UM.Label { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width text: label - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("setting_category_text") } } } From 4e880709a7fe4fc19599fe2b31a7e687459f4b8b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 12:03:53 +0100 Subject: [PATCH 291/377] Remove styles.qml We no longer need / have styles due to upgrade to qt 6.2 --- resources/themes/cura-light/styles.qml | 61 -------------------------- 1 file changed, 61 deletions(-) delete mode 100755 resources/themes/cura-light/styles.qml diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml deleted file mode 100755 index 45310c8589..0000000000 --- a/resources/themes/cura-light/styles.qml +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2022 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 - -import UM 1.1 as UM - -QtObject -{ - property Component partially_checkbox: Component - { - CheckBoxStyle - { - background: Item { } - indicator: Rectangle - { - implicitWidth: UM.Theme.getSize("checkbox").width - implicitHeight: UM.Theme.getSize("checkbox").height - - color: (control.hovered || control._hovered) ? UM.Theme.getColor("checkbox_hover") : UM.Theme.getColor("checkbox"); - Behavior on color { ColorAnimation { duration: 50; } } - - radius: control.exclusiveGroup ? Math.round(UM.Theme.getSize("checkbox").width / 2) : UM.Theme.getSize("checkbox_radius").width - - border.width: UM.Theme.getSize("default_lining").width; - border.color: (control.hovered || control._hovered) ? UM.Theme.getColor("checkbox_border_hover") : UM.Theme.getColor("checkbox_border"); - - 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.height: width - color: UM.Theme.getColor("checkbox_mark") - source: - { - if (control.checkbox_state == 2) - { - return UM.Theme.getIcon("Solid"); - } - else - { - return control.exclusiveGroup ? UM.Theme.getIcon("Dot", "low") : UM.Theme.getIcon("Check"); - } - } - opacity: control.checked - Behavior on opacity { NumberAnimation { duration: 100; } } - } - } - label: Label - { - text: control.text - color: UM.Theme.getColor("checkbox_text") - font: UM.Theme.getFont("default") - } - } - } -} From 5d28994b8723809e4cf19af86f4972886cd6acb4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 22 Feb 2022 14:47:27 +0100 Subject: [PATCH 292/377] Use cura styled combobox --- resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 18517d5e96..f6124147a2 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -89,10 +89,9 @@ UM.Dialog buttonSpacing: UM.Theme.getSize("thin_margin").width leftButtons: [ - ComboBox + Cura.ComboBox { id: discardOrKeepProfileChangesDropDownButton - width: 300 textRole: "text" model: ListModel From 9f75b870a77fface499ab4a2d8f90c8d99e9bde5 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 22 Feb 2022 16:18:01 +0100 Subject: [PATCH 293/377] Swap "+" and "-" made from Rectangle elements for icons. CURA-8688 --- resources/qml/SpinBox.qml | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index b93a569e99..4035515750 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -102,14 +102,13 @@ Item color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") } - // Minus icon - Rectangle + UM.RecolorImage { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 4 - height: 2 + anchors.centerIn: parent + height: parent.height / 2.5 + width: height color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") + source: UM.Theme.getIcon("Minus") } } @@ -123,22 +122,13 @@ Item color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") } - // Plus Icon - Rectangle + UM.RecolorImage { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 3.5 - height: 2 - color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") - } - Rectangle - { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 2 - height: parent.width / 3.5 + anchors.centerIn: parent + height: parent.height / 2.5 + width: height color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") + source: UM.Theme.getIcon("Plus") } } } From c3abfec535966921c4afd6723687040b4c1d9a2f Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 23 Feb 2022 12:00:11 +0100 Subject: [PATCH 294/377] Combobox height/width was being resized by RowLayout causing it to be squished. Assigned a implicit width/height which is used instead of height/width. CURA-8688 --- resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml | 6 ++++-- resources/themes/cura-light/theme.json | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 15540e1964..5c75993d39 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -91,10 +91,12 @@ UM.Dialog buttonSpacing: UM.Theme.getSize("thin_margin").width leftButtons: [ - ComboBox + Cura.ComboBox { + implicitHeight: UM.Theme.getSize("combobox_dialog").height + implicitWidth: UM.Theme.getSize("combobox_dialog").width + id: discardOrKeepProfileChangesDropDownButton - width: 300 textRole: "text" model: ListModel diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 1b23ae9307..2c23c0ed17 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -620,6 +620,7 @@ "checkbox_label_padding": [0.5, 0.5], "spinbox": [6.0, 3.0], + "combobox_dialog": [14, 2], "tooltip": [20.0, 10.0], "tooltip_margins": [1.0, 1.0], From e03176a1fac7caae88029ec1174258d8ab53821e Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 23 Feb 2022 14:09:38 +0100 Subject: [PATCH 295/377] Replace `UM.MessageDialog` with newly added `Cura.MessageDialog` This dialog is different from the `UM.MessageDialog` in that it CURA-8688 --- .../src/qml/components/BackupListItem.qml | 4 ++-- .../resources/qml/DiscoverUM3Action.qml | 2 +- .../resources/qml/MonitorContextMenu.qml | 6 +++--- resources/qml/Cura.qml | 6 +++--- resources/qml/Dialogs/MessageDialog.qml | 20 +++++++++++++++++++ resources/qml/MainWindow/ApplicationMenu.qml | 2 +- resources/qml/MonitorButton.qml | 2 +- .../Preferences/Materials/MaterialsPage.qml | 6 +++--- .../Preferences/Materials/MaterialsView.qml | 2 +- resources/qml/Preferences/ProfilesPage.qml | 4 ++-- 10 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 resources/qml/Dialogs/MessageDialog.qml diff --git a/plugins/CuraDrive/src/qml/components/BackupListItem.qml b/plugins/CuraDrive/src/qml/components/BackupListItem.qml index 41e3fb0bf6..a3b9770718 100644 --- a/plugins/CuraDrive/src/qml/components/BackupListItem.qml +++ b/plugins/CuraDrive/src/qml/components/BackupListItem.qml @@ -87,7 +87,7 @@ Item anchors.top: dataRow.bottom } - UM.MessageDialog + Cura.MessageDialog { id: confirmDeleteDialog title: catalog.i18nc("@dialog:title", "Delete Backup") @@ -96,7 +96,7 @@ Item onAccepted: CuraDrive.deleteBackup(modelData.backup_id) } - UM.MessageDialog + Cura.MessageDialog { id: confirmRestoreDialog title: catalog.i18nc("@dialog:title", "Restore Backup") diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 587ab61613..9c96fdca9e 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -256,7 +256,7 @@ Cura.MachineAction } } - UM.MessageDialog + Cura.MessageDialog { id: invalidIPAddressMessageDialog title: catalog.i18nc("@title:window", "Invalid IP address") diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml index d95ca8a88e..6fb0d38ea2 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml @@ -133,7 +133,7 @@ Item } } - UM.MessageDialog + Cura.MessageDialog { id: sendToTopConfirmationDialog onAccepted: OutputDevice.sendJobToTop(printJob.key) @@ -142,7 +142,7 @@ Item title: catalog.i18nc("@window:title", "Move print job to top") } - UM.MessageDialog + Cura.MessageDialog { id: deleteConfirmationDialog onAccepted: OutputDevice.deleteJobFromQueue(printJob.key) @@ -151,7 +151,7 @@ Item title: catalog.i18nc("@window:title", "Delete print job") } - UM.MessageDialog + Cura.MessageDialog { id: abortConfirmationDialog onAccepted: printJob.setState("abort") diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 67a3617033..70fae42162 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -585,7 +585,7 @@ UM.MainWindow } } - UM.MessageDialog + Cura.MessageDialog { id: exitConfirmationDialog title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName) @@ -743,14 +743,14 @@ UM.MainWindow } } - UM.MessageDialog + Cura.MessageDialog { id: packageInstallDialog title: catalog.i18nc("@window:title", "Install Package") standardButtons: StandardButton.Ok } - UM.MessageDialog + Cura.MessageDialog { id: infoMultipleFilesWithGcodeDialog title: catalog.i18nc("@title:window", "Open File(s)") diff --git a/resources/qml/Dialogs/MessageDialog.qml b/resources/qml/Dialogs/MessageDialog.qml new file mode 100644 index 0000000000..0735064548 --- /dev/null +++ b/resources/qml/Dialogs/MessageDialog.qml @@ -0,0 +1,20 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import UM 1.5 as UM +import Cura 1.5 as Cura + +// Wrapper around the UM.MessageBox with the primary/secondarybuttons +// set to Cura.PrimaryButton and Cura.SecondaryButton respectively +UM.MessageDialog +{ + primaryButton: Cura.PrimaryButton + { + text: model.text + } + + secondaryButton: Cura.TertiaryButton + { + text: model.text + } +} \ No newline at end of file diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 763f199902..4cbde8424d 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -55,7 +55,7 @@ Item onAccepted: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) } - UM.MessageDialog + Cura.MessageDialog { id: newProjectDialog diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 54b9437a6c..0f8c178767 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -322,7 +322,7 @@ Item onClicked: confirmationDialog.visible = true } - UM.MessageDialog + Cura.MessageDialog { id: confirmationDialog diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 2e4ded685d..c9e6cf07a1 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -310,7 +310,7 @@ Item } // Dialogs - UM.MessageDialog + Cura.MessageDialog { id: confirmRemoveMaterialDialog title: catalog.i18nc("@title:window", "Confirm Remove") @@ -337,7 +337,7 @@ Item { const result = Cura.ContainerManager.importMaterialContainer(fileUrl); - const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base); + const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base); messageDialog.standardButtons = Dialog.Ok; messageDialog.title = catalog.i18nc("@title:window", "Import Material"); switch (result.status) @@ -365,7 +365,7 @@ Item { const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl); - const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base); + const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base); messageDialog.title = catalog.i18nc("@title:window", "Export Material"); messageDialog.standardButtons = Dialog.Ok; switch (result.status) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index d71a6f398f..915d36ff57 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -119,7 +119,7 @@ Item width: base.width property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height - UM.MessageDialog + Cura.MessageDialog { id: confirmDiameterChangeDialog diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index f9d5d9c4b3..1ee86f9f0c 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -137,7 +137,7 @@ UM.ManagementPage base.toActivateNewQuality = false; } } - UM.MessageDialog + Cura.MessageDialog { id: messageDialog standardButtons: Dialog.Ok @@ -245,7 +245,7 @@ UM.ManagementPage } // Confirmation dialog for removing a profile - UM.MessageDialog + Cura.MessageDialog { id: confirmRemoveQualityDialog From 111c095f3231fb577d78a8691a649e14ea8e253e Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 23 Feb 2022 15:04:58 +0100 Subject: [PATCH 296/377] Swap RadioButton for styled Cura.RadioButton CURA-8688 --- resources/qml/Preferences/GeneralPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index d6c1861dde..a91a888a12 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -894,7 +894,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.") anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - RadioButton + Cura.RadioButton { id: checkUpdatesOptionStable text: catalog.i18nc("@option:radio", "Stable releases only") @@ -910,7 +910,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.") anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - RadioButton + Cura.RadioButton { id: checkUpdatesOptionBeta text: catalog.i18nc("@option:radio", "Stable and Beta releases") From b14e29d214d15c5bdaf0f04f6e45c9af0ad1dd99 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 23 Feb 2022 15:13:36 +0100 Subject: [PATCH 297/377] Make general menu combox wider CURA-8688 --- .../Dialogs/DiscardOrKeepProfileChangesDialog.qml | 4 ++-- resources/qml/Preferences/GeneralPage.qml | 12 ++++++------ resources/themes/cura-light/theme.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 5c75993d39..11aeac1722 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -93,8 +93,8 @@ UM.Dialog leftButtons: [ Cura.ComboBox { - implicitHeight: UM.Theme.getSize("combobox_dialog").height - implicitWidth: UM.Theme.getSize("combobox_dialog").width + implicitHeight: UM.Theme.getSize("combobox_wide").height + implicitWidth: UM.Theme.getSize("combobox_wide").width id: discardOrKeepProfileChangesDropDownButton textRole: "text" diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index a91a888a12..2b340a7ab5 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -554,8 +554,8 @@ UM.PreferencesPage model: comboBoxList textRole: "text" - width: UM.Theme.getSize("setting_control").width - height: UM.Theme.getSize("setting_control").height + width: UM.Theme.getSize("combobox_wide").width + height: UM.Theme.getSize("combobox_wide").height currentIndex: { @@ -711,8 +711,8 @@ UM.PreferencesPage Cura.ComboBox { id: choiceOnOpenProjectDropDownButton - width: UM.Theme.getSize("setting_control").width - height: UM.Theme.getSize("setting_control").height + width: UM.Theme.getSize("combobox_wide").width + height: UM.Theme.getSize("combobox_wide").height model: ListModel { @@ -779,8 +779,8 @@ UM.PreferencesPage Cura.ComboBox { id: choiceOnProfileOverrideDropDownButton - width: UM.Theme.getSize("setting_control").width - height: UM.Theme.getSize("setting_control").height + width: UM.Theme.getSize("combobox_wide").width + height: UM.Theme.getSize("combobox_wide").height model: ListModel { id: discardOrKeepProfileListModel diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 2c23c0ed17..3754a0fb64 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -620,7 +620,7 @@ "checkbox_label_padding": [0.5, 0.5], "spinbox": [6.0, 3.0], - "combobox_dialog": [14, 2], + "combobox_wide": [14, 2], "tooltip": [20.0, 10.0], "tooltip_margins": [1.0, 1.0], From 4510a8b06ed1a36b82389b59645e1ebb06417721 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 23 Feb 2022 15:15:46 +0100 Subject: [PATCH 298/377] Down spinbox button highlighting up spinbox button when clicked. CURA-8688 --- resources/qml/SpinBox.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index 4035515750..b5e93804b1 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -99,7 +99,7 @@ Item width: height UM.UnderlineBackground { - color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") + color: spinBox.down.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") } UM.RecolorImage From 7a2b609b321b5f37a84b4a7c991dd9a0aab58b8a Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 23 Feb 2022 15:28:38 +0100 Subject: [PATCH 299/377] Left Margin for Listview items was doubled. Remove margin to left align text with "Add a script" button. Swap default buttons for Cura.Primary/Cura.Secondary Buttons CURA-8688 --- plugins/PostProcessingPlugin/PostProcessingPlugin.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index 24dc141fef..17256eb9ea 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -68,7 +68,6 @@ UM.Dialog anchors { left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width right: parent.right rightMargin: base.textMargin } @@ -214,7 +213,7 @@ UM.Dialog } } } - Button + Cura.SecondaryButton { id: addButton text: catalog.i18nc("@action", "Add a script") @@ -453,7 +452,7 @@ UM.Dialog } } - rightButtons: Button + rightButtons: Cura.PrimaryButton { text: catalog.i18nc("@action:button", "Close") onClicked: dialog.accept() From 41e04f2e9df59bb1f7b7faf9c8977c9750f44b92 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 24 Feb 2022 11:34:48 +0100 Subject: [PATCH 300/377] Progress bar causing crash due to incorrect min max value variable names. Give buttons fixed leftMargin in monitor page so icons are center aligned. CURA-8980 --- resources/qml/MonitorButton.qml | 4 ++-- resources/qml/PrinterOutput/ManualPrinterControl.qml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 6a64003185..4876b01fb3 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -183,8 +183,8 @@ Item UM.ProgressBar { id: progressBar - minimumValue: 0 - maximumValue: 100 + from: 0 + to: 100 value: 0 //Doing this in an explicit binding since the implicit binding breaks on occasion. diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index 9024d177a0..d179ba6be4 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -98,6 +98,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleUp") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(0, distancesRow.currentDistance, 0) } @@ -109,6 +110,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleLeft") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(-distancesRow.currentDistance, 0, 0) } @@ -120,6 +122,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleRight") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(distancesRow.currentDistance, 0, 0) } @@ -131,6 +134,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleDown") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(0, -distancesRow.currentDistance, 0) } @@ -142,6 +146,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("House") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.homeHead() } @@ -166,6 +171,7 @@ Item iconSource: UM.Theme.getIcon("ChevronSingleUp") width: height height: _buttonSize + leftPadding: (width - iconSize) / 2 onClicked: printerModel.moveHead(0, 0, distancesRow.currentDistance) @@ -176,6 +182,7 @@ Item iconSource: UM.Theme.getIcon("House") width: height height: _buttonSize + leftPadding: (width - iconSize) / 2 onClicked: printerModel.homeBed() } @@ -185,6 +192,7 @@ Item iconSource: UM.Theme.getIcon("ChevronSingleDown") width: height height: _buttonSize + leftPadding: (width - iconSize) / 2 onClicked: printerModel.moveHead(0, 0, -distancesRow.currentDistance) } From 61beb963c2fb23becaa4057eb508b5174cf207ad Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 24 Feb 2022 14:58:07 +0100 Subject: [PATCH 301/377] Swap flat buttons for Cura Styled buttons. These "buttons" function like radiobuttons so a bit of extra styling needed to be added to swap appearance. Removed fixed width as it breaks centering with Cura buttons CURA-8980 --- resources/qml/PrinterOutput/ManualPrinterControl.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index d179ba6be4..bf987b282f 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -226,15 +226,15 @@ Item Repeater { model: distancesModel - delegate: Button + delegate: Cura.SecondaryButton { height: UM.Theme.getSize("setting_control").height - width: height + UM.Theme.getSize("default_margin").width text: model.label ButtonGroup.group: distanceGroup - checkable: true - checked: distancesRow.currentDistance == model.value + color: distancesRow.currentDistance == model.value ? UM.Theme.getColor("primary_button") : UM.Theme.getColor("secondary_button") + textColor: distancesRow.currentDistance == model.value ? UM.Theme.getColor("primary_button_text"): UM.Theme.getColor("secondary_button_text") + hoverColor: distancesRow.currentDistance == model.value ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("secondary_button_hover") onClicked: distancesRow.currentDistance = model.value } } From 6e59cd23bbbdd1505deab4b136bf00806805dd0a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 24 Feb 2022 15:32:39 +0100 Subject: [PATCH 302/377] Fix hide / show all in setting visibility page CURA-8978 --- resources/qml/Preferences/SettingVisibilityPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 0cc10be0f9..27c273d38e 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -72,7 +72,7 @@ UM.PreferencesPage anchors.fill: parent; onClicked: { - if(parent.checkedState == Qt.Unchecked || parent.checkedState == Qt.PartiallyChecked) + if(parent.checkState == Qt.Unchecked || parent.checkState == Qt.PartiallyChecked) { definitionsModel.setAllExpandedVisible(true) } From 301d68ebf2a77fa50f483170b0fa8191cc3b6a96 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:42:27 +0100 Subject: [PATCH 303/377] Update swatches on swatch color property changed CURA-8938 --- resources/qml/ColorDialog.qml | 10 +++++++--- .../qml/Preferences/Materials/MaterialsView.qml | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index f163211f53..afb7b324a3 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -27,11 +27,15 @@ UM.Dialog "#FFFFFF", "#D3D3D3", "#9E9E9E", "#5A5A5A", "#000000", ] - Component.onCompleted: + Component.onCompleted: updateSwatches() + onSwatchColorsChanged: updateSwatches() + + function updateSwatches() { - for (let i = 0; i < base.swatchColors.length; i ++) + swatchColorsModel.clear(); + for (const swatchColor of base.swatchColors) { - swatchColorsModel.append({ swatchColor: base.swatchColors[i] }); + swatchColorsModel.append({ swatchColor }); } } diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 6d153f5960..97f0ce4de1 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -222,7 +222,22 @@ Item id: colorDialog title: catalog.i18nc("@title", "Material color picker") color: properties.color_code - onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) +// swatchColors: ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"] + onAccepted: { + base.setMetaDataEntry("color_code", properties.color_code, color); + console.log("color_code"); + + const timer = Qt.createQmlObject("import QtQuick 2.0; Timer {}", base); + timer.interval = 10000; + timer.repeat = true; + timer.triggered.connect(function () { + console.log("updating colors"); + colorDialog.swatchColors = ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"]; + }) + + console.log("starting timers"); + timer.start(); + } } } From 9b06849955bc30b2ab552d06845fa6f8fa93d0f6 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:43:22 +0100 Subject: [PATCH 304/377] Let the content of the color dialog determine the size of the dialog CURA-8938 --- resources/qml/ColorDialog.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index afb7b324a3..1f83f0ceda 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -17,7 +17,14 @@ UM.Dialog property variant catalog: UM.I18nCatalog { name: "cura" } - margin: UM.Theme.getSize("wide_margin").width + // In this case we would like to let the content of the dialog determine the size of the dialog + // however with the current implementation of the dialog this is not possible, so instead we calculate + // the size of the dialog ourselves. + minimumWidth: content.width + 2 * margin + minimumHeight: + content.height // content height + + buttonRow.height // button row height + + 3 * margin // top and bottom margin and margin between buttons and content property alias color: colorInput.text property var swatchColors: [ From 7dbe5c0f7ccd18f09b21f1a3d1b96ed2c8fa15ba Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:44:46 +0100 Subject: [PATCH 305/377] Change some margins CURA-8938 --- resources/qml/ColorDialog.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 1f83f0ceda..09045581e4 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -17,6 +17,8 @@ UM.Dialog property variant catalog: UM.I18nCatalog { name: "cura" } + margin: UM.Theme.getSize("default_margin").width + // In this case we would like to let the content of the dialog determine the size of the dialog // however with the current implementation of the dialog this is not possible, so instead we calculate // the size of the dialog ourselves. @@ -128,7 +130,7 @@ UM.Dialog } } - buttonSpacing: UM.Theme.getSize("default_margin").width + buttonSpacing: UM.Theme.getSize("thin_margin").width rightButtons: [ From 2761aed4556e1292483f0acd9356d232456f977a Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:45:10 +0100 Subject: [PATCH 306/377] Make number of columns configurable in color dialog CURA-8938 --- resources/qml/ColorDialog.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 09045581e4..646d23c209 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -19,6 +19,8 @@ UM.Dialog margin: UM.Theme.getSize("default_margin").width + property alias swatchGridColumns: colorSwatchGrid.columns + // In this case we would like to let the content of the dialog determine the size of the dialog // however with the current implementation of the dialog this is not possible, so instead we calculate // the size of the dialog ourselves. @@ -56,6 +58,7 @@ UM.Dialog spacing: UM.Theme.getSize("wide_margin").height GridLayout { + id: colorSwatchGrid columns: 5 width: childrenRect.width height: childrenRect.height From 93a5c44e6c92dd0e2410036776d69672c02f496f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 24 Feb 2022 17:22:10 +0100 Subject: [PATCH 307/377] Fix codestyle CURA-8978 Co-authored-by: Casper Lamboo --- resources/qml/Preferences/SettingVisibilityPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 27c273d38e..5923fa4769 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -72,7 +72,7 @@ UM.PreferencesPage anchors.fill: parent; onClicked: { - if(parent.checkState == Qt.Unchecked || parent.checkState == Qt.PartiallyChecked) + if (parent.checkState == Qt.Unchecked || parent.checkState == Qt.PartiallyChecked) { definitionsModel.setAllExpandedVisible(true) } From 4a71278d7c0a8a04bbd2a9e9453d480d780c827e Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 25 Feb 2022 10:54:03 +0100 Subject: [PATCH 308/377] Fix monitor page CURA-8688 --- plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml index 6fb0d38ea2..03e9477d08 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml @@ -4,6 +4,7 @@ import QtQuick 2.3 import QtQuick.Controls 2.15 import UM 1.5 as UM +import Cura 1.6 as Cura /** * A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context From 2d4a389825accc83f1a6c88789e8e929972794de Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 25 Feb 2022 12:12:57 +0100 Subject: [PATCH 309/377] Fix dark mode issues for about dialog CURA-8688 --- resources/qml/Dialogs/AboutDialog.qml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index d08b9658db..8de28a72f0 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -19,6 +19,8 @@ UM.Dialog width: minimumWidth height: minimumHeight + backgroundColor: UM.Theme.getColor("main_background") + Rectangle { id: header @@ -50,7 +52,7 @@ UM.Dialog UM.I18nCatalog{id: catalog; name: "cura"} } - Label + UM.Label { id: version @@ -63,7 +65,7 @@ UM.Dialog } } - Label + UM.Label { id: description width: parent.width @@ -76,7 +78,7 @@ UM.Dialog anchors.topMargin: UM.Theme.getSize("default_margin").height } - Label + UM.Label { id: creditsNotes width: parent.width @@ -105,20 +107,20 @@ UM.Dialog delegate: Row { spacing: UM.Theme.getSize("narrow_margin").width - Label + UM.Label { text: "%2".arg(model.url).arg(model.name) width: (projectsList.width * 0.25) | 0 elide: Text.ElideRight onLinkActivated: Qt.openUrlExternally(link) } - Label + UM.Label { text: model.description elide: Text.ElideRight width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width } - Label + UM.Label { text: model.license elide: Text.ElideRight From 2327a71642d5aa357438460c2ab7ca10b7a9472e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 13:16:59 +0100 Subject: [PATCH 310/377] Remove monitor margin No idea why it was even there as it's own size. --- .../resources/qml/MonitorPrintJobProgressBar.qml | 4 ++-- resources/themes/cura-light/theme.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index 93c34cf603..b2d6c7c610 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -38,7 +38,7 @@ Item anchors { left: progressBar.right - leftMargin: UM.Theme.getSize("monitor_margin").width + leftMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter } text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" @@ -54,7 +54,7 @@ Item anchors { left: percentLabel.right - leftMargin: UM.Theme.getSize("monitor_margin").width + leftMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter } wrapMode: Text.NoWrap diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 0ea2a31774..22a624301a 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -669,7 +669,6 @@ "monitor_external_link_icon": [1.16, 1.16], "monitor_column": [18.0, 1.0], "monitor_progress_bar": [16.5, 1.0], - "monitor_margin": [1.5, 1.5], "table_row": [2.0, 2.0], From 9d202b9e61203e60baa5c94eb4eeac146c4f89ab Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 13:18:45 +0100 Subject: [PATCH 311/377] Remove unused monitor items from theme --- resources/themes/cura-light/theme.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 22a624301a..f21afc4210 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -656,14 +656,9 @@ "avatar_image": [6.8, 6.8], - "monitor_config_override_box": [1.0, 14.0], - "monitor_extruder_circle": [2.75, 2.75], "monitor_text_line": [1.5, 1.5], "monitor_text_line_large": [2.33, 2.33], - "monitor_thick_lining": [0.16, 0.16], - "monitor_corner_radius": [0.3, 0.3], "monitor_shadow_radius": [0.4, 0.4], - "monitor_shadow_offset": [0.15, 0.15], "monitor_empty_state_offset": [5.6, 5.6], "monitor_empty_state_size": [35.0, 25.0], "monitor_external_link_icon": [1.16, 1.16], From b3d3f5546c35db3e5aeede94b925201ec3938e28 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 13:19:59 +0100 Subject: [PATCH 312/377] Remove objectlist items from theme THey weren't used anyway, so time to clean up! --- resources/themes/cura-light/theme.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f21afc4210..45c7b69c68 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -643,14 +643,9 @@ "message_type_icon": [2, 2], "menu": [18, 2], - "infill_button_margin": [0.5, 0.5], - "jobspecs_line": [2.0, 2.0], "objects_menu_size": [15, 15], - "objects_menu_size_collapsed": [20, 17], - "build_plate_selection_size": [15, 5], - "objects_menu_button": [0.3, 2.7], "notification_icon": [1.5, 1.5], From 5f638ed6c630c322114aaac2a537cbe8c301b8b9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 13:22:55 +0100 Subject: [PATCH 313/377] Generalize the size of the licence window No need to have a seperate size of the licence window. Just use the default modal one --- plugins/Marketplace/resources/qml/LicenseDialog.qml | 4 ++-- resources/themes/cura-light/theme.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 1c99569793..09d7c5b59a 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -14,8 +14,8 @@ UM.Dialog { id: licenseDialog title: catalog.i18nc("@button", "Plugin license agreement") - minimumWidth: UM.Theme.getSize("license_window_minimum").width - minimumHeight: UM.Theme.getSize("license_window_minimum").height + minimumWidth: UM.Theme.getSize("modal_window_minimum").width + minimumHeight: UM.Theme.getSize("modal_window_minimum").height width: minimumWidth height: minimumHeight backgroundColor: UM.Theme.getColor("main_background") diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 45c7b69c68..15763e0711 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -632,7 +632,6 @@ "welcome_wizard_window": [46, 50], "modal_window_minimum": [60.0, 45], - "license_window_minimum": [45, 45], "wizard_progress": [10.0, 0.0], "message": [30.0, 5.0], From aba025b5b6e7837fe5c486c6ca1fc4d096b00f30 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 25 Feb 2022 13:32:02 +0100 Subject: [PATCH 314/377] Unify dialog background coloring. CURA-8988 --- resources/qml/Dialogs/AboutDialog.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index 8de28a72f0..e6d15af2d9 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -19,8 +19,6 @@ UM.Dialog width: minimumWidth height: minimumHeight - backgroundColor: UM.Theme.getColor("main_background") - Rectangle { id: header From ff0b64a56a870045a0592f9a64f7916865c34cf0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 13:33:32 +0100 Subject: [PATCH 315/377] Purge bunch of unused sizes from theme --- resources/themes/cura-dark/theme.json | 3 --- resources/themes/cura-light/theme.json | 24 ------------------------ 2 files changed, 27 deletions(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 2956e3f809..56638cc3ef 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -152,7 +152,6 @@ "checkbox_border": [255, 255, 255, 38], "checkbox_border_hover": [255, 255, 255, 38], "checkbox_mark": [255, 255, 255, 181], - "checkbox_square": [118, 118, 118, 255], "checkbox_text": [255, 255, 255, 181], "tooltip": [39, 44, 48, 255], @@ -160,8 +159,6 @@ "tool_panel_background": [39, 44, 48, 255], - "tool_button_border": [255, 255, 255, 38], - "viewport_background": [31, 36, 39, 255], "volume_outline": [12, 169, 227, 128], "buildplate": [169, 169, 169, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 15763e0711..e35b7c923f 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -277,8 +277,6 @@ "extruder_button_material_border": [255, 255, 255, 255], "extruder_disabled": [255, 255, 255, 102], - "rating_star": [90, 90, 90, 255], - "sync_button_text": [120, 120, 120, 255], "sync_button_text_hovered": [0, 0, 0, 255], @@ -356,7 +354,6 @@ "checkbox_border": [180, 180, 180, 255], "checkbox_border_hover": [25, 110, 240, 255], "checkbox_mark": [35, 35, 35, 255], - "checkbox_square": [180, 180, 180, 255], "checkbox_disabled": [223, 223, 223, 255], "checkbox_text": [0, 12, 26, 255], @@ -481,20 +478,16 @@ "sizes": { "window_minimum_size": [80, 48], - "large_popup_dialog": [48, 40], "popup_dialog": [40, 36], "small_popup_dialog": [36, 12], "main_window_header": [0.0, 4.0], - "main_window_header_button": [8, 2.35], - "main_window_header_button_icon": [1.2, 1.2], "stage_menu": [0.0, 4.0], "account_button": [12, 2.5], "print_setup_widget": [38.0, 30.0], - "print_setup_mode_toggle": [0.0, 2.0], "print_setup_extruder_box": [0.0, 6.0], "print_setup_slider_groove": [0.16, 0.16], "print_setup_slider_handle": [1.0, 1.0], @@ -509,7 +502,6 @@ "expandable_component_content_header": [0.0, 3.0], "configuration_selector": [35.0, 4.0], - "configuration_selector_mode_tabs": [1.0, 3.0], "action_panel_widget": [26.0, 0.0], "action_panel_information_widget": [20.0, 0.0], @@ -543,17 +535,12 @@ "section_control": [0, 1], "section_icon": [2, 2], "section_icon_column": [2.5, 2.5], - "rating_star": [1.0, 1.0], - "card": [25.0, 6.0], "setting": [25.0, 1.8], "setting_control": [11.0, 2.0], "setting_control_radius": [0.15, 0.15], "setting_control_depth_margin": [1.4, 0.0], - "setting_preferences_button_margin": [4, 0.0], - "setting_control_margin": [0.0, 0.0], "setting_unit_margin": [0.5, 0.5], - "setting_text_maxwidth": [40.0, 0.0], "standard_list_lineheight": [1.5, 1.5], "standard_arrow": [1.0, 1.0], @@ -564,13 +551,11 @@ "button": [4, 4], "button_icon": [2.5, 2.5], - "button_lining": [0, 0], "action_button": [15.0, 2.5], "action_button_icon": [1.5, 1.5], "action_button_icon_small": [1.0, 1.0], "action_button_radius": [0.15, 0.15], - "dialog_primary_button_padding": [3.0, 0], "radio_button": [1.3, 1.3], @@ -584,20 +569,15 @@ "favorites_button": [2, 2], "favorites_button_icon": [1.2, 1.2], - "icon_indicator_background": [1.5, 1.5], "icon_indicator": [1, 1], "printer_status_icon": [1.0, 1.0], - "printer_sync_icon": [1.2, 1.2], "button_tooltip": [1.0, 1.3], "button_tooltip_arrow": [0.25, 0.25], - "tool_button_border": [1.0, 0], - "progressbar": [26.0, 0.75], "progressbar_radius": [0.15, 0.15], - "progressbar_control": [8.0, 0.75], "scrollbar": [0.75, 0.5], @@ -613,19 +593,15 @@ "checkbox": [1.33, 1.33], "checkbox_mark": [1, 1], - "checkbox_square": [0.83, 0.83], "checkbox_radius": [0.25, 0.25], - "checkbox_label_padding": [0.5, 0.5], "tooltip": [20.0, 10.0], "tooltip_margins": [1.0, 1.0], "tooltip_arrow_margins": [2.0, 2.0], - "save_button_text_margin": [0.3, 0.6], "save_button_save_to_button": [0.3, 2.7], "save_button_specs_icons": [1.4, 1.4], - "job_specs_button": [2.7, 2.7], "first_run_shadow_radius": [1.2, 1.2], "monitor_preheat_temperature_control": [4.5, 2.0], From 1589475dd47bf802ae401d7dd344c502ec96a1b5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 13:54:50 +0100 Subject: [PATCH 316/377] Remove a slew of unusued colors in the theme --- .../themes/cura-dark-colorblind/theme.json | 4 -- resources/themes/cura-dark/theme.json | 30 -------- .../themes/cura-light-colorblind/theme.json | 1 - resources/themes/cura-light/theme.json | 71 ------------------- 4 files changed, 106 deletions(-) diff --git a/resources/themes/cura-dark-colorblind/theme.json b/resources/themes/cura-dark-colorblind/theme.json index c98fb0c815..4a006ee836 100644 --- a/resources/themes/cura-dark-colorblind/theme.json +++ b/resources/themes/cura-dark-colorblind/theme.json @@ -8,12 +8,8 @@ "x_axis": [212, 0, 0, 255], "y_axis": [64, 64, 255, 255], - "model_default": [156, 201, 36, 255], "model_overhang": [200, 0, 255, 255], - - "xray_error_dark": [255, 0, 0, 255], - "xray_error_light": [255, 255, 0, 255], "xray": [26, 26, 62, 255], "xray_error": [255, 0, 0, 255], diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 56638cc3ef..936accdccd 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -34,8 +34,6 @@ "account_sync_state_icon": [255, 255, 255, 204], - "machine_selector_bar": [39, 44, 48, 255], - "machine_selector_active": [39, 44, 48, 255], "machine_selector_printer_icon": [204, 204, 204, 255], "text": [255, 255, 255, 204], @@ -43,8 +41,6 @@ "text_link": [25, 110, 240, 255], "text_inactive": [255, 255, 255, 88], "text_hover": [255, 255, 255, 204], - "text_pressed": [255, 255, 255, 204], - "text_subtext": [255, 255, 255, 172], "text_scene": [255, 255, 255, 162], "text_scene_hover": [255, 255, 255, 204], @@ -55,22 +51,14 @@ "button": [39, 44, 48, 255], "button_hover": [39, 44, 48, 255], - "button_active": [67, 72, 75, 255], - "button_active_hover": [67, 72, 75, 255], "button_text": [255, 255, 255, 197], "button_disabled": [39, 44, 48, 255], "button_disabled_text": [255, 255, 255, 101], - "small_button": [39, 44, 48, 0], - "small_button_hover": [39, 44, 48, 255], - "small_button_active": [67, 72, 75, 255], - "small_button_active_hover": [67, 72, 75, 255], "small_button_text": [255, 255, 255, 197], "small_button_text_hover": [255, 255, 255, 255], "button_tooltip": [39, 44, 48, 255], - "button_tooltip_border": [39, 44, 48, 255], - "button_tooltip_text": [255, 255, 255, 172], "tab_checked": [39, 44, 48, 255], "tab_checked_border": [255, 255, 255, 30], @@ -87,17 +75,9 @@ "tab_background": [39, 44, 48, 255], "action_button": [39, 44, 48, 255], - "action_button_text": [255, 255, 255, 200], - "action_button_border": [255, 255, 255, 30], "action_button_hovered": [79, 85, 89, 255], - "action_button_hovered_text": [255, 255, 255, 255], - "action_button_hovered_border": [255, 255, 255, 30], - "action_button_active": [39, 44, 48, 30], - "action_button_active_text": [255, 255, 255, 255], - "action_button_active_border": [255, 255, 255, 100], "action_button_disabled": [85, 85, 87, 255], "action_button_disabled_text": [103, 103, 104, 255], - "action_button_disabled_border": [255, 255, 255, 30], "scrollbar_background": [39, 44, 48, 0], "scrollbar_handle": [255, 255, 255, 105], @@ -107,21 +87,11 @@ "setting_category": [75, 80, 83, 255], "setting_category_disabled": [75, 80, 83, 255], "setting_category_hover": [75, 80, 83, 255], - "setting_category_active": [75, 80, 83, 255], - "setting_category_active_hover": [75, 80, 83, 255], "setting_category_text": [255, 255, 255, 152], "setting_category_disabled_text": [255, 255, 255, 101], - "setting_category_hover_text": [255, 255, 255, 204], "setting_category_active_text": [255, 255, 255, 204], - "setting_category_active_hover_text": [255, 255, 255, 204], - "setting_category_border": [39, 44, 48, 0], - "setting_category_disabled_border": [39, 44, 48, 0], - "setting_category_hover_border": [12, 169, 227, 255], - "setting_category_active_border": [39, 44, 48, 0], - "setting_category_active_hover_border": [12, 169, 227, 255], "setting_control": [43, 48, 52, 255], - "setting_control_selected": [34, 39, 42, 38], "setting_control_highlight": [43, 48, 52, 255], "setting_control_border": [255, 255, 255, 38], "setting_control_border_highlight": [12, 169, 227, 255], diff --git a/resources/themes/cura-light-colorblind/theme.json b/resources/themes/cura-light-colorblind/theme.json index 5628fad880..740bf977b2 100644 --- a/resources/themes/cura-light-colorblind/theme.json +++ b/resources/themes/cura-light-colorblind/theme.json @@ -8,7 +8,6 @@ "x_axis": [200, 0, 0, 255], "y_axis": [64, 64, 255, 255], - "model_default": [156, 201, 36, 255], "model_overhang": [200, 0, 255, 255], "model_selection_outline": [12, 169, 227, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index e35b7c923f..2d846f20b8 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -171,7 +171,6 @@ }, "colors": { - "main_background": [255, 255, 255, 255], "detail_background": [243, 243, 243, 255], "wide_lining": [245, 245, 245, 255], @@ -180,20 +179,14 @@ "viewport_overlay": [246, 246, 246, 255], "primary": [25, 110, 240, 255], - "primary_shadow": [64, 47, 205, 255], "primary_hover": [48, 182, 231, 255], "primary_text": [255, 255, 255, 255], - "border": [127, 127, 127, 255], "text_selection": [156, 195, 255, 127], "secondary": [240, 240, 240, 255], - "secondary_shadow": [216, 216, 216, 255], - - "text_lighter": [108, 108, 108, 255], "icon": [8, 7, 63, 255], "primary_button": [25, 110, 240, 255], - "primary_button_shadow": [27, 95, 202, 255], "primary_button_hover": [16, 70, 156, 255], "primary_button_text": [255, 255, 255, 255], @@ -214,10 +207,6 @@ "account_widget_outline_active": [70, 66, 126, 255], "account_sync_state_icon": [25, 25, 25, 255], - "machine_selector_bar": [31, 36, 39, 255], - "machine_selector_active": [68, 72, 75, 255], - "machine_selector_hover": [68, 72, 75, 255], - "machine_selector_text_active": [255, 255, 255, 255], "machine_selector_printer_icon": [8, 7, 63, 255], "action_panel_secondary": [25, 110, 240, 255], @@ -236,10 +225,7 @@ "text_detail": [174, 174, 174, 128], "text_link": [25, 110, 240, 255], "text_inactive": [174, 174, 174, 255], - "text_pressed": [50, 130, 255, 255], - "text_subtext": [0, 0, 0, 255], "text_medium": [128, 128, 128, 255], - "text_emphasis": [255, 255, 255, 255], "text_scene": [102, 102, 102, 255], "text_scene_hover": [123, 123, 113, 255], @@ -252,48 +238,20 @@ "toolbar_button_active": [232, 242, 252, 255], "toolbar_button_active_hover": [232, 242, 252, 255], - "button": [31, 36, 39, 255], - "button_hover": [68, 72, 75, 255], - "button_active": [68, 72, 75, 255], - "button_active_hover": [68, 72, 75, 255], "button_text": [255, 255, 255, 255], - "button_text_hover": [255, 255, 255, 255], - "button_text_active": [255, 255, 255, 255], - "button_text_active_hover": [255, 255, 255, 255], - "small_button": [0, 0, 0, 0], - "small_button_hover": [102, 102, 102, 255], - "small_button_active": [10, 8, 80, 255], - "small_button_active_hover": [10, 8, 80, 255], "small_button_text": [102, 102, 102, 255], "small_button_text_hover": [8, 7, 63, 255], - "small_button_text_active": [255, 255, 255, 255], - "small_button_text_active_hover": [255, 255, 255, 255], "button_tooltip": [31, 36, 39, 255], - "button_tooltip_border": [68, 192, 255, 255], - "button_tooltip_text": [192, 193, 194, 255], - "extruder_button_material_border": [255, 255, 255, 255], "extruder_disabled": [255, 255, 255, 102], - "sync_button_text": [120, 120, 120, 255], - "sync_button_text_hovered": [0, 0, 0, 255], - "action_button": [255, 255, 255, 255], - "action_button_text": [0, 0, 0, 255], - "action_button_border": [127, 127, 127, 255], "action_button_hovered": [232, 242, 252, 255], - "action_button_hovered_text": [31, 36, 39, 255], - "action_button_hovered_border": [50, 130, 255, 255], - "action_button_active": [255, 255, 255, 255], - "action_button_active_text": [0, 0, 0, 255], - "action_button_active_border": [50, 130, 255, 255], "action_button_disabled": [245, 245, 245, 255], "action_button_disabled_text": [196, 196, 196, 255], - "action_button_disabled_border": [196, 196, 196, 255], "action_button_shadow": [223, 223, 223, 255], - "action_button_disabled_shadow": [228, 228, 228, 255], "scrollbar_background": [255, 255, 255, 255], "scrollbar_handle": [10, 8, 80, 255], @@ -303,21 +261,11 @@ "setting_category": [240, 240, 240, 255], "setting_category_disabled": [255, 255, 255, 255], "setting_category_hover": [232, 242, 252, 255], - "setting_category_active": [240, 240, 240, 255], - "setting_category_active_hover": [232, 242, 252, 255], "setting_category_text": [35, 35, 35, 255], "setting_category_disabled_text": [24, 41, 77, 101], "setting_category_active_text": [35, 35, 35, 255], - "setting_category_active_hover_text": [35, 35, 35, 255], - "setting_category_hover_text": [35, 35, 35, 255], - "setting_category_border": [240, 240, 240, 255], - "setting_category_disabled_border": [240, 240, 240, 255], - "setting_category_hover_border": [50, 130, 255, 255], - "setting_category_active_border": [50, 130, 255, 255], - "setting_category_active_hover_border": [50, 130, 255, 255], "setting_control": [255, 255, 255, 255], - "setting_control_selected": [31, 36, 39, 255], "setting_control_highlight": [255, 255, 255, 255], "setting_control_border": [199, 199, 199, 255], "setting_control_border_highlight": [50, 130, 255, 255], @@ -333,7 +281,6 @@ "setting_validation_warning_background": [255, 145, 62, 255], "setting_validation_warning": [127, 127, 127, 255], "setting_validation_ok": [255, 255, 255, 255], - "setting_filter_field" : [153, 153, 153, 255], "material_compatibility_warning": [243, 166, 59, 255], @@ -377,7 +324,6 @@ "status_busy": [50, 130, 255, 255], "status_paused": [255, 140, 0, 255], "status_stopped": [236, 82, 80, 255], - "status_unknown": [127, 127, 127, 255], "disabled_axis": [127, 127, 127, 255], "x_axis": [218, 30, 40, 255], @@ -395,17 +341,13 @@ "disallowed_area": [0, 0, 0, 40], "error_area": [255, 0, 0, 127], - "model_default": [255, 201, 36, 255], "model_overhang": [255, 0, 0, 255], "model_unslicable": [122, 122, 122, 255], "model_unslicable_alt": [172, 172, 127, 255], "model_selection_outline": [50, 130, 255, 255], "model_non_printing": [122, 122, 122, 255], - "xray_error_dark": [255, 0, 0, 255], - "xray_error_light": [255, 255, 0, 255], "xray": [26, 26, 62, 255], - "xray_error": [255, 0, 0, 255], "layerview_ghost": [31, 31, 31, 95], "layerview_none": [255, 255, 255, 255], @@ -423,16 +365,7 @@ "layerview_nozzle": [224, 192, 16, 64], "layerview_starts": [255, 255, 255, 255], - "tab_status_connected": [50, 130, 255, 255], - "tab_status_disconnected": [200, 200, 200, 255], - - "printer_config_matched": [50, 130, 255, 255], - "printer_config_mismatch": [127, 127, 127, 255], - "favorites_header_bar": [245, 245, 245, 255], - "favorites_header_hover": [245, 245, 245, 255], - "favorites_header_text": [31, 36, 39, 255], - "favorites_header_text_hover": [31, 36, 39, 255], "favorites_row_selected": [196, 239, 255, 255], "monitor_printer_family_tag": [228, 228, 242, 255], @@ -453,10 +386,6 @@ "monitor_stage_background": [246, 246, 246, 255], "monitor_stage_background_fade": [246, 246, 246, 102], - "monitor_progress_bar_fill": [50, 130, 255, 255], - "monitor_progress_bar_deactive": [192, 193, 194, 255], - "monitor_progress_bar_empty": [245, 245, 245, 255], - "monitor_tooltip": [25, 25, 25, 255], "monitor_tooltip_text": [255, 255, 255, 255], "monitor_context_menu": [255, 255, 255, 255], From 3f4f7f0fcfd97b6a4a97e0f803dc17b6df40a078 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 14:12:25 +0100 Subject: [PATCH 317/377] Remove some extra unneeded theme stuff for monitor page --- .../resources/qml/CameraButton.qml | 2 +- .../resources/qml/MonitorPrinterCard.qml | 64 ++++--------------- resources/themes/cura-dark/theme.json | 4 -- resources/themes/cura-light/theme.json | 5 -- 4 files changed, 13 insertions(+), 62 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml index cfd9801b97..4458b48996 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml @@ -18,7 +18,7 @@ Button { anchors.fill: parent radius: 0.5 * width - color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled") + color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_card_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled") } UM.RecolorImage diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 3297b16beb..e3da51f966 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -63,7 +63,7 @@ Item leftMargin: 36 * screenScaleFactor // TODO: Theme! verticalCenter: parent.verticalCenter } - spacing: 18 * screenScaleFactor // TODO: Theme! + spacing: UM.Theme.getSize("default_margin").width Rectangle { @@ -95,9 +95,9 @@ Item { id: printerNameLabel color: printer ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading") - height: 18 * screenScaleFactor // TODO: Theme! + height: UM.Theme.getSize("default_margin").width width: parent.width - radius: 2 * screenScaleFactor // TODO: Theme! + radius: UM.Theme.getSize("default_radius").width UM.Label { @@ -106,8 +106,6 @@ Item font: UM.Theme.getFont("large") // 16pt, bold width: parent.width visible: printer - - // FIXED-LINE-HEIGHT: height: parent.height } } @@ -116,7 +114,7 @@ Item { color: UM.Theme.getColor("monitor_skeleton_loading") height: 18 * screenScaleFactor // TODO: Theme! - radius: 2 * screenScaleFactor // TODO: Theme! + radius: UM.Theme.getSize("default_radius").width visible: !printer width: 48 * screenScaleFactor // TODO: Theme! } @@ -160,22 +158,16 @@ Item } color: UM.Theme.getColor("text_link") source: UM.Theme.getIcon("LinkExternal") - width: 12 * screenScaleFactor - height: 12 * screenScaleFactor + width: UM.Theme.getSize("icon").width + height: UM.Theme.getSize("icon").height } } MouseArea { anchors.fill: managePrinterLink onClicked: OutputDevice.openPrinterControlPanel() - onEntered: - { - manageQueueText.font.underline = true - } - onExited: - { - manageQueueText.font.underline = false - } + onEntered: manageQueueText.font.underline = true + onExited: manageQueueText.font.underline = false } } @@ -327,7 +319,7 @@ Item leftMargin: 36 * screenScaleFactor // TODO: Theme! } height: childrenRect.height - spacing: 18 * screenScaleFactor // TODO: Theme! + spacing: UM.Theme.getSize("default_margin").width UM.Label { @@ -403,9 +395,6 @@ Item font: UM.Theme.getFont("large") // 16pt, bold text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled") width: parent.width - - // FIXED-LINE-HEIGHT: - height: 18 * screenScaleFactor // TODO: Theme! } UM.Label @@ -421,9 +410,6 @@ Item elide: Text.ElideRight text: printer && printer.activePrintJob ? printer.activePrintJob.owner : catalog.i18nc("@label", "Anonymous") width: parent.width - - // FIXED-LINE-HEIGHT: - height: 18 * screenScaleFactor // TODO: Theme! } } @@ -445,45 +431,19 @@ Item } text: catalog.i18nc("@label:status", "Requires configuration changes") visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible - - // FIXED-LINE-HEIGHT: - height: 18 * screenScaleFactor // TODO: Theme! } } - Button + Cura.SecondaryButton { id: detailsButton anchors { verticalCenter: parent.verticalCenter right: parent.right - rightMargin: 18 * screenScaleFactor // TODO: Theme! + rightMargin: UM.Theme.getSize("default_margin").width } - background: Rectangle - { - color: UM.Theme.getColor("monitor_secondary_button_shadow") - radius: 2 * screenScaleFactor // Todo: Theme! - Rectangle - { - anchors.fill: parent - anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme! - color: detailsButton.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : UM.Theme.getColor("monitor_secondary_button") - radius: 2 * screenScaleFactor // Todo: Theme! - } - } - contentItem: UM.Label - { - anchors.fill: parent - anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme! - color: UM.Theme.getColor("monitor_secondary_button_text") - font: UM.Theme.getFont("medium") // 14pt, regular - text: catalog.i18nc("@action:button", "Details"); - horizontalAlignment: Text.AlignHCenter - height: 18 * screenScaleFactor // TODO: Theme! - } - implicitHeight: 32 * screenScaleFactor // TODO: Theme! - implicitWidth: 96 * screenScaleFactor // TODO: Theme! + text: catalog.i18nc("@action:button", "Details") visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible onClicked: base.enabled ? overrideConfirmationDialog.open() : {} enabled: OutputDevice.supportsPrintJobActions diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 936accdccd..dd31a5aafa 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -149,10 +149,6 @@ "monitor_icon_disabled": [102, 102, 102, 255], "monitor_secondary_button_hover": [80, 80, 80, 255], - "monitor_secondary_button": [92, 92, 92, 255], - "monitor_secondary_button_text": [250, 250, 250, 255], - "monitor_secondary_button_shadow": [74, 74, 74, 255], - "monitor_card_border": [102, 102, 102, 255], "monitor_card_background": [51, 53, 54, 255], "monitor_card_hover": [84, 89, 95, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 2d846f20b8..db88296b61 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -374,11 +374,6 @@ "monitor_icon_accent": [255, 255, 255, 255], "monitor_icon_disabled": [238, 238, 238, 255], - "monitor_secondary_button_hover": [232, 242, 252, 255], - "monitor_secondary_button": [240, 240, 240, 255], - "monitor_secondary_button_text": [30, 102, 215, 255], - "monitor_secondary_button_shadow": [216, 216, 216, 255], - "monitor_card_border": [192, 193, 194, 255], "monitor_card_background": [255, 255, 255, 255], "monitor_card_hover": [232, 242, 252, 255], From 75ec6f508ca7a7133a12a158f2d720479aa8ad46 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 14:27:47 +0100 Subject: [PATCH 318/377] Remove unneeded fixed line hight properties No idea why this was even done, but there just isnt' a reason to use these. --- plugins/MonitorStage/MonitorMain.qml | 15 +++------------ .../resources/qml/MonitorPrintJobProgressBar.qml | 9 +-------- resources/themes/cura-light/theme.json | 2 -- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index cfd33a70fe..ab98fa5f7c 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -3,7 +3,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.0 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura // We show a nice overlay on the 3D viewer when the current output device has no monitor view @@ -90,7 +90,7 @@ Rectangle visible: monitorViewComponent.sourceComponent == null // CASE 2: CAN MONITOR & NOT CONNECTED - Label + UM.Label { anchors { @@ -99,14 +99,10 @@ Rectangle visible: isNetworkConfigured && !isConnected text: catalog.i18nc("@info", "Please make sure your printer has a connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.\n- Check if you are signed in to discover cloud-connected printers.") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - wrapMode: Text.WordWrap - lineHeight: UM.Theme.getSize("monitor_text_line_large").height - lineHeightMode: Text.FixedHeight width: contentWidth } - Label + UM.Label { id: noNetworkLabel anchors @@ -116,11 +112,7 @@ Rectangle visible: !isNetworkConfigured && isNetworkConfigurable text: catalog.i18nc("@info", "Please connect your printer to the network.") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - wrapMode: Text.WordWrap width: contentWidth - lineHeight: UM.Theme.getSize("monitor_text_line_large").height - lineHeightMode: Text.FixedHeight } Item { @@ -129,7 +121,6 @@ Rectangle left: noNetworkLabel.left } visible: !isNetworkConfigured && isNetworkConfigurable - height: UM.Theme.getSize("monitor_text_line").height width: childrenRect.width UM.RecolorImage diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index b2d6c7c610..65c37ffe16 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -18,7 +18,7 @@ Item property var printJob: null width: childrenRect.width - height: UM.Theme.getSize("monitor_text_line").height + height: percentLabel.height UM.ProgressBar { @@ -39,14 +39,11 @@ Item { left: progressBar.right leftMargin: UM.Theme.getSize("default_margin").width - verticalCenter: parent.verticalCenter } text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" color: printJob && printJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") width: contentWidth wrapMode: Text.NoWrap - // FIXED-LINE-HEIGHT: - height: UM.Theme.getSize("monitor_text_line").height } UM.Label { @@ -55,7 +52,6 @@ Item { left: percentLabel.right leftMargin: UM.Theme.getSize("default_margin").width - verticalCenter: parent.verticalCenter } wrapMode: Text.NoWrap text: @@ -111,8 +107,5 @@ Item } } width: contentWidth - - // FIXED-LINE-HEIGHT: - height: UM.Theme.getSize("monitor_text_line").height } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index db88296b61..35b468551d 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -550,8 +550,6 @@ "avatar_image": [6.8, 6.8], - "monitor_text_line": [1.5, 1.5], - "monitor_text_line_large": [2.33, 2.33], "monitor_shadow_radius": [0.4, 0.4], "monitor_empty_state_offset": [5.6, 5.6], "monitor_empty_state_size": [35.0, 25.0], From c356d37e06a3a580d6e679955221530e174e3dda Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 25 Feb 2022 14:32:34 +0100 Subject: [PATCH 319/377] Remove monitor_icon_size from theme --- plugins/MonitorStage/MonitorMain.qml | 4 ++-- resources/themes/cura-light/theme.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index ab98fa5f7c..aa717ce95c 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -129,8 +129,8 @@ Rectangle anchors.verticalCenter: parent.verticalCenter color: UM.Theme.getColor("text_link") source: UM.Theme.getIcon("LinkExternal") - width: UM.Theme.getSize("monitor_external_link_icon").width - height: UM.Theme.getSize("monitor_external_link_icon").height + width: UM.Theme.getSize("icon_indicator").width + height: UM.Theme.getSize("icon_indicator").height } Label { diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 35b468551d..1072427559 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -553,7 +553,6 @@ "monitor_shadow_radius": [0.4, 0.4], "monitor_empty_state_offset": [5.6, 5.6], "monitor_empty_state_size": [35.0, 25.0], - "monitor_external_link_icon": [1.16, 1.16], "monitor_column": [18.0, 1.0], "monitor_progress_bar": [16.5, 1.0], From 7bbea625583b1824860f3cd09bca581d9c0481dd Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 25 Feb 2022 14:56:24 +0100 Subject: [PATCH 320/377] Add base_colors to theme If the value of a color is a string, there will be an attempt to fetch this color from base_colors. CURA-8688 --- resources/themes/cura-dark/theme.json | 24 +++++++++++++++++++++++- resources/themes/cura-light/theme.json | 25 +++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 296d4d7145..abf6e1bf2f 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -4,8 +4,30 @@ "inherits": "cura-light" }, + "base_colors": + { + "background_1": [212, 212, 212, 255], + "background_2": [57, 57, 58, 255], + "background_3": [85, 85, 87, 255], + "background_4": [23, 23, 23, 255], + + "accent_1": [25, 110, 240, 255], + "accent_2": [16, 70, 156, 255], + "border_main": [212, 212, 212, 255], + "border_accent_1": [255, 255, 255, 255], + "border_accent_2": [16, 70, 156, 255], + "border_field": [57, 57, 58, 255], + + "text_default": [255, 255, 255, 255], + "text_disabled": [118, 118, 118, 255], + "text_primary_button": [255, 255, 255, 255], + "text_secondary_button": [255, 255, 255, 255], + "text_link_hover": [156, 195, 255, 255], + "text_lighter": [243, 243, 243, 255] + }, + "colors": { - "main_background": [39, 44, 48, 255], + "main_background": "background_1", "detail_background": [63, 63, 63, 255], "message_background": [39, 44, 48, 255], "wide_lining": [31, 36, 39, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 3754a0fb64..a7cc206766 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -170,10 +170,31 @@ } }, + "base_colors": { + "background_1": [255, 255, 255, 255], + "background_2": [243, 243, 243, 255], + "background_3": [232, 240, 253, 255], + "background_4": [3, 12, 66, 255], + + "accent_1": [25, 110, 240, 255], + "accent_2": [16, 70, 156, 255], + "border_main": [212, 212, 212, 255], + "border_accent_1": [25, 110, 240, 255], + "border_accent_2": [16, 70, 156, 255], + "border_field": [180, 180, 180, 255], + + "text_default": [0, 14, 26, 255], + "text_disabled": [180, 180, 180, 255], + "text_primary_button": [255, 255, 255, 255], + "text_secondary_button": [25, 110, 240, 255], + "text_link_hover": [16, 70, 156, 255], + "text_lighter": [108, 108, 108, 255] + }, + "colors": { - "main_background": [255, 255, 255, 255], - "detail_background": [243, 243, 243, 255], + "main_background": "background_1", + "detail_background": "background_2", "wide_lining": [245, 245, 245, 255], "thick_lining": [180, 180, 180, 255], "lining": [192, 193, 194, 255], From 7ea0167486cb9d3b6569913d0396bff89ef01758 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 25 Feb 2022 15:54:51 +0100 Subject: [PATCH 321/377] Remove border highlight on hover over menu items, as per new designs CURA-8688 --- resources/qml/Widgets/MenuItem.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index 059a30e79c..10bc49bd36 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -47,6 +47,5 @@ UM.MenuItem height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height color: menuItem.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: menuItem.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" } } \ No newline at end of file From 17cab9946d4b6bd085f32ad848b4f535d91374ad Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 25 Feb 2022 18:18:43 +0100 Subject: [PATCH 322/377] Dark theming CURA-8688 --- resources/themes/cura-dark/theme.json | 74 +++++++++++++------------- resources/themes/cura-light/theme.json | 8 +-- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index abf6e1bf2f..bb1e8fe6a0 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -6,7 +6,7 @@ "base_colors": { - "background_1": [212, 212, 212, 255], + "background_1": [31, 31, 32, 255], "background_2": [57, 57, 58, 255], "background_3": [85, 85, 87, 255], "background_4": [23, 23, 23, 255], @@ -32,26 +32,28 @@ "message_background": [39, 44, 48, 255], "wide_lining": [31, 36, 39, 255], "thick_lining": [255, 255, 255, 60], - "lining": [64, 69, 72, 255], + "lining": "border_main", "viewport_overlay": [30, 36, 39, 255], "primary": [12, 169, 227, 255], - "primary_text": [255, 255, 255, 204], + "primary_text": "text_default", "secondary": [95, 95, 95, 255], - "secondary_button": [39, 44, 48, 255], - "secondary_button_hover": [85, 85, 87, 255], + "secondary_button": "background_1", + "secondary_button_hover": "background_3", "secondary_button_text": [255, 255, 255, 255], - "icon": [255, 255, 255, 255], - "toolbar_background": [39, 44, 48, 255], - "toolbar_button_active": [57, 57, 58, 255], - "toolbar_button_hover": [57, 57, 58, 255], - "toolbar_button_active_hover": [57, 57, 58, 255], + "icon": "text_default", + "toolbar_background": "background_1", + "toolbar_button_active": "background_3", + "toolbar_button_hover": "background_3", + "toolbar_button_active_hover": "background_3", - "main_window_header_button_text_inactive": [128, 128, 128, 255], - "main_window_header_background": [14, 14, 14, 255], - "main_window_header_background_gradient": [32, 32, 32, 255], + "main_window_header_button_background_inactive": "background_4", + "main_window_header_button_text_inactive": "text_primary_button", + "main_window_header_button_text_active": "background_4", + "main_window_header_background": "background_4", + "main_window_header_background_gradient": "background_4", "main_window_header_button_background_hovered": [46, 46, 46, 255], "account_sync_state_icon": [255, 255, 255, 204], @@ -60,9 +62,9 @@ "machine_selector_active": [39, 44, 48, 255], "machine_selector_printer_icon": [204, 204, 204, 255], - "text": [255, 255, 255, 204], + "text": "text_default", "text_detail": [255, 255, 255, 172], - "text_link": [25, 110, 240, 255], + "text_link": "accent_1", "text_inactive": [255, 255, 255, 88], "text_hover": [255, 255, 255, 204], "text_pressed": [255, 255, 255, 204], @@ -79,7 +81,7 @@ "button_hover": [39, 44, 48, 255], "button_active": [67, 72, 75, 255], "button_active_hover": [67, 72, 75, 255], - "button_text": [255, 255, 255, 197], + "button_text": "text_default", "button_disabled": [39, 44, 48, 255], "button_disabled_text": [255, 255, 255, 101], @@ -108,17 +110,17 @@ "tab_active_text": [255, 255, 255, 255], "tab_background": [39, 44, 48, 255], - "action_button": [39, 44, 48, 255], + "action_button": "background_1", "action_button_text": [255, 255, 255, 200], - "action_button_border": [255, 255, 255, 30], + "action_button_border": "border_main", "action_button_hovered": [79, 85, 89, 255], - "action_button_hovered_text": [255, 255, 255, 255], - "action_button_hovered_border": [255, 255, 255, 30], + "action_button_hovered_text": "text_default", + "action_button_hovered_border": "border_main", "action_button_active": [39, 44, 48, 30], - "action_button_active_text": [255, 255, 255, 255], + "action_button_active_text": "text_default", "action_button_active_border": [255, 255, 255, 100], - "action_button_disabled": [85, 85, 87, 255], - "action_button_disabled_text": [103, 103, 104, 255], + "action_button_disabled": "background_3", + "action_button_disabled_text": "text_disabled", "action_button_disabled_border": [255, 255, 255, 30], "scrollbar_background": [39, 44, 48, 0], @@ -142,12 +144,12 @@ "setting_category_active_border": [39, 44, 48, 0], "setting_category_active_hover_border": [12, 169, 227, 255], - "setting_control": [43, 48, 52, 255], + "setting_control": "background_2", "setting_control_selected": [34, 39, 42, 38], - "setting_control_highlight": [43, 48, 52, 255], + "setting_control_highlight": "background_2", "setting_control_border": [255, 255, 255, 38], "setting_control_border_highlight": [12, 169, 227, 255], - "setting_control_text": [255, 255, 255, 181], + "setting_control_text": "text_default", "setting_control_button": [255, 255, 255, 127], "setting_control_button_hover": [255, 255, 255, 204], "setting_control_disabled": [34, 39, 42, 255], @@ -158,7 +160,7 @@ "setting_validation_error": [212, 31, 53, 255], "setting_validation_warning_background": [62, 54, 46, 255], "setting_validation_warning": [245, 166, 35, 255], - "setting_validation_ok": [43, 48, 52, 255], + "setting_validation_ok": "background_2", "progressbar_background": [255, 255, 255, 48], "progressbar_control": [255, 255, 255, 197], @@ -169,24 +171,24 @@ "slider_handle": [255, 255, 255, 255], "slider_handle_active": [68, 192, 255, 255], - "checkbox": [43, 48, 52, 255], + "checkbox": "background_1", "checkbox_hover": [43, 48, 52, 255], - "checkbox_border": [255, 255, 255, 38], + "checkbox_border": "text_disabled", "checkbox_border_hover": [255, 255, 255, 38], - "checkbox_mark": [255, 255, 255, 181], - "checkbox_square": [118, 118, 118, 255], - "checkbox_text": [255, 255, 255, 181], + "checkbox_mark": "text_default", + "checkbox_square": "text_disabled", + "checkbox_text": "text_default", - "tooltip": [39, 44, 48, 255], - "tooltip_text": [255, 255, 255, 204], + "tooltip": "background_2", + "tooltip_text": "text_default", - "tool_panel_background": [39, 44, 48, 255], + "tool_panel_background": "background_1", "tool_button_border": [255, 255, 255, 38], "y_axis": [96, 96, 255, 255], - "viewport_background": [31, 36, 39, 255], + "viewport_background": "background_1", "volume_outline": [12, 169, 227, 128], "buildplate": [169, 169, 169, 255], "buildplate_grid_minor": [154, 154, 155, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index a7cc206766..e6215fb842 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -212,15 +212,15 @@ "icon": [8, 7, 63, 255], - "primary_button": [25, 110, 240, 255], + "primary_button": "accent_1", "primary_button_shadow": [27, 95, 202, 255], "primary_button_hover": [16, 70, 156, 255], "primary_button_text": [255, 255, 255, 255], - "secondary_button": [255, 255, 255, 255], + "secondary_button": "text_default", "secondary_button_shadow": [216, 216, 216, 255], "secondary_button_hover": [232, 240, 253, 255], - "secondary_button_text": [25, 110, 240, 255], + "secondary_button_text": "accent_1", "main_window_header_background": [8, 7, 63, 255], "main_window_header_background_gradient": [25, 23, 91, 255], @@ -240,7 +240,7 @@ "machine_selector_text_active": [255, 255, 255, 255], "machine_selector_printer_icon": [8, 7, 63, 255], - "action_panel_secondary": [25, 110, 240, 255], + "action_panel_secondary": "accent_1", "first_run_shadow": [50, 50, 50, 255], From b4edb89eb8635abcfdebba0ef54f9adea2034dce Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 28 Feb 2022 10:21:16 +0100 Subject: [PATCH 323/377] Align menubar colors with new designs. CURA-8688 --- resources/qml/Widgets/MenuItem.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index aacc5354cd..36098e1197 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -48,7 +48,6 @@ UM.MenuItem y: UM.Theme.getSize("default_lining").width width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height - - color: menuItem.highlighted ? UM.Theme.getColor("secondary"): UM.Theme.getColor("setting_control_highlight") + color: menuItem.highlighted ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1") } } \ No newline at end of file From 440d6fa5250bd763b1e5026ee7da23e2f043fe95 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 28 Feb 2022 11:20:31 +0100 Subject: [PATCH 324/377] Update style of TextFIeld and ComboxBox to match new designs. Remove borders and radius on corners. Update Prefereces title to be bold and centered with button Make prefereces pages selection buttons correct height. CURA-8688 --- resources/qml/Widgets/ComboBox.qml | 10 +--------- resources/qml/Widgets/TextField.qml | 27 ++++----------------------- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 6420f41823..121c5f15da 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -26,7 +26,6 @@ ComboBox { name: "disabled" when: !control.enabled - PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")} }, @@ -34,20 +33,13 @@ ComboBox { name: "highlighted" when: control.hovered || control.activeFocus - PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") } PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_highlight")} } ] - background: Rectangle + background: UM.UnderlineBackground { id: backgroundRectangle - color: UM.Theme.getColor("setting_control") - - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: UM.Theme.getColor("setting_control_border") - } indicator: UM.RecolorImage diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index b995c34f10..bace79a98a 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -17,6 +17,8 @@ TextField property alias leftIcon: iconLeft.source + height: UM.Theme.getSize("setting_control").height + hoverEnabled: true selectByMouse: true font: UM.Theme.getFont("default") @@ -29,45 +31,24 @@ TextField { name: "disabled" when: !textField.enabled - PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} }, State { name: "invalid" when: !textField.acceptableInput - PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_validation_error")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")} }, State { name: "hovered" when: textField.hovered || textField.activeFocus - PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") } } ] - background: Rectangle + background: UM.UnderlineBackground { id: backgroundRectangle - - color: UM.Theme.getColor("main_background") - - radius: UM.Theme.getSize("setting_control_radius").width - - border.color: - { - if (!textField.enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - if (textField.hovered || textField.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") - } - //Optional icon added on the left hand side. UM.RecolorImage { From 26262e3cac183798796505eb112fc58050085a0d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 11:26:18 +0100 Subject: [PATCH 325/377] Fix marketplace opening --- resources/qml/Actions.qml | 8 -------- resources/qml/MainWindow/ApplicationMenu.qml | 7 ++++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 92c9051491..4e2a05a6aa 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -71,7 +71,6 @@ Item property alias configureSettingVisibility: configureSettingVisibilityAction property alias browsePackages: browsePackagesAction - property alias openMarketplace: openMarketplaceAction UM.I18nCatalog{id: catalog; name: "cura"} @@ -483,11 +482,4 @@ Item text: "&Marketplace" icon.name: "plugins_browse" } - - Action - { - id: openMarketplaceAction - text: catalog.i18nc("@action:menu", "&Marketplace") - icon.name: "plugins_browse" - } } diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index e6bf52a6bc..0ed1662943 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -97,7 +97,8 @@ Item target: Cura.Actions.browsePackages function onTriggered() { - extensionMenu.extensionModel.callExtensionMethod("Toolbox", "launch") + print("beepboop") + extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show") } } @@ -107,8 +108,8 @@ Item target: Cura.Actions.marketplaceMaterials function onTriggered() { - extensionMenu.extensionModel.callExtensionMethod("Toolbox", "launch") - extensionMenu.extensionModel.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") + extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show") + extensionMenu.extensionModel.callExtensionMethod("Marketplace", "setVisibleTabToMaterials") } } } From 7fd6601b1ac323b03b6e2b302d6d71962dad59d6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 11:37:51 +0100 Subject: [PATCH 326/377] Apply theming to perObjectCategory CURA-8688 --- .../PerObjectSettingsTool/PerObjectCategory.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectCategory.qml b/plugins/PerObjectSettingsTool/PerObjectCategory.qml index 1800555b9d..eae74eeb4c 100644 --- a/plugins/PerObjectSettingsTool/PerObjectCategory.qml +++ b/plugins/PerObjectSettingsTool/PerObjectCategory.qml @@ -28,8 +28,8 @@ Button { anchors.verticalCenter: parent.verticalCenter height: (label.height / 2) | 0 width: height - source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); - color: base.hovered ? palette.highlight : palette.buttonText + source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight") + color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("primary_button_text") } } UM.RecolorImage @@ -38,22 +38,20 @@ Button { height: label.height width: height source: UM.Theme.getIcon(definition.icon) - color: base.hovered ? palette.highlight : palette.buttonText + color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button_text") } UM.Label { id: label anchors.verticalCenter: parent.verticalCenter text: base.text - color: base.hovered ? palette.highlight : palette.buttonText + color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button_text") font.bold: true } - - SystemPalette { id: palette } } - signal showTooltip(string text); - signal hideTooltip(); + signal showTooltip(string text) + signal hideTooltip() signal contextMenuRequested() text: definition.label From 0a214b2c47dbfee93ea257bb5306020c64195aa1 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 28 Feb 2022 11:41:21 +0100 Subject: [PATCH 327/377] Fix dark mode issues Post processing plugin Also revamped the post-processing list a bit. CURA-8688 --- .../PostProcessingPlugin.qml | 278 +++++++++--------- 1 file changed, 136 insertions(+), 142 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index 17256eb9ea..a095ccb352 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -15,14 +15,15 @@ UM.Dialog id: dialog title: catalog.i18nc("@title:window", "Post Processing Plugin") - width: 700 * screenScaleFactor; - height: 500 * screenScaleFactor; - minimumWidth: 400 * screenScaleFactor; - minimumHeight: 250 * screenScaleFactor; + width: 700 * screenScaleFactor + height: 500 * screenScaleFactor + minimumWidth: 400 * screenScaleFactor + minimumHeight: 250 * screenScaleFactor onVisibleChanged: { - if(!visible) //Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack. + // Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack. + if (!visible) { manager.writeScriptsToStack() } @@ -35,8 +36,7 @@ UM.Dialog property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width) property int textMargin: UM.Theme.getSize("narrow_margin").width property string activeScriptName - SystemPalette{ id: palette } - SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled } + anchors.fill: parent ButtonGroup @@ -51,14 +51,12 @@ UM.Dialog spacing: base.textMargin - Label + UM.Label { id: activeScriptsHeader text: catalog.i18nc("@label", "Post Processing Scripts") anchors.left: parent.left - anchors.leftMargin: base.textMargin anchors.right: parent.right - anchors.rightMargin: base.textMargin font: UM.Theme.getFont("large_bold") elide: Text.ElideRight } @@ -79,137 +77,142 @@ UM.Dialog id: activeScriptsScrollBar } model: manager.scriptList - delegate: Item + + delegate: Button { + id: activeScriptButton + width: parent.width - activeScriptsScrollBar.width - height: activeScriptButton.height - Button - { - id: activeScriptButton - text: manager.getScriptLabelByKey(modelData.toString()) - ButtonGroup.group: selectedScriptGroup - width: parent.width - height: UM.Theme.getSize("setting").height - checkable: true + height: UM.Theme.getSize("standard_list_lineheight").height - checked: + ButtonGroup.group: selectedScriptGroup + checkable: true + + checked: + { + if (manager.selectedScriptIndex == index) { - if (manager.selectedScriptIndex == index) - { - base.activeScriptName = manager.getScriptLabelByKey(modelData.toString()) - return true - } - else - { - return false - } - } - onClicked: - { - forceActiveFocus() - manager.setSelectedScriptIndex(index) base.activeScriptName = manager.getScriptLabelByKey(modelData.toString()) + return true } - - background: Rectangle + else { - color: activeScriptButton.checked ? palette.highlight : "transparent" + return false } - contentItem: Label - { - wrapMode: Text.Wrap - text: activeScriptButton.text - elide: Text.ElideRight - color: activeScriptButton.checked ? palette.highlightedText : palette.text - } - } - Button + background: Rectangle { - id: removeButton - text: "x" - width: 20 * screenScaleFactor - height: 20 * screenScaleFactor - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - onClicked: manager.removeScriptByIndex(index) - contentItem: Item + color: activeScriptButton.checked ? UM.Theme.getColor("background_3") : "transparent" + } + + onClicked: + { + forceActiveFocus() + manager.setSelectedScriptIndex(index) + base.activeScriptName = manager.getScriptLabelByKey(modelData.toString()) + } + + RowLayout + { + anchors.fill: parent + height: childrenRect.height + + UM.Label { + Layout.fillWidth: true + text: manager.getScriptLabelByKey(modelData.toString()) + } + + Item + { + id: downButton + Layout.preferredWidth: height + Layout.fillHeight: true + enabled: index != manager.scriptList.length - 1 + + MouseArea + { + anchors.fill: parent + onClicked: + { + if (manager.selectedScriptIndex == index) + { + manager.setSelectedScriptIndex(index + 1) + } + return manager.moveScript(index, index + 1) + } + } + UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(removeButton.width / 2.7) - height: Math.round(removeButton.height / 2.7) - sourceSize.height: width - color: palette.text - source: UM.Theme.getIcon("Cancel") - } - } - - } - Button - { - id: downButton - text: "" - anchors.right: removeButton.left - anchors.verticalCenter: parent.verticalCenter - enabled: index != manager.scriptList.length - 1 - width: 20 * screenScaleFactor - height: 20 * screenScaleFactor - onClicked: - { - if (manager.selectedScriptIndex == index) - { - manager.setSelectedScriptIndex(index + 1) - } - return manager.moveScript(index, index + 1) - } - contentItem: Item - { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(downButton.width / 2.5) - height: Math.round(downButton.height / 2.5) - sourceSize.height: width - color: downButton.enabled ? palette.text : disabledPalette.text + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + sourceSize.height: height + color: parent.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") source: UM.Theme.getIcon("ChevronSingleDown") } } - } - Button - { - id: upButton - text: "" - enabled: index != 0 - width: 20 * screenScaleFactor - height: 20 * screenScaleFactor - anchors.right: downButton.left - anchors.verticalCenter: parent.verticalCenter - onClicked: + Item { - if (manager.selectedScriptIndex == index) + id: upButton + Layout.preferredWidth: height + Layout.fillHeight: true + enabled: index != 0 + + MouseArea { - manager.setSelectedScriptIndex(index - 1) + anchors.fill: parent + onClicked: + { + if (manager.selectedScriptIndex == index) + { + manager.setSelectedScriptIndex(index - 1) + } + return manager.moveScript(index, index - 1) + } } - return manager.moveScript(index, index - 1) - } - contentItem: Item - { + UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(upButton.width / 2.5) - height: Math.round(upButton.height / 2.5) - sourceSize.height: width - color: upButton.enabled ? palette.text : disabledPalette.text + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + sourceSize.height: height + color: upButton.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") source: UM.Theme.getIcon("ChevronSingleUp") } } + + Item + { + id: removeButton + Layout.preferredWidth: height + Layout.fillHeight: true + + MouseArea + { + anchors.fill: parent + onClicked: manager.removeScriptByIndex(index) + } + + 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: height + color: UM.Theme.getColor("text") + source: UM.Theme.getIcon("Cancel") + } + } } } } @@ -217,28 +220,26 @@ UM.Dialog { id: addButton text: catalog.i18nc("@action", "Add a script") - anchors.left: parent.left - anchors.leftMargin: base.textMargin onClicked: scriptsMenu.open() } - Menu + } + + Cura.Menu + { + id: scriptsMenu + + Models.Instantiator { - id: scriptsMenu - width: parent.width + model: manager.loadedScriptList - Models.Instantiator + Cura.MenuItem { - model: manager.loadedScriptList - - MenuItem - { - text: manager.getScriptLabelByKey(modelData.toString()) - onTriggered: manager.addScriptToList(modelData.toString()) - } - - onObjectAdded: scriptsMenu.insertItem(index, object) - onObjectRemoved: scriptsMenu.removeItem(object) + text: manager.getScriptLabelByKey(modelData.toString()) + onTriggered: manager.addScriptToList(modelData.toString()) } + + onObjectAdded: scriptsMenu.insertItem(index, object) + onObjectRemoved: scriptsMenu.removeItem(object) } } @@ -303,16 +304,9 @@ UM.Dialog width: listview.width height: { - if(provider.properties.enabled == "True") + if (provider.properties.enabled == "True" && model.type != undefined) { - if(model.type != undefined) - { - return UM.Theme.getSize("section").height - } - else - { - return 0 - } + return UM.Theme.getSize("section").height; } else { @@ -392,10 +386,10 @@ UM.Dialog function onShowTooltip(text) { - tooltip.text = text - var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0) - tooltip.show(position) - tooltip.target.x = position.x + 1 + tooltip.text = text; + var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0); + tooltip.show(position); + tooltip.target.x = position.x + 1; } function onHideTooltip() { tooltip.hide() } @@ -452,7 +446,7 @@ UM.Dialog } } - rightButtons: Cura.PrimaryButton + rightButtons: Cura.TertiaryButton { text: catalog.i18nc("@action:button", "Close") onClicked: dialog.accept() From 78c19559d26af068443a542593c4fe3c66e7188f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 11:41:56 +0100 Subject: [PATCH 328/377] Ensure that Cura styling is applied to the workspace summary dialog CURA-8688 --- .../qml/Dialogs/WorkspaceSummaryDialog.qml | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 27a7fd734f..00c4fb8f50 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -45,11 +45,7 @@ UM.Dialog visibilityHandler: UM.SettingPreferenceVisibilityHandler { } } - SystemPalette - { - id: palette - } - Label + UM.Label { id: mainHeading width: parent.width @@ -86,7 +82,7 @@ UM.Dialog spacing: UM.Theme.getSize("default_margin").height Column { - Label + UM.Label { id: settingsHeading text: catalog.i18nc("@action:label", "Printer settings") @@ -96,14 +92,14 @@ UM.Dialog { width: parent.width height: childrenRect.height - Label + UM.Label { text: catalog.i18nc("@action:label", "Type") width: Math.floor(scroll.width / 3) | 0 } - Label + UM.Label { - text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name + text: Cura.MachineManager.activeMachine == null ? "" : Cura.MachineManager.activeMachine.definition.name width: Math.floor(scroll.width / 3) | 0 } } @@ -111,12 +107,12 @@ UM.Dialog { width: parent.width height: childrenRect.height - Label + UM.Label { text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name") width: Math.floor(scroll.width / 3) | 0 } - Label + UM.Label { text: { @@ -155,7 +151,7 @@ UM.Dialog var material_name = extruder.material.name return (material_name !== undefined) ? material_name : "" } - Label + UM.Label { text: { var extruder = Number(modelData.position) @@ -179,7 +175,7 @@ UM.Dialog width: parent.width height: childrenRect.height - Label + UM.Label { text: { @@ -192,7 +188,7 @@ UM.Dialog width: Math.floor(scroll.width / 3) | 0 enabled: modelData.isEnabled } - Label + UM.Label { text: { @@ -212,7 +208,7 @@ UM.Dialog { width: parent.width height: childrenRect.height - Label + UM.Label { text: catalog.i18nc("@action:label", "Profile settings") font.bold: true @@ -220,12 +216,12 @@ UM.Dialog Row { width: parent.width - Label + UM.Label { text: catalog.i18nc("@action:label", "Not in profile") width: Math.floor(scroll.width / 3) | 0 } - Label + UM.Label { text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings) width: Math.floor(scroll.width / 3) | 0 @@ -236,12 +232,12 @@ UM.Dialog { width: parent.width height: childrenRect.height - Label + UM.Label { text: catalog.i18nc("@action:label", "Name") width: Math.floor(scroll.width / 3) | 0 } - Label + UM.Label { text: Cura.MachineManager.activeQualityOrQualityChangesName width: Math.floor(scroll.width / 3) | 0 @@ -253,12 +249,12 @@ UM.Dialog { width: parent.width height: childrenRect.height - Label + UM.Label { text: catalog.i18nc("@action:label", "Intent") width: Math.floor(scroll.width / 3) | 0 } - Label + UM.Label { text: Cura.MachineManager.activeIntentCategory width: Math.floor(scroll.width / 3) | 0 @@ -273,7 +269,7 @@ UM.Dialog leftButtons: [ - CheckBox + UM.CheckBox { id: dontShowAgainCheckbox anchors.left: parent.left From 7da5903ce3b3731636ffb90476d20a304808ae6e Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 28 Feb 2022 11:43:59 +0100 Subject: [PATCH 329/377] Update RadioButton to new style CURA-8688 --- resources/qml/Widgets/RadioButton.qml | 30 +++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/resources/qml/Widgets/RadioButton.qml b/resources/qml/Widgets/RadioButton.qml index 18347b69da..96c2d95f56 100644 --- a/resources/qml/Widgets/RadioButton.qml +++ b/resources/qml/Widgets/RadioButton.qml @@ -17,6 +17,31 @@ RadioButton font: UM.Theme.getFont("default") + states: [ + State { + name: "checked" + when: radioButton.checked + PropertyChanges + { + target: indicator + color: UM.Theme.getColor("accent_1") + border.width: 0 + } + }, + State + { + name: "disabled" + when: !radioButton.enabled + PropertyChanges { target: indicator; color: UM.Theme.getColor("background_1")} + }, + State + { + name: "highlighted" + when: radioButton.hovered || radioButton.activeFocus + PropertyChanges { target: indicator; border.color: UM.Theme.getColor("accent_1")} + } + ] + background: Item { anchors.fill: parent @@ -29,8 +54,9 @@ RadioButton anchors.verticalCenter: parent.verticalCenter anchors.alignWhenCentered: false radius: width / 2 + color: UM.Theme.getColor("background_2") border.width: UM.Theme.getSize("default_lining").width - border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover") + border.color: UM.Theme.getColor("text_disabled") Rectangle { @@ -38,7 +64,7 @@ RadioButton height: width anchors.centerIn: parent radius: width / 2 - color: radioButton.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button") + color: radioButton.enabled ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") visible: radioButton.checked } } From 8d3a5ac7e4a3c63881d75f6cbd64ee8e6bab7387 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 11:47:10 +0100 Subject: [PATCH 330/377] Ensure AskOpenAsProjectOrModel dialog uses cura styling CURA-8688 --- resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 3bd72bf68f..23e01b5e46 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -76,7 +76,7 @@ UM.Dialog anchors.fill: parent spacing: UM.Theme.getSize("default_margin").height - Label + UM.Label { id: questionText width: parent.width From 83661ebd7ff1047c870e49b9677db40e1e2d7fd5 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 28 Feb 2022 12:02:51 +0100 Subject: [PATCH 331/377] Remove duplicate color for primary button. Adjust secondary button colors to account for different colors being used between light and dark themes. CURA-8688 --- resources/qml/SecondaryButton.qml | 2 +- resources/themes/cura-dark/theme.json | 2 ++ resources/themes/cura-light/theme.json | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/qml/SecondaryButton.qml b/resources/qml/SecondaryButton.qml index ba4e0bb2c1..d8027af3fc 100644 --- a/resources/qml/SecondaryButton.qml +++ b/resources/qml/SecondaryButton.qml @@ -11,7 +11,7 @@ Cura.ActionButton { color: UM.Theme.getColor("secondary_button") textColor: UM.Theme.getColor("secondary_button_text") - outlineColor: UM.Theme.getColor("secondary_button_text") + outlineColor: UM.Theme.getColor("border_accent_1") disabledColor: UM.Theme.getColor("action_button_disabled") textDisabledColor: UM.Theme.getColor("action_button_disabled_text") hoverColor: UM.Theme.getColor("secondary_button_hover") diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 5d90ac93e4..2706992517 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -56,6 +56,8 @@ "main_window_header_background_gradient": "background_4", "main_window_header_button_background_hovered": [46, 46, 46, 255], + "secondary_button_text": "text_secondary_button", + "account_sync_state_icon": [255, 255, 255, 204], "machine_selector_printer_icon": [204, 204, 204, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 6ba4867b6d..a13cc59c90 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -211,12 +211,11 @@ "icon": [8, 7, 63, 255], - "primary_button": [25, 110, 240, 255], "primary_button": "accent_1", "primary_button_hover": [16, 70, 156, 255], "primary_button_text": [255, 255, 255, 255], - "secondary_button": "text_default", + "secondary_button": "background_1", "secondary_button_shadow": [216, 216, 216, 255], "secondary_button_hover": [232, 240, 253, 255], "secondary_button_text": "accent_1", From 6159ccbdc791f628260d416f56cc0076c8fff824 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 28 Feb 2022 12:20:46 +0100 Subject: [PATCH 332/377] Fix darkmode issues in the `DiscoverUM3Actions` dialog CURA-8688 --- .../resources/qml/DiscoverUM3Action.qml | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 9c96fdca9e..e68f552f7b 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -35,8 +35,8 @@ Cura.MachineAction id: discoverUM3Action spacing: UM.Theme.getSize("default_margin").height - SystemPalette { id: palette } UM.I18nCatalog { id: catalog; name:"cura" } + UM.Label { id: pageTitle @@ -53,9 +53,9 @@ Cura.MachineAction Row { - spacing: UM.Theme.getSize("default_lining").width + spacing: UM.Theme.getSize("thin_margin").width - Button + Cura.SecondaryButton { id: addButton text: catalog.i18nc("@action:button", "Add"); @@ -65,7 +65,7 @@ Cura.MachineAction } } - Button + Cura.SecondaryButton { id: editButton text: catalog.i18nc("@action:button", "Edit") @@ -76,7 +76,7 @@ Cura.MachineAction } } - Button + Cura.SecondaryButton { id: removeButton text: catalog.i18nc("@action:button", "Remove") @@ -84,7 +84,7 @@ Cura.MachineAction onClicked: manager.removeManualDevice(base.selectedDevice.key, base.selectedDevice.ipAddress) } - Button + Cura.SecondaryButton { id: rediscoverButton text: catalog.i18nc("@action:button", "Refresh") @@ -122,23 +122,18 @@ Cura.MachineAction base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true"; } Component.onCompleted: manager.startDiscovery() - delegate: Rectangle + + delegate: UM.Label { - height: printNameLabel.height - color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase + id: printNameLabel width: listview.width - Label - { - id: printNameLabel - height: contentHeight - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.right: parent.right - text: listview.model[index].name - color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text - elide: Text.ElideRight - renderType: Text.NativeRendering - } + height: contentHeight + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + + anchors.right: parent.right + text: listview.model[index].name + elide: Text.ElideRight MouseArea { @@ -151,6 +146,11 @@ Cura.MachineAction } } } + + background: Rectangle + { + color: parent.ListView.isCurrentItem ? UM.Theme.getColor("background_3") : "transparent" + } } } UM.Label @@ -175,20 +175,19 @@ Cura.MachineAction font: UM.Theme.getFont("large_bold") elide: Text.ElideRight } - Grid + GridLayout { visible: base.completeProperties width: parent.width columns: 2 - property real labelWidth: Math.round(width * 0.5) UM.Label { - width: labelWidth + Layout.fillWidth: true text: catalog.i18nc("@label", "Type") } UM.Label { - width: labelWidth + Layout.fillWidth: true text: { if (base.selectedDevice) { @@ -199,22 +198,22 @@ Cura.MachineAction } UM.Label { - width: labelWidth + Layout.fillWidth: true text: catalog.i18nc("@label", "Firmware version") } UM.Label { - width: labelWidth + Layout.fillWidth: true text: base.selectedDevice ? base.selectedDevice.firmwareVersion : "" } UM.Label { - width: labelWidth + Layout.fillWidth: true text: catalog.i18nc("@label", "Address") } UM.Label { - width: labelWidth + Layout.fillWidth: true text: base.selectedDevice ? base.selectedDevice.ipAddress : "" } } @@ -246,7 +245,7 @@ Cura.MachineAction text: catalog.i18nc("@label", "The printer at this address has not yet responded." ) } - Button + Cura.SecondaryButton { text: catalog.i18nc("@action:button", "Connect") enabled: (base.selectedDevice && base.completeProperties && base.selectedDevice.clusterSize > 0) ? true : false @@ -264,7 +263,7 @@ Cura.MachineAction standardButtons: Dialog.Ok } - Dialog + Cura.MessageDialog { id: manualPrinterDialog property string printerKey @@ -273,6 +272,7 @@ Cura.MachineAction title: catalog.i18nc("@title:window", "Printer Address") width: UM.Theme.getSize("small_popup_dialog").width + height: UM.Theme.getSize("small_popup_dialog").height anchors.centerIn: Overlay.overlay From 14b0f66c995f9c4dcdbdbcae0944076ed3b72847 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:14:23 +0100 Subject: [PATCH 333/377] Remove hardcoded value for visibility preset selector CURA-8688 --- resources/qml/Preferences/SettingVisibilityPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 0cc10be0f9..bdb252f3c2 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -105,7 +105,7 @@ UM.PreferencesPage Cura.ComboBox { id: visibilityPreset - width: 150 * screenScaleFactor + width: UM.Theme.getSize("action_button").width anchors { top: parent.top From 6713056a49630588578a9ba69adb946635f688f8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:15:39 +0100 Subject: [PATCH 334/377] Ensure that setting visibility filter is styled CURA-8688 --- resources/qml/Preferences/SettingVisibilityPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index bdb252f3c2..1e2ab6a365 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -84,7 +84,7 @@ UM.PreferencesPage } } - TextField + Cura.TextField { id: filter From c6e2561dbb418a3ad8cb82740740858bdbd45244 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:19:56 +0100 Subject: [PATCH 335/377] Fix styling for Machine Settings CURA-8688 --- plugins/MachineSettingsAction/MachineSettingsAction.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index 0f0ffac8cd..7f72fea4c3 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -88,7 +88,7 @@ Cura.MachineAction } } - Label + UM.Label { id: machineNameLabel anchors.top: parent.top @@ -97,7 +97,6 @@ Cura.MachineAction text: Cura.MachineManager.activeMachine.name horizontalAlignment: Text.AlignHCenter font: UM.Theme.getFont("large_bold") - renderType: Text.NativeRendering } UM.TabRow From f7852e4f9daba87faec0af5e73c966c84b34b88f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:22:19 +0100 Subject: [PATCH 336/377] Use correct menu type for setting contet menu CURA-8688 --- resources/qml/Settings/SettingView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 48c658e4e7..2ab98081e7 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -409,7 +409,7 @@ Item } } - Menu + Cura.Menu { id: contextMenu From 1f39a1b87fe9062fed0726a1c68c15359298d7d7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:30:14 +0100 Subject: [PATCH 337/377] Add CuraStyled rename dialog CURA-8688 --- resources/qml/Preferences/ProfilesPage.qml | 6 +- resources/qml/Preferences/RenameDialog.qml | 91 ++++++++++++++++++++++ resources/qml/qmldir | 1 + 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 resources/qml/Preferences/RenameDialog.qml diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 1ee86f9f0c..d6522829fe 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -144,7 +144,7 @@ UM.ManagementPage } // Dialog to request a name when creating a new profile - UM.RenameDialog + Cura.RenameDialog { id: createQualityDialog title: catalog.i18nc("@title:window", "Create Profile") @@ -233,7 +233,7 @@ UM.ManagementPage } // Dialog to request a name when duplicating a new profile - UM.RenameDialog + Cura.RenameDialog { id: duplicateQualityDialog title: catalog.i18nc("@title:window", "Duplicate Profile") @@ -263,7 +263,7 @@ UM.ManagementPage } // Dialog to rename a quality profile - UM.RenameDialog + Cura.RenameDialog { id: renameQualityDialog title: catalog.i18nc("@title:window", "Rename Profile") diff --git a/resources/qml/Preferences/RenameDialog.qml b/resources/qml/Preferences/RenameDialog.qml new file mode 100644 index 0000000000..7bf02e92a1 --- /dev/null +++ b/resources/qml/Preferences/RenameDialog.qml @@ -0,0 +1,91 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Uranium is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 2.0 +import QtQuick.Window 2.1 + +import UM 1.5 as UM +import Cura 1.0 as Cura + +UM.Dialog +{ + id: base + property string object: "" + + property alias newName: nameField.text + property bool validName: true + property string validationError + property string dialogTitle: catalog.i18nc("@title:window", "Rename") + property string explanation: catalog.i18nc("@info", "Please provide a new name.") + + title: dialogTitle + + minimumWidth: UM.Theme.getSize("small_popup_dialog").width + minimumHeight: UM.Theme.getSize("small_popup_dialog").height + width: minimumWidth + height: minimumHeight + + property variant catalog: UM.I18nCatalog { name: "cura" } + + signal textChanged(string text) + signal selectText() + onSelectText: + { + nameField.selectAll(); + nameField.focus = true; + } + + Column + { + anchors.fill: parent + + UM.Label + { + text: base.explanation + "\n" //Newline to make some space using system theming. + width: parent.width + wrapMode: Text.WordWrap + } + + Cura.TextField + { + id: nameField + width: parent.width + text: base.object + maximumLength: 40 + selectByMouse: true + onTextChanged: base.textChanged(text) + } + + UM.Label + { + visible: !base.validName + text: base.validationError + } + } + + Item + { + ButtonGroup { + buttons: [cancelButton, okButton] + checkedButton: okButton + } + } + + rightButtons: [ + Cura.SecondaryButton + { + id: cancelButton + text: catalog.i18nc("@action:button","Cancel") + onClicked: base.reject() + }, + Cura.PrimaryButton + { + id: okButton + text: catalog.i18nc("@action:button", "OK") + onClicked: base.accept() + enabled: base.validName + } + ] +} + diff --git a/resources/qml/qmldir b/resources/qml/qmldir index 2d5839f798..8ddacc56e4 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -47,3 +47,4 @@ GcodeTextArea 1.0 GcodeTextArea.qml NumericTextFieldWithUnit 1.0 NumericTextFieldWithUnit.qml PrintHeadMinMaxTextField 1.0 PrintHeadMinMaxTextField.qml SimpleCheckBox 1.0 SimpleCheckBox.qml +RenameDialog 1.0 RenameDialog.qml From cc29e2398b6502034291e2deca0b6f6b1d15cb56 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:35:56 +0100 Subject: [PATCH 338/377] Set correct text highlight color for TextField CURA-8688 --- resources/qml/Widgets/TextField.qml | 1 + resources/themes/cura-light/theme.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index bace79a98a..66894eca69 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -24,6 +24,7 @@ TextField font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") renderType: Text.NativeRendering + selectionColor: UM.Theme.getColor("text_selection") leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width states: [ diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 6ba4867b6d..e22c02d5d5 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -206,7 +206,6 @@ "text_selection": [156, 195, 255, 127], "border": [127, 127, 127, 255], "border_field": [180, 180, 180, 255], - "text_selection": [156,195, 255, 127], "secondary": [240, 240, 240, 255], "icon": [8, 7, 63, 255], From bb1a2a998831b582e5e02865eaf0e0a79c2507fa Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:46:29 +0100 Subject: [PATCH 339/377] Fix QML warning CURA-8688 --- resources/qml/Preferences/GeneralPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 2b340a7ab5..52e141ad3c 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -14,7 +14,7 @@ UM.PreferencesPage title: catalog.i18nc("@title:tab", "General") id: generalPreferencesPage - width: parent.width + width: parent ? parent.width: 0 function setDefaultLanguage(languageCode) { From ea588d85fb3ab5bc55dd48878162662ef9cb2d55 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:47:27 +0100 Subject: [PATCH 340/377] Remove unneeded anchor from workspace summary dialog CURA-8688 --- resources/qml/Dialogs/WorkspaceSummaryDialog.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 00c4fb8f50..c5c7248a98 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -272,7 +272,6 @@ UM.Dialog UM.CheckBox { id: dontShowAgainCheckbox - anchors.left: parent.left text: catalog.i18nc("@action:label", "Don't show project summary on save again") checked: dontShowAgain } From 79ee9ffc917a975f95aab5b8a683fa564be08a14 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:48:30 +0100 Subject: [PATCH 341/377] Fix warning spam in MainWindowHeader CURA-8688 --- resources/qml/MainWindow/MainWindowHeader.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index c38e1bb4ab..3f22879992 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -78,7 +78,6 @@ Item background: Rectangle { radius: UM.Theme.getSize("action_button_radius").width - width: contents.width color: { if (stageSelectorButton.checked) From 62f6643a49c65a1b03f139fb7bcc0b1d1c09e611 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 14:08:26 +0100 Subject: [PATCH 342/377] Add checkbox disabled color to darktheme CURA-8688 --- resources/themes/cura-dark/theme.json | 1 + resources/themes/cura-light/theme.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 5d90ac93e4..55dc777fd7 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -159,6 +159,7 @@ "checkbox_mark": "text_default", "checkbox_square": "text_disabled", "checkbox_text": "text_default", + "checkbox_disabled": "background_2", "tooltip": "background_2", "tooltip_text": "text_default", diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index e22c02d5d5..9504ed6300 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -327,7 +327,7 @@ "checkbox_border": [180, 180, 180, 255], "checkbox_border_hover": [25, 110, 240, 255], "checkbox_mark": [35, 35, 35, 255], - "checkbox_disabled": [223, 223, 223, 255], + "checkbox_disabled": "background_2", "checkbox_text": [0, 12, 26, 255], "tooltip": [25, 25, 25, 255], From ce86e025d9e7b4f2017f1a0ccd775e1dc81869ae Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 28 Feb 2022 14:56:07 +0100 Subject: [PATCH 343/377] New style highlighting on borders CURA-8688 --- resources/qml/Widgets/ComboBox.qml | 9 +++------ resources/qml/Widgets/RadioButton.qml | 2 +- resources/qml/Widgets/TextField.qml | 1 + resources/themes/cura-dark/theme.json | 2 +- resources/themes/cura-light/theme.json | 7 +++++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 121c5f15da..a9e48e5a60 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -26,21 +26,18 @@ ComboBox { name: "disabled" when: !control.enabled - PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} + PropertyChanges { target: background; color: UM.Theme.getColor("setting_control_disabled")} PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")} }, State { name: "highlighted" when: control.hovered || control.activeFocus - PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_highlight")} + PropertyChanges { target: background; liningColor: UM.Theme.getColor("border_main_light")} } ] - background: UM.UnderlineBackground - { - id: backgroundRectangle - } + background: UM.UnderlineBackground{} indicator: UM.RecolorImage { diff --git a/resources/qml/Widgets/RadioButton.qml b/resources/qml/Widgets/RadioButton.qml index 96c2d95f56..428eb8a4e5 100644 --- a/resources/qml/Widgets/RadioButton.qml +++ b/resources/qml/Widgets/RadioButton.qml @@ -38,7 +38,7 @@ RadioButton { name: "highlighted" when: radioButton.hovered || radioButton.activeFocus - PropertyChanges { target: indicator; border.color: UM.Theme.getColor("accent_1")} + PropertyChanges { target: indicator; border.color: UM.Theme.getColor("border_main_light")} } ] diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index bace79a98a..959506ff2b 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -43,6 +43,7 @@ TextField { name: "hovered" when: textField.hovered || textField.activeFocus + PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("border_main_light")} } ] diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 2706992517..fe18818d99 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -157,7 +157,7 @@ "checkbox": "background_1", "checkbox_hover": [43, 48, 52, 255], "checkbox_border": "text_disabled", - "checkbox_border_hover": [255, 255, 255, 38], + "checkbox_border_hover": "border_main", "checkbox_mark": "text_default", "checkbox_square": "text_disabled", "checkbox_text": "text_default", diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index a13cc59c90..9c6e043eee 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -323,7 +323,7 @@ "quality_slider_available": [0, 0, 0, 255], "checkbox": [255, 255, 255, 255], - "checkbox_hover": [255, 255, 255, 255], + "checkbox_hover": "border_main", "checkbox_border": [180, 180, 180, 255], "checkbox_border_hover": [25, 110, 240, 255], "checkbox_mark": [35, 35, 35, 255], @@ -423,7 +423,10 @@ "cloud_unavailable": [153, 153, 153, 255], "connection_badge_background": [255, 255, 255, 255], "warning_badge_background": [0, 0, 0, 255], - "error_badge_background": [255, 255, 255, 255] + "error_badge_background": [255, 255, 255, 255], + + "border_field_light": [180, 180, 180, 255], + "border_main_light": [212, 212, 212, 255] }, "sizes": { From 5725f3d57fb82c63c629147bce26a6198a6312ff Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 15:46:04 +0100 Subject: [PATCH 344/377] Fix height of syncMaterialCards CURA-8688 --- resources/qml/Preferences/Materials/MaterialsSyncDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index 0360e2c94b..e592be6d5d 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -266,7 +266,7 @@ Window border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width width: printerList.width - printerListScrollBar.width - height: UM.Theme.getSize("card").height + height: UM.Theme.getSize("machine_selector_icon").height + 2 * UM.Theme.getSize("default_margin").height property string syncStatus: { From 38b947f0fb17c3389618ea9f16de84fe03d00603 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 15:57:36 +0100 Subject: [PATCH 345/377] Fix width in multiply dialog CURA-8688 --- resources/qml/Menus/ContextMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index f25b3f70e5..1bba79e2c1 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -133,6 +133,7 @@ Cura.Menu focus: true from: 1 to: 99 + width: 2 * UM.Theme.getSize("button").width } } } From f31b8051df321369ca47f279e0db49275c8ceb13 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 28 Feb 2022 15:59:56 +0100 Subject: [PATCH 346/377] Fix darkmode issues in the Workspace dialog CURA-8688 --- plugins/3MFReader/WorkspaceDialog.qml | 469 +++++++++++++------------- 1 file changed, 239 insertions(+), 230 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 781c12ad84..898b1ea993 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 import QtQuick.Window 2.2 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.1 as Cura UM.Dialog @@ -19,9 +19,7 @@ UM.Dialog width: minimumWidth height: Math.max(dialogSummaryItem.height + 2 * buttonsItem.height, minimumHeight) // 2 * button height to also have some extra space around the button relative to the button size - property int comboboxHeight: 15 * screenScaleFactor - property int spacerHeight: 10 * screenScaleFactor - property int doubleSpacerHeight: 20 * screenScaleFactor + property int comboboxHeight: UM.Theme.getSize("default_margin").height onClosing: manager.notifyClosed() onVisibleChanged: @@ -46,10 +44,6 @@ UM.Dialog id: catalog name: "cura" } - SystemPalette - { - id: palette - } ListModel { @@ -68,45 +62,39 @@ UM.Dialog { width: parent.width height: childrenRect.height - spacing: 2 * screenScaleFactor - Label + spacing: UM.Theme.getSize("default_margin").height + + Column { - id: titleLabel - text: catalog.i18nc("@action:title", "Summary - Cura Project") - font.pointSize: 18 - } - Rectangle - { - id: separator - color: palette.text width: parent.width - height: 1 - } - Item // Spacer - { - height: doubleSpacerHeight - width: height + height: cildrenRect.height + + UM.Label + { + id: titleLabel + text: catalog.i18nc("@action:title", "Summary - Cura Project") + font: UM.Theme.getFont("large") + } + + Rectangle + { + id: separator + color: UM.Theme.getColor("text") + width: parent.width + height: UM.Theme.getSize("default_lining").height + } } - Row + Item { - height: childrenRect.height width: parent.width - Label - { - text: catalog.i18nc("@action:label", "Printer settings") - font.bold: true - width: (parent.width / 3) | 0 - } - Item - { - // spacer - height: spacerHeight - width: (parent.width / 3) | 0 - } + height: childrenRect.height + UM.TooltipArea { id: machineResolveStrategyTooltip + anchors.top: parent.top + anchors.right: parent.right width: (parent.width / 3) | 0 height: visible ? comboboxHeight : 0 visible: base.visible && machineResolveComboBox.model.count > 1 @@ -157,64 +145,65 @@ UM.Dialog } } } - } - Row - { - width: parent.width - height: childrenRect.height - Label + + Column { - text: catalog.i18nc("@action:label", "Type") - width: (parent.width / 3) | 0 - } - Label - { - text: manager.machineType - width: (parent.width / 3) | 0 + width: parent.width + height: cildrenRect.height + + UM.Label + { + id: printer_settings_label + text: catalog.i18nc("@action:label", "Printer settings") + font: UM.Theme.getFont("default_bold") + } + + Row + { + width: parent.width + height: childrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", "Type") + width: (parent.width / 3) | 0 + } + UM.Label + { + text: manager.machineType + width: (parent.width / 3) | 0 + } + } + + Row + { + width: parent.width + height: childrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name") + width: (parent.width / 3) | 0 + } + UM.Label + { + text: manager.machineName + width: (parent.width / 3) | 0 + wrapMode: Text.WordWrap + } + } } } - Row + Item { width: parent.width height: childrenRect.height - Label - { - text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name") - width: (parent.width / 3) | 0 - } - Label - { - text: manager.machineName - width: (parent.width / 3) | 0 - wrapMode: Text.WordWrap - } - } - Item // Spacer - { - height: doubleSpacerHeight - width: height - } - Row - { - height: childrenRect.height - width: parent.width - Label - { - text: catalog.i18nc("@action:label", "Profile settings") - font.bold: true - width: (parent.width / 3) | 0 - } - Item - { - // spacer - height: spacerHeight - width: (parent.width / 3) | 0 - } UM.TooltipArea { - id: qualityChangesResolveTooltip + anchors.right: parent.right + anchors.top: parent.top width: (parent.width / 3) | 0 height: visible ? comboboxHeight : 0 visible: manager.qualityChangesConflict @@ -232,96 +221,105 @@ UM.Dialog } } } + + Column + { + width: parent.width + height: cildrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", "Profile settings") + font: UM.Theme.getFont("default_bold") + } + + Row + { + width: parent.width + height: childrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", "Name") + width: (parent.width / 3) | 0 + } + UM.Label + { + text: manager.qualityName + width: (parent.width / 3) | 0 + wrapMode: Text.WordWrap + } + } + + Row + { + width: parent.width + height: childrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", "Intent") + width: (parent.width / 3) | 0 + } + UM.Label + { + text: manager.intentName + width: (parent.width / 3) | 0 + wrapMode: Text.WordWrap + } + } + + Row + { + width: parent.width + height: childrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", "Not in profile") + visible: manager.numUserSettings != 0 + width: (parent.width / 3) | 0 + } + UM.Label + { + text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings) + visible: manager.numUserSettings != 0 + width: (parent.width / 3) | 0 + } + } + + Row + { + width: parent.width + height: childrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", "Derivative from") + visible: manager.numSettingsOverridenByQualityChanges != 0 + width: (parent.width / 3) | 0 + } + UM.Label + { + text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges) + width: (parent.width / 3) | 0 + visible: manager.numSettingsOverridenByQualityChanges != 0 + wrapMode: Text.WordWrap + } + } + } } - Row + + Item { width: parent.width height: childrenRect.height - Label - { - text: catalog.i18nc("@action:label", "Name") - width: (parent.width / 3) | 0 - } - Label - { - text: manager.qualityName - width: (parent.width / 3) | 0 - wrapMode: Text.WordWrap - } - } - Row - { - width: parent.width - height: childrenRect.height - Label - { - text: catalog.i18nc("@action:label", "Intent") - width: (parent.width / 3) | 0 - } - Label - { - text: manager.intentName - width: (parent.width / 3) | 0 - wrapMode: Text.WordWrap - } - } - Row - { - width: parent.width - height: manager.numUserSettings != 0 ? childrenRect.height : 0 - Label - { - text: catalog.i18nc("@action:label", "Not in profile") - width: (parent.width / 3) | 0 - } - Label - { - text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings) - width: (parent.width / 3) | 0 - } - visible: manager.numUserSettings != 0 - } - Row - { - width: parent.width - height: manager.numSettingsOverridenByQualityChanges != 0 ? childrenRect.height : 0 - Label - { - text: catalog.i18nc("@action:label", "Derivative from") - width: (parent.width / 3) | 0 - } - Label - { - text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges) - width: (parent.width / 3) | 0 - wrapMode: Text.WordWrap - } - visible: manager.numSettingsOverridenByQualityChanges != 0 - } - Item // Spacer - { - height: doubleSpacerHeight - width: height - } - Row - { - height: childrenRect.height - width: parent.width - Label - { - text: catalog.i18nc("@action:label", "Material settings") - font.bold: true - width: (parent.width / 3) | 0 - } - Item - { - // spacer - height: spacerHeight - width: (parent.width / 3) | 0 - } + UM.TooltipArea { id: materialResolveTooltip + anchors.right: parent.right + anchors.top: parent.top width: (parent.width / 3) | 0 height: visible ? comboboxHeight : 0 visible: manager.materialConflict @@ -339,76 +337,91 @@ UM.Dialog } } } + + Column + { + width: parent.width + height: cildrenRect.height + Row + { + height: childrenRect.height + width: parent.width + spacing: UM.Theme.getSize("narrow_margin").width + + UM.Label + { + text: catalog.i18nc("@action:label", "Material settings") + font: UM.Theme.getFont("default_bold") + width: (parent.width / 3) | 0 + } + } + + Repeater + { + model: manager.materialLabels + delegate: Row + { + width: parent.width + height: childrenRect.height + UM.Label + { + text: catalog.i18nc("@action:label", "Name") + width: (parent.width / 3) | 0 + } + UM.Label + { + text: modelData + width: (parent.width / 3) | 0 + wrapMode: Text.WordWrap + } + } + } + } } - Repeater + Column { - model: manager.materialLabels - delegate: Row + width: parent.width + height: cildrenRect.height + + UM.Label + { + text: catalog.i18nc("@action:label", "Setting visibility") + font: UM.Theme.getFont("default_bold") + } + Row { width: parent.width height: childrenRect.height - Label + UM.Label { - text: catalog.i18nc("@action:label", "Name") + text: catalog.i18nc("@action:label", "Mode") width: (parent.width / 3) | 0 } - Label + UM.Label { - text: modelData + text: manager.activeMode + width: (parent.width / 3) | 0 + } + } + Row + { + width: parent.width + height: childrenRect.height + visible: manager.hasVisibleSettingsField + UM.Label + { + text: catalog.i18nc("@action:label", "Visible settings:") + width: (parent.width / 3) | 0 + } + UM.Label + { + text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings) width: (parent.width / 3) | 0 - wrapMode: Text.WordWrap } } } - Item // Spacer - { - height: doubleSpacerHeight - width: height - } - - Label - { - text: catalog.i18nc("@action:label", "Setting visibility") - font.bold: true - } - Row - { - width: parent.width - height: childrenRect.height - Label - { - text: catalog.i18nc("@action:label", "Mode") - width: (parent.width / 3) | 0 - } - Label - { - text: manager.activeMode - width: (parent.width / 3) | 0 - } - } - Row - { - width: parent.width - height: childrenRect.height - visible: manager.hasVisibleSettingsField - Label - { - text: catalog.i18nc("@action:label", "Visible settings:") - width: (parent.width / 3) | 0 - } - Label - { - text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings) - width: (parent.width / 3) | 0 - } - } - Item // Spacer - { - height: spacerHeight - width: height - } Row { width: parent.width @@ -418,12 +431,10 @@ UM.Dialog { width: warningLabel.height height: width - source: UM.Theme.getIcon("Information") - color: palette.text - + color: UM.Theme.getColor("text") } - Label + UM.Label { id: warningLabel text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the build plate.") @@ -438,13 +449,11 @@ UM.Dialog rightButtons: [ Cura.TertiaryButton { - id: cancel_button text: catalog.i18nc("@action:button", "Cancel") onClicked: reject() }, Cura.PrimaryButton { - id: ok_button text: catalog.i18nc("@action:button", "Open") onClicked: accept() } From 2949c0fcb33c966d771aee37f846a1387121d968 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 28 Feb 2022 16:13:36 +0100 Subject: [PATCH 347/377] Color icon in preference page according to theme color CURA-8688 --- resources/qml/Preferences/GeneralPage.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 52e141ad3c..8fbaadc5c3 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -849,6 +849,7 @@ UM.PreferencesPage hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover") backgroundRadius: width / 2 height: UM.Theme.getSize("small_button_icon").height + color: UM.Theme.getColor("small_button_text") width: height } } From 8dde0f4fd2774892edd39277c6df45081f690d43 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 28 Feb 2022 16:51:34 +0100 Subject: [PATCH 348/377] remove debugging code beepboop CURA-8688 --- resources/qml/MainWindow/ApplicationMenu.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 85a6d05547..0345e6dda5 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -92,7 +92,6 @@ Item target: Cura.Actions.browsePackages function onTriggered() { - print("beepboop") extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show") } } From 7ebc5eaac4a170bdc38eb49a3a29b3ae6bc271eb Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 09:30:02 +0100 Subject: [PATCH 349/377] Use `Cura.TextField` in the spinbox component CURA-8688 --- resources/qml/SpinBox.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index b5e93804b1..3c5a4d95e2 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -5,6 +5,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 import UM 1.5 as UM +import Cura 1.5 as Cura // This component extends the funtionality of QtControls 2.x Spinboxes to // - be able to contain fractional values @@ -73,19 +74,14 @@ Item background: Item {} - //TextField should be swapped with UM.TextField when it is restyled - contentItem: TextField + contentItem: Cura.TextField { text: spinBox.textFromValue(spinBox.value, spinBox.locale) - color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled") - background: UM.UnderlineBackground {} - - selectByMouse: base.editable validator: base.validator onActiveFocusChanged: { - if(!activeFocus) + if (!activeFocus) { base.editingFinished(); } From 195278aa5505b9c1e350432255a349b8d904dd5e Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 10:20:39 +0100 Subject: [PATCH 350/377] Make all text fields use updated background and lining style. CURA-8688 --- .../qml/MachineSettings/NumericTextFieldWithUnit.qml | 9 ++++----- resources/qml/Settings/SettingTextField.qml | 10 ++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 23859e40ec..0e1f296cfa 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -83,13 +83,12 @@ UM.TooltipArea height: numericTextFieldWithUnit.controlHeight // Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.) - background: Rectangle + background: UM.UnderlineBackground { anchors.fill: parent anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) - radius: UM.Theme.getSize("setting_control_radius").width - border.color: + liningColor: { if (!textFieldWithUnit.enabled) { @@ -108,9 +107,9 @@ UM.TooltipArea // Validation is OK. if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) { - return UM.Theme.getColor("setting_control_border_highlight") + return UM.Theme.getColor("border_main_light") } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("border_field_light") } color: diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index e6afb9e8e3..83b5d2a987 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -26,15 +26,13 @@ SettingItem } } - contents: Rectangle + contents: UM.UnderlineBackground { id: control anchors.fill: parent - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: + liningColor: { if(!enabled) { @@ -54,9 +52,9 @@ SettingItem //Validation is OK. if(hovered || input.activeFocus) { - return UM.Theme.getColor("setting_control_border_highlight") + return UM.Theme.getColor("border_main_light") } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("border_field_light") } color: { From 330b3f81191f6a5c98896ca734feafaaf9fa23b9 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 10:26:59 +0100 Subject: [PATCH 351/377] Update settings visibility pages to have correct background color on categories CURA-8688 --- plugins/PerObjectSettingsTool/PerObjectCategory.qml | 4 +++- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectCategory.qml b/plugins/PerObjectSettingsTool/PerObjectCategory.qml index eae74eeb4c..2a0f028d1c 100644 --- a/plugins/PerObjectSettingsTool/PerObjectCategory.qml +++ b/plugins/PerObjectSettingsTool/PerObjectCategory.qml @@ -11,7 +11,9 @@ import ".." Button { id: base; - background: Item {} + background: Rectangle { + color: UM.Theme.getColor("background_3") + } contentItem: Row { diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 0eb75676eb..d7d8091121 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -14,6 +14,7 @@ UM.Dialog title: catalog.i18nc("@title:window", "Select Settings to Customize for this model") width: UM.Theme.getSize("small_popup_dialog").width + backgroundColor: UM.Theme.getColor("background_1") property var additional_excluded_settings @@ -78,12 +79,13 @@ UM.Dialog anchors { top: filterInput.bottom + topMargin: UM.Theme.getSize("default_margin").height left: parent.left right: parent.right bottom: parent.bottom } - ScrollBar.vertical: UM.ScrollBar {} + ScrollBar.vertical: UM.ScrollBar { id: scrollBar } clip: true model: UM.SettingDefinitionsModel @@ -104,7 +106,7 @@ UM.Dialog { id: loader - width: listview.width + width: listview.width - scrollBar.width height: model.type != undefined ? UM.Theme.getSize("section").height : 0 property var definition: model From b129eb805f50e26da834d59b694c222985f38fd1 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 10:35:43 +0100 Subject: [PATCH 352/377] Update message background to match new designs CURA-8688 --- resources/themes/cura-dark/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 28b977db83..a0ac828b20 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -29,7 +29,7 @@ "colors": { "main_background": "background_1", "detail_background": [63, 63, 63, 255], - "message_background": [39, 44, 48, 255], + "message_background": "background_1", "wide_lining": [31, 36, 39, 255], "thick_lining": [255, 255, 255, 60], "lining": "border_main", From a4b8fe23eb408d476ec7cb89864ca07d21a61efc Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 11:16:14 +0100 Subject: [PATCH 353/377] Update Infill Slider to qt controls 2 CURA-8688 --- .../RecommendedInfillDensitySelector.qml | 107 +++++++++--------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml index 143eccd042..434945e172 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 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 QtQuick.Controls 2.15 import UM 1.5 as UM import Cura 1.0 as Cura @@ -87,10 +86,9 @@ Item width: parent.width height: UM.Theme.getSize("print_setup_slider_handle").height // The handle is the widest element of the slider - minimumValue: 0 - maximumValue: 100 + from: 0 + to: 100 stepSize: 1 - tickmarksEnabled: true // disable slider when gradual support is enabled enabled: parseInt(infillSteps.properties.value) == 0 @@ -98,53 +96,37 @@ Item // set initial value from stack value: parseInt(infillDensity.properties.value) - style: SliderStyle + //Draw line + background: Rectangle { - //Draw line - groove: Item - { - Rectangle - { - height: UM.Theme.getSize("print_setup_slider_groove").height - width: control.width - UM.Theme.getSize("print_setup_slider_handle").width - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") - } - } + id: backgroundLine + height: UM.Theme.getSize("print_setup_slider_groove").height + width: infillSlider.width - UM.Theme.getSize("print_setup_slider_handle").width + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") - handle: Rectangle - { - id: handleButton - color: control.enabled ? UM.Theme.getColor("primary") : UM.Theme.getColor("quality_slider_unavailable") - implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width - implicitHeight: implicitWidth - radius: Math.round(implicitWidth / 2) - border.color: UM.Theme.getColor("slider_groove_fill") - border.width: UM.Theme.getSize("default_lining").height - } - - tickmarks: Repeater + Repeater { id: repeater - model: control.maximumValue / control.stepSize + 1 + anchors.fill: parent + model: infillSlider.to / infillSlider.stepSize + 1 Rectangle { - color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") + color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") implicitWidth: UM.Theme.getSize("print_setup_slider_tickmarks").width implicitHeight: UM.Theme.getSize("print_setup_slider_tickmarks").height anchors.verticalCenter: parent.verticalCenter // Do not use Math.round otherwise the tickmarks won't be aligned - x: ((styleData.handleWidth / 2) - (implicitWidth / 2) + (index * ((repeater.width - styleData.handleWidth) / (repeater.count-1)))) - radius: Math.round(implicitWidth / 2) + x: ((handleButton.width / 2) - (backgroundLine.implicitWidth / 2) + (index * ((repeater.width - handleButton.width) / (repeater.count-1)))) + radius: Math.round(backgroundLine.implicitWidth / 2) visible: (index % 10) == 0 // Only show steps of 10% - Label + UM.Label { text: index - font: UM.Theme.getFont("default") visible: (index % 20) == 0 // Only show steps of 20% anchors.horizontalCenter: parent.horizontalCenter y: UM.Theme.getSize("thin_margin").height @@ -155,29 +137,46 @@ Item } } - onValueChanged: + handle: Rectangle { - // Don't round the value if it's already the same - if (parseInt(infillDensity.properties.value) == infillSlider.value) + id: handleButton + x: infillSlider.leftPadding + infillSlider.visualPosition * (infillSlider.availableWidth - width) + y: infillSlider.topPadding + infillSlider.availableHeight / 2 - height / 2 + color: infillSlider.enabled ? UM.Theme.getColor("primary") : UM.Theme.getColor("quality_slider_unavailable") + implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width + implicitHeight: implicitWidth + radius: Math.round(implicitWidth / 2) + border.color: UM.Theme.getColor("slider_groove_fill") + border.width: UM.Theme.getSize("default_lining").height + } + + Connections + { + target: infillSlider + function onValueChanged() { - return - } + // Don't round the value if it's already the same + if (parseInt(infillDensity.properties.value) == infillSlider.value) + { + return + } - // Round the slider value to the nearest multiple of 10 (simulate step size of 10) - var roundedSliderValue = Math.round(infillSlider.value / 10) * 10 + // Round the slider value to the nearest multiple of 10 (simulate step size of 10) + var roundedSliderValue = Math.round(infillSlider.value / 10) * 10 - // Update the slider value to represent the rounded value - infillSlider.value = roundedSliderValue + // Update the slider value to represent the rounded value + infillSlider.value = roundedSliderValue - // Update value only if the Recommended mode is Active, - // Otherwise if I change the value in the Custom mode the Recommended view will try to repeat - // same operation - var active_mode = UM.Preferences.getValue("cura/active_mode") + // Update value only if the Recommended mode is Active, + // Otherwise if I change the value in the Custom mode the Recommended view will try to repeat + // same operation + const active_mode = UM.Preferences.getValue("cura/active_mode") - if (active_mode == 0 || active_mode == "simple") - { - Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue) - Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance") + if (active_mode == 0 || active_mode == "simple") + { + Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue) + Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance") + } } } } From bd1b0fb34cc9d8729a97e59050684488a7ad4308 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 11:36:47 +0100 Subject: [PATCH 354/377] Update usb printing menu to qt controls 2 CURA-8688 --- resources/qml/PrinterOutput/ExtruderBox.qml | 62 +++++++++++-------- resources/qml/PrinterOutput/HeatedBedBox.qml | 41 ++++++------ .../PrinterOutput/ManualPrinterControl.qml | 1 - resources/qml/PrinterOutput/MonitorItem.qml | 3 +- .../qml/PrinterOutput/OutputDeviceHeader.qml | 13 ++-- 5 files changed, 65 insertions(+), 55 deletions(-) diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index b36faf262d..d1d28b3cfe 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -1,9 +1,8 @@ -//Copyright (c) 2019 Ultimaker B.V. +//Copyright (c) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.1 import UM 1.2 as UM import Cura 1.0 as Cura @@ -35,17 +34,17 @@ Item id: background anchors.fill: parent - Label //Extruder name. + // Extruder name. + UM.Label { text: Cura.MachineManager.activeMachine.extruderList[position].name !== "" ? Cura.MachineManager.activeMachine.extruderList[position].name : catalog.i18nc("@label", "Extruder") - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") anchors.left: parent.left anchors.top: parent.top anchors.margins: UM.Theme.getSize("default_margin").width } - Label //Target temperature. + // Target temperature. + UM.Label { id: extruderTargetTemperature text: Math.round(extruderModel.targetHotendTemperature) + "°C" @@ -55,7 +54,8 @@ Item anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.bottom: extruderCurrentTemperature.bottom - MouseArea //For tooltip. + //For tooltip. + MouseArea { id: extruderTargetTemperatureTooltipArea hoverEnabled: true @@ -77,17 +77,20 @@ Item } } } - Label //Temperature indication. + + //Temperature indication. + UM.Label { id: extruderCurrentTemperature text: Math.round(extruderModel.hotendTemperature) + "°C" - color: UM.Theme.getColor("text") font: UM.Theme.getFont("large_bold") anchors.right: extruderTargetTemperature.left anchors.top: parent.top anchors.margins: UM.Theme.getSize("default_margin").width - MouseArea //For tooltip. + + //For tooltip. + MouseArea { id: extruderCurrentTemperatureTooltipArea hoverEnabled: true @@ -110,7 +113,8 @@ Item } } - Rectangle //Input field for pre-heat temperature. + //Input field for pre-heat temperature. + Rectangle { id: preheatTemperatureControl color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok") @@ -152,14 +156,16 @@ Item width: UM.Theme.getSize("monitor_preheat_temperature_control").width height: UM.Theme.getSize("monitor_preheat_temperature_control").height visible: extruderModel != null ? enabled && extruderModel.canPreHeatHotends && !extruderModel.isPreheating : true - Rectangle //Highlight of input field. + //Highlight of input field. + Rectangle { anchors.fill: parent anchors.margins: UM.Theme.getSize("default_lining").width color: UM.Theme.getColor("setting_control_highlight") opacity: preheatTemperatureControl.hovered ? 1.0 : 0 } - MouseArea //Change cursor on hovering. + //Change cursor on hovering. + MouseArea { id: preheatTemperatureInputMouseArea hoverEnabled: true @@ -182,7 +188,7 @@ Item } } } - Label + UM.Label { id: unit anchors.right: parent.right @@ -191,7 +197,6 @@ Item text: "°C"; color: UM.Theme.getColor("setting_unit") - font: UM.Theme.getFont("default") } TextInput { @@ -299,7 +304,8 @@ Item } } - Rectangle //Material colour indication. + //Material colour indication. + Rectangle { id: materialColor width: Math.floor(materialName.height * 0.75) @@ -313,7 +319,8 @@ Item anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: materialName.verticalCenter - MouseArea //For tooltip. + //For tooltip. + MouseArea { id: materialColorTooltipArea hoverEnabled: true @@ -335,17 +342,17 @@ Item } } } - Label //Material name. + //Material name. + UM.Label { id: materialName text: extruderModel.activeMaterial != null ? extruderModel.activeMaterial.type : "" - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") anchors.left: materialColor.right anchors.bottom: parent.bottom anchors.margins: UM.Theme.getSize("default_margin").width - MouseArea //For tooltip. + //For tooltip. + MouseArea { id: materialNameTooltipArea hoverEnabled: true @@ -367,17 +374,18 @@ Item } } } - Label //Variant name. + + //Variant name. + UM.Label { id: variantName text: extruderModel.hotendID - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: UM.Theme.getSize("default_margin").width - MouseArea //For tooltip. + //For tooltip. + MouseArea { id: variantNameTooltipArea hoverEnabled: true @@ -388,7 +396,7 @@ Item { base.showTooltip( base, - {x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y}, + { x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y }, catalog.i18nc("@tooltip", "The nozzle inserted in this extruder.") ); } diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 82a8d8c6b7..9343ca8826 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.4 import UM 1.2 as UM import Cura 1.0 as Cura @@ -20,17 +19,17 @@ Item color: UM.Theme.getColor("main_background") anchors.fill: parent - Label //Build plate label. + // Build plate label. + UM.Label { text: catalog.i18nc("@label", "Build plate") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") anchors.left: parent.left anchors.top: parent.top anchors.margins: UM.Theme.getSize("default_margin").width } - Label //Target temperature. + // Target temperature. + UM.Label { id: bedTargetTemperature text: printerModel != null ? printerModel.targetBedTemperature + "°C" : "" @@ -40,7 +39,8 @@ Item anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.bottom: bedCurrentTemperature.bottom - MouseArea //For tooltip. + // For tooltip. + MouseArea { id: bedTargetTemperatureTooltipArea hoverEnabled: true @@ -62,17 +62,18 @@ Item } } } - Label //Current temperature. + // Current temperature. + UM.Label { id: bedCurrentTemperature text: printerModel != null ? printerModel.bedTemperature + "°C" : "" font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") anchors.right: bedTargetTemperature.left anchors.top: parent.top anchors.margins: UM.Theme.getSize("default_margin").width - MouseArea //For tooltip. + //For tooltip. + MouseArea { id: bedTemperatureTooltipArea hoverEnabled: true @@ -94,7 +95,8 @@ Item } } } - Rectangle //Input field for pre-heat temperature. + //Input field for pre-heat temperature. + Rectangle { id: preheatTemperatureControl color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok") @@ -166,7 +168,7 @@ Item } } } - Label + UM.Label { id: unit anchors.right: parent.right @@ -175,7 +177,6 @@ Item text: "°C"; color: UM.Theme.getColor("setting_unit") - font: UM.Theme.getFont("default") } TextInput { @@ -213,7 +214,8 @@ Item } } - Cura.SecondaryButton // The pre-heat button. + // The pre-heat button. + Cura.SecondaryButton { id: preheatButton height: UM.Theme.getSize("setting_control").height @@ -248,14 +250,15 @@ Item text: { - if(printerModel == null) + if (printerModel == null) { return "" } - if(printerModel.isPreheating ) + if (printerModel.isPreheating ) { return catalog.i18nc("@button Cancel pre-heating", "Cancel") - } else + } + else { return catalog.i18nc("@button", "Pre-heat") } @@ -279,7 +282,7 @@ Item { base.showTooltip( base, - {x: 0, y: preheatButton.mapToItem(base, 0, 0).y}, + { x: 0, y: preheatButton.mapToItem(base, 0, 0).y }, catalog.i18nc("@tooltip of pre-heat", "Heat the bed in advance before printing. You can continue adjusting your print while it is heating, and you won't have to wait for the bed to heat up when you're ready to print.") ); } diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index bf987b282f..f53a45905c 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.1 -import QtQuick.Layouts 1.3 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/PrinterOutput/MonitorItem.qml b/resources/qml/PrinterOutput/MonitorItem.qml index 4cf66630e9..a6e78ba837 100644 --- a/resources/qml/PrinterOutput/MonitorItem.qml +++ b/resources/qml/PrinterOutput/MonitorItem.qml @@ -1,8 +1,7 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Layouts 1.1 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/PrinterOutput/OutputDeviceHeader.qml b/resources/qml/PrinterOutput/OutputDeviceHeader.qml index 9ad946b6af..56c8fcb936 100644 --- a/resources/qml/PrinterOutput/OutputDeviceHeader.qml +++ b/resources/qml/PrinterOutput/OutputDeviceHeader.qml @@ -1,7 +1,9 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.1 import UM 1.2 as UM import Cura 1.0 as Cura @@ -27,7 +29,7 @@ Item height: childrenRect.height color: UM.Theme.getColor("setting_category") - Label + UM.Label { id: outputDeviceNameLabel font: UM.Theme.getFont("large_bold") @@ -38,7 +40,7 @@ Item text: outputDevice != null ? outputDevice.activePrinter.name : "" } - Label + UM.Label { id: outputDeviceAddressLabel text: (outputDevice != null && outputDevice.address != null) ? outputDevice.address : "" @@ -49,11 +51,10 @@ Item anchors.margins: UM.Theme.getSize("default_margin").width } - Label + UM.Label { 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("default") wrapMode: Text.WordWrap anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width From ceee0e9b4bbbb8c1e0856f1b9aafc71ad5ec79f8 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 11:38:29 +0100 Subject: [PATCH 355/377] Update `RecommnededQualityProfileSelector` to Controls 2 CURA-8688 --- .../Recommended/RecommendedQualityProfileSelector.qml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index 1d924a9223..1176142b3b 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls 2.3 as Controls2 +import QtQuick.Controls 2.3 import UM 1.2 as UM import Cura 1.6 as Cura @@ -29,7 +28,7 @@ Item spacing: UM.Theme.getSize("default_margin").height - Controls2.ButtonGroup + ButtonGroup { id: activeProfileButtonGroup exclusive: true From 82173c57660bd876e4ce9b4ccef925c80e4ca47f Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 11:48:15 +0100 Subject: [PATCH 356/377] Update remaining qt controls 1 imports CURA-8688 --- resources/qml/Cura.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 70fae42162..371754e9e0 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -2,11 +2,9 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.15 import QtQuick.Dialogs 1.2 import QtGraphicalEffects 1.0 -import QtQuick.Controls 2.15 as NewControls import UM 1.5 as UM import Cura 1.1 as Cura From 2fdd7b82d503f6a5672b7204a136aaf6f692c76a Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 11:48:41 +0100 Subject: [PATCH 357/377] Update settings extruder comboboxes and material selection combobox to match new designs CURA-8688 --- resources/qml/PrintSetupHeaderButton.qml | 17 +++++------- resources/qml/Settings/SettingExtruder.qml | 14 +++++----- .../qml/Settings/SettingOptionalExtruder.qml | 26 +++++++++---------- resources/themes/cura-dark/theme.json | 6 ++--- 4 files changed, 26 insertions(+), 37 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 2583c6b84e..e41f95f778 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -36,7 +36,7 @@ ToolButton { target: background color: UM.Theme.getColor("setting_control_disabled") - border.color: UM.Theme.getColor("setting_control_disabled_border") + liningColor: UM.Theme.getColor("setting_control_disabled_border") } }, State @@ -47,7 +47,7 @@ ToolButton { target: background color: UM.Theme.getColor("setting_validation_error_background") - border.color: UM.Theme.getColor("setting_validation_error") + liningColor: UM.Theme.getColor("setting_validation_error") } }, State @@ -58,7 +58,7 @@ ToolButton { target: background color: UM.Theme.getColor("setting_validation_warning_background") - border.color: UM.Theme.getColor("setting_validation_warning") + liningColor: UM.Theme.getColor("setting_validation_warning") } }, State @@ -69,7 +69,7 @@ ToolButton { target: background color: UM.Theme.getColor("setting_control") - border.color: UM.Theme.getColor("setting_control_border_highlight") + liningColor: UM.Theme.getColor("border_main_light") } }, State @@ -80,20 +80,15 @@ ToolButton { target: background color: UM.Theme.getColor("setting_control") - border.color: UM.Theme.getColor("setting_control_border") + liningColor: UM.Theme.getColor("border_field_light") } } ] - background: Rectangle + background: UM.UnderlineBackground { id: background - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - color: UM.Theme.getColor("setting_control") - border.color: UM.Theme.getColor("setting_control_border") - UM.RecolorImage { id: downArrow diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index a7aaa99fb2..d3a50a7eb3 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -5,14 +5,14 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import UM 1.5 as UM -import Cura 1.0 as Cura +import Cura 1.5 as Cura SettingItem { id: base property var focusItem: control - contents: ComboBox + contents: Cura.ComboBox { id: control anchors.fill: parent @@ -113,7 +113,7 @@ SettingItem color: UM.Theme.getColor("setting_control_button"); } - background: Rectangle + background: UM.UnderlineBackground { color: { @@ -127,9 +127,7 @@ SettingItem } return UM.Theme.getColor("setting_control") } - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: + liningColor: { if (!enabled) { @@ -137,9 +135,9 @@ SettingItem } if (control.hovered || control.activeFocus) { - return UM.Theme.getColor("setting_control_border_highlight") + return UM.Theme.getColor("border_main_light") } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("border_field_light") } } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 1f4a021009..5cde1c0ae9 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import UM 1.5 as UM -import Cura 1.0 as Cura +import Cura 1.5 as Cura SettingItem { @@ -19,7 +19,7 @@ SettingItem // this extra property to keep the ExtrudersModel and use this in the rest of the code. property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional() - contents: ComboBox + contents: Cura.ComboBox { id: control anchors.fill: parent @@ -111,26 +111,24 @@ SettingItem sourceSize.width: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor - color: UM.Theme.getColor("setting_control_button"); + color: UM.Theme.getColor("setting_control_button") } - background: Rectangle + background: UM.UnderlineBackground { color: { if (!enabled) { - return UM.Theme.getColor("setting_control_disabled"); + return UM.Theme.getColor("setting_control_disabled") } - if (control.hovered || control.activeFocus) + if (control.hovered || base.activeFocus) { - return UM.Theme.getColor("setting_control_highlight"); + return UM.Theme.getColor("setting_control_highlight") } - return UM.Theme.getColor("setting_control"); + return UM.Theme.getColor("setting_control") } - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: + liningColor: { if (!enabled) { @@ -138,9 +136,9 @@ SettingItem } if (control.hovered || control.activeFocus) { - return UM.Theme.getColor("setting_control_border_highlight") + return UM.Theme.getColor("border_main_light") } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("border_field_light") } } @@ -214,7 +212,7 @@ SettingItem if (model.enabled) { UM.Theme.getColor("setting_control_text") } else { - UM.Theme.getColor("action_button_disabled_text"); + UM.Theme.getColor("action_button_disabled_text") } } elide: Text.ElideRight diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index a0ac828b20..31803bbddb 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -118,15 +118,13 @@ "scrollbar_handle_hover": [255, 255, 255, 255], "scrollbar_handle_down": [255, 255, 255, 255], - "setting_category": [75, 80, 83, 255], + "setting_category": "background_3", "setting_category_disabled": [75, 80, 83, 255], - "setting_category_hover": [75, 80, 83, 255], + "setting_category_hover": "background_3", "setting_category_text": [255, 255, 255, 152], "setting_category_disabled_text": [255, 255, 255, 101], "setting_category_active_text": [255, 255, 255, 204], - "setting_control": [43, 48, 52, 255], - "setting_control_highlight": [43, 48, 52, 255], "setting_control": "background_2", "setting_control_selected": [34, 39, 42, 38], "setting_control_highlight": "background_2", From a3a5b613aeabc90e0eaa63430b46ac217c049a2c Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 12:09:27 +0100 Subject: [PATCH 358/377] Style menu bar according to theme CURA-8688 --- resources/qml/MainWindow/ApplicationMenu.qml | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 0345e6dda5..6792690328 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -21,7 +21,27 @@ Item id: applicationMenu width: parent.width height: UM.Theme.getSize("context_menu").height - background: Rectangle {} + + background: Rectangle { + color: UM.Theme.getColor("background_1") + } + + delegate: MenuBarItem + { + id: menuBarItem + + contentItem: UM.Label + { + text: menuBarItem.text + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } + + background: Rectangle + { + color: menuBarItem.highlighted ? UM.Theme.getColor("background_2") : "transparent" + } + } FileMenu {} EditMenu {} From 862525bc9024b1018302a4ea9523a37e503b4638 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 12:29:09 +0100 Subject: [PATCH 359/377] Remove obsolete uses of system palette CURA-8688 --- plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 2 -- resources/qml/Preferences/ProfilesPage.qml | 5 ----- resources/qml/Preferences/SettingVisibilityPage.qml | 1 - 3 files changed, 8 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 94016636db..03e1da7d35 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -425,8 +425,6 @@ Item storeIndex: 0 } - SystemPalette { id: palette } - Component { id: settingTextField diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index d6522829fe..dcf02bc738 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -293,11 +293,6 @@ UM.ManagementPage } } - SystemPalette - { - id: palette - } - Column { id: detailsPanelHeaderColumn diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 1e2ab6a365..d8ad58e680 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -189,7 +189,6 @@ UM.PreferencesPage } UM.I18nCatalog { name: "cura" } - SystemPalette { id: palette } Component { From ac907ca4518dc34c7c452f384ad8ef081e6a2320 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 12:33:19 +0100 Subject: [PATCH 360/377] Update highlight colors CURA-8688 --- resources/qml/ExpandableComponent.qml | 4 ++-- resources/qml/ExpandableComponentHeader.qml | 3 +-- resources/qml/ExpandablePopup.qml | 4 ++-- resources/themes/cura-dark/theme.json | 3 +++ resources/themes/cura-light/theme.json | 3 +++ 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 8821bcbb98..e5eab3bd93 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -30,8 +30,8 @@ Item property color contentBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button") - property color headerActiveColor: UM.Theme.getColor("secondary") - property color headerHoverColor: UM.Theme.getColor("action_button_hovered") + property color headerActiveColor: UM.Theme.getColor("expandable_active") + property color headerHoverColor: UM.Theme.getColor("expandable_hover") property alias enabled: mouseArea.enabled diff --git a/resources/qml/ExpandableComponentHeader.qml b/resources/qml/ExpandableComponentHeader.qml index 831267acbe..7176f0978b 100644 --- a/resources/qml/ExpandableComponentHeader.qml +++ b/resources/qml/ExpandableComponentHeader.qml @@ -16,7 +16,7 @@ Cura.RoundedRectangle property alias xPosCloseButton: closeButton.left height: UM.Theme.getSize("expandable_component_content_header").height - color: UM.Theme.getColor("secondary") + color: UM.Theme.getColor("background_1") cornerSide: Cura.RoundedRectangle.Direction.Up border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") @@ -27,7 +27,6 @@ Cura.RoundedRectangle id: headerLabel text: "" font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("small_button_text") height: parent.height anchors diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index 4e9393b086..219608a762 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -30,8 +30,8 @@ Item property color contentBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button") - property color headerActiveColor: UM.Theme.getColor("secondary") - property color headerHoverColor: UM.Theme.getColor("action_button_hovered") + property color headerActiveColor: UM.Theme.getColor("expandable_active") + property color headerHoverColor: UM.Theme.getColor("expandable_hover") property alias mouseArea: headerMouseArea property alias enabled: headerMouseArea.enabled diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 31803bbddb..c111ccf350 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -39,6 +39,9 @@ "primary_text": "text_default", "secondary": [95, 95, 95, 255], + "expandable_active": "background_2", + "expandable_hover": "background_2", + "secondary_button": "background_1", "secondary_button_hover": "background_3", "secondary_button_text": [255, 255, 255, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index e01c0363fa..a959a17d0c 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -208,6 +208,9 @@ "border_field": [180, 180, 180, 255], "secondary": [240, 240, 240, 255], + "expandable_active": [240, 240, 240, 255], + "expandable_hover": [232, 242, 252, 255], + "icon": [8, 7, 63, 255], "primary_button": "accent_1", From 071ddfb2b14a28bed8d3d61d974c6ec7eb4b2c34 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 12:38:54 +0100 Subject: [PATCH 361/377] Fix text elide/word wrap issue in monitor page The print job name wasn't elided causing the text to overflow the progress bar card. CURA-8688 --- plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index e3da51f966..df701b1d1f 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -392,6 +392,7 @@ Item id: printerJobNameLabel color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") elide: Text.ElideRight + wrapMode: Text.NoWrap font: UM.Theme.getFont("large") // 16pt, bold text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled") width: parent.width From fc3f0a4ad389ca17bafd55cd4677ba0b654b9369 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 12:44:52 +0100 Subject: [PATCH 362/377] Update setting profile combobox to new style CURA-8688 --- .../qml/PrintSetupSelector/Custom/CustomPrintSetup.qml | 7 ++----- resources/themes/cura-dark/theme.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index 94d55d563d..440c9e4e78 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -126,13 +126,10 @@ Item } } - background: Rectangle + background: UM.UnderlineBackground { id: backgroundItem - border.color: intentSelection.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border") - border.width: UM.Theme.getSize("default_lining").width - radius: UM.Theme.getSize("default_radius").width - color: UM.Theme.getColor("main_background") + liningColor: intentSelection.hovered ? UM.Theme.getColor("border_main_light") : UM.Theme.getColor("border_field_light") } UM.SimpleButton diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index c111ccf350..106290c71f 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -28,7 +28,7 @@ "colors": { "main_background": "background_1", - "detail_background": [63, 63, 63, 255], + "detail_background": "background_2", "message_background": "background_1", "wide_lining": [31, 36, 39, 255], "thick_lining": [255, 255, 255, 60], From ef5fced686fcd94fb44af5f049ad9002c948db4a Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 12:51:55 +0100 Subject: [PATCH 363/377] adjust setting valid background color CURA-8688 --- resources/themes/cura-light/theme.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index a959a17d0c..405d40f070 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -293,8 +293,8 @@ "setting_category_disabled_text": [24, 41, 77, 101], "setting_category_active_text": [35, 35, 35, 255], - "setting_control": [255, 255, 255, 255], - "setting_control_highlight": [255, 255, 255, 255], + "setting_control": "background_2", + "setting_control_highlight": "background_2", "setting_control_border": [199, 199, 199, 255], "setting_control_border_highlight": [50, 130, 255, 255], "setting_control_text": [35, 35, 35, 255], @@ -308,7 +308,7 @@ "setting_validation_error": [127, 127, 127, 255], "setting_validation_warning_background": [255, 145, 62, 255], "setting_validation_warning": [127, 127, 127, 255], - "setting_validation_ok": [255, 255, 255, 255], + "setting_validation_ok": "background_2", "material_compatibility_warning": [243, 166, 59, 255], From 4ea93c5939729d9c15ef0bfa92a091987122c95f Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 13:12:35 +0100 Subject: [PATCH 364/377] Fix text rendering issue in the menu bar To denote the hotkey assigned with each menu item an ampersand is used in the configuration. This ampersand was previously rendered directly to the screen due to the `UM.Label`. This is now correctly replaced by an underline. CURA-8688 --- resources/qml/MainWindow/ApplicationMenu.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 6792690328..bf3781331a 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -32,7 +32,10 @@ Item contentItem: UM.Label { - text: menuBarItem.text + text: menuBarItem.text.replace(new RegExp("&([A-Za-z])"), function (match, character) + { + return `${character}`; + }) horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } From 2e92a986db1f20a943fc1006d84a7fcb96b7aef8 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 13:13:54 +0100 Subject: [PATCH 365/377] adjust dropdown background hover color CURA-8688 --- resources/qml/Settings/SettingExtruder.qml | 1 - resources/qml/Settings/SettingOptionalExtruder.qml | 1 - resources/qml/Widgets/ComboBox.qml | 1 - resources/themes/cura-dark/theme.json | 2 +- resources/themes/cura-light/theme.json | 2 +- 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index d3a50a7eb3..6b2ac55066 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -225,7 +225,6 @@ SettingItem background: Rectangle { color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" } } } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 5cde1c0ae9..1ac7afe967 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -235,7 +235,6 @@ SettingItem background: Rectangle { color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" } } } diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index a9e48e5a60..f84772e609 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -146,7 +146,6 @@ ComboBox Rectangle { color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" anchors.fill: parent } text: delegateLabel.truncated ? delegateItem.text : "" diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 106290c71f..d877e3f788 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -130,7 +130,7 @@ "setting_control": "background_2", "setting_control_selected": [34, 39, 42, 38], - "setting_control_highlight": "background_2", + "setting_control_highlight": "background_3", "setting_control_border": [255, 255, 255, 38], "setting_control_border_highlight": [12, 169, 227, 255], "setting_control_text": "text_default", diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 405d40f070..09edaf6a57 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -294,7 +294,7 @@ "setting_category_active_text": [35, 35, 35, 255], "setting_control": "background_2", - "setting_control_highlight": "background_2", + "setting_control_highlight": "background_3", "setting_control_border": [199, 199, 199, 255], "setting_control_border_highlight": [50, 130, 255, 255], "setting_control_text": [35, 35, 35, 255], From 6ad3ef8e7d687955fa45522c96dc94427dcc14e1 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 13:22:51 +0100 Subject: [PATCH 366/377] Update monitor page background colors CURA-8688 --- resources/themes/cura-dark/theme.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index d877e3f788..6e222e1c32 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -193,8 +193,8 @@ "monitor_card_background": [51, 53, 54, 255], "monitor_card_hover": [84, 89, 95, 255], - "monitor_stage_background": [30, 36, 39, 255], - "monitor_stage_background_fade": [30, 36, 39, 102], + "monitor_stage_background": "background_1", + "monitor_stage_background_fade": "background_1", "monitor_progress_bar_deactive": [102, 102, 102, 255], "monitor_progress_bar_empty": [67, 67, 67, 255], From 8784f0182c82fe4b8230e75d4fbf705897ce31b9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 1 Mar 2022 14:20:42 +0100 Subject: [PATCH 367/377] Add workaround for TableModel not updating when rows are set directly It's not a great solution, but I just can't figure out why it wouldn't update. The binding is correctly in place, so it should work. Might be a bug with QT? CURA-8931 --- resources/qml/ProfileOverview.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index d3aa07ed06..e1009cd010 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -16,6 +16,16 @@ Cura.TableView property int extruderPosition: -1 //The extruder to display. -1 denotes the global stack. property bool isQualityItemCurrentlyActivated: qualityItem != null && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName + // Hack to make sure that when the data of our model changes the tablemodel is also updated + // If we directly set the rows (So without the clear being called) it doesn't seem to + // get updated correctly. + property var modelRows: qualitySettings.items + onModelRowsChanged: + { + tableModel.clear() + tableModel.rows = modelRows + } + Cura.QualitySettingsModel { id: qualitySettings @@ -31,11 +41,12 @@ Cura.TableView ] model: TableModel { + id: tableModel TableModelColumn { display: "label" } TableModelColumn { display: "profile_value" } TableModelColumn { display: "user_value" } TableModelColumn { display: "unit" } - rows: qualitySettings.items + rows: modelRows } sectionRole: "category" } \ No newline at end of file From 1b6c3516bd0bbf8bff612f68f35981eccccbac93 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 14:37:48 +0100 Subject: [PATCH 368/377] Set default overlay background to background_1 CURA-8688 --- resources/themes/cura-dark/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 6e222e1c32..91d742a83b 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -33,7 +33,7 @@ "wide_lining": [31, 36, 39, 255], "thick_lining": [255, 255, 255, 60], "lining": "border_main", - "viewport_overlay": [30, 36, 39, 255], + "viewport_overlay": "background_1", "primary": [12, 169, 227, 255], "primary_text": "text_default", From 5dfc5971e369367c354ada305d550e854ce7201a Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 1 Mar 2022 14:53:51 +0100 Subject: [PATCH 369/377] Dialogs inheriting from incorrect Component, causing the buttons to be styled incorrectly CURA-8688 --- resources/qml/Preferences/MachinesPage.qml | 2 +- resources/qml/Preferences/RenameDialog.qml | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index e51fce09f0..b1a5d7f19b 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -125,7 +125,7 @@ UM.ManagementPage } } - UM.RenameDialog + Cura.RenameDialog { id: renameDialog object: base.currentItem && base.currentItem.name ? base.currentItem.name : "" diff --git a/resources/qml/Preferences/RenameDialog.qml b/resources/qml/Preferences/RenameDialog.qml index 7bf02e92a1..6e4c628114 100644 --- a/resources/qml/Preferences/RenameDialog.qml +++ b/resources/qml/Preferences/RenameDialog.qml @@ -11,6 +11,9 @@ import Cura 1.0 as Cura UM.Dialog { id: base + + buttonSpacing: UM.Theme.getSize("default_margin").width + property string object: "" property alias newName: nameField.text @@ -64,14 +67,6 @@ UM.Dialog } } - Item - { - ButtonGroup { - buttons: [cancelButton, okButton] - checkedButton: okButton - } - } - rightButtons: [ Cura.SecondaryButton { From c8be7832c8b6379166ab2f92232b595e41cf82a4 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 16:06:48 +0100 Subject: [PATCH 370/377] Remove debugging code CURA-8983 --- .../qml/Preferences/Materials/MaterialsView.qml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 97f0ce4de1..758a73b8ca 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -222,22 +222,6 @@ Item id: colorDialog title: catalog.i18nc("@title", "Material color picker") color: properties.color_code -// swatchColors: ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"] - onAccepted: { - base.setMetaDataEntry("color_code", properties.color_code, color); - console.log("color_code"); - - const timer = Qt.createQmlObject("import QtQuick 2.0; Timer {}", base); - timer.interval = 10000; - timer.repeat = true; - timer.triggered.connect(function () { - console.log("updating colors"); - colorDialog.swatchColors = ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"]; - }) - - console.log("starting timers"); - timer.start(); - } } } From 53b31e816adfa5f4489cfa84f4f9ac4a3bd045b8 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 16:16:53 +0100 Subject: [PATCH 371/377] Set size of color swatch from theme CURA-8983 --- resources/qml/ColorDialog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 646d23c209..24230d2011 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -75,8 +75,8 @@ UM.Dialog delegate: Rectangle { color: swatchColor - width: 24 - height: 24 + implicitWidth: UM.Theme.getSize("medium_button_icon").width + implicitHeight: UM.Theme.getSize("medium_button_icon").height radius: width / 2 UM.RecolorImage From 485335063818cdfc7c9ddf4aa27a340260f1a484 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 1 Mar 2022 17:49:14 +0100 Subject: [PATCH 372/377] make `onClicked` action a one-liner Co-authored-by: Jaime van Kessel --- resources/qml/ColorDialog.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 24230d2011..4ae5b3c4bc 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -90,10 +90,7 @@ UM.Dialog MouseArea { anchors.fill: parent - onClicked: - { - base.color = swatchColor; - } + onClicked: base.color = swatchColor } } } From b2bed4efdd56de19a9979cc94e61211b6ae5f38a Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 2 Mar 2022 09:06:47 +0100 Subject: [PATCH 373/377] Fix setting visibility styling working in one theme and not the other. CURA-8688 --- plugins/DigitalLibrary/resources/qml/Table.qml | 3 ++- plugins/PerObjectSettingsTool/PerObjectCategory.qml | 8 ++++---- resources/themes/cura-dark/theme.json | 2 ++ resources/themes/cura-light/theme.json | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 0f539675a0..c4aafc1ce4 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -35,7 +35,8 @@ Item model: columnHeaders Rectangle { - width: Math.max(1, Math.round(tableBase.width / headerRepeater.count)) + //minimumWidth: Math.max(1, Math.round(tableBase.width / headerRepeater.count)) + width: 300 height: UM.Theme.getSize("section").height color: UM.Theme.getColor("secondary") diff --git a/plugins/PerObjectSettingsTool/PerObjectCategory.qml b/plugins/PerObjectSettingsTool/PerObjectCategory.qml index 2a0f028d1c..3d0b1d826e 100644 --- a/plugins/PerObjectSettingsTool/PerObjectCategory.qml +++ b/plugins/PerObjectSettingsTool/PerObjectCategory.qml @@ -12,7 +12,7 @@ Button { id: base; background: Rectangle { - color: UM.Theme.getColor("background_3") + color: UM.Theme.getColor("category_background") } contentItem: Row @@ -31,7 +31,7 @@ Button { height: (label.height / 2) | 0 width: height source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight") - color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("primary_button_text") + color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("text") } } UM.RecolorImage @@ -40,14 +40,14 @@ Button { height: label.height width: height source: UM.Theme.getIcon(definition.icon) - color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button_text") + color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text") } UM.Label { id: label anchors.verticalCenter: parent.verticalCenter text: base.text - color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button_text") + color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text") font.bold: true } } diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 91d742a83b..8f45471344 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -164,6 +164,8 @@ "checkbox_text": "text_default", "checkbox_disabled": "background_2", + "category_background": "background_3", + "tooltip": "background_2", "tooltip_text": "text_default", diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 09edaf6a57..ba18e5d0d2 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -332,6 +332,8 @@ "checkbox_disabled": "background_2", "checkbox_text": [0, 12, 26, 255], + "category_background": "background_2", + "tooltip": [25, 25, 25, 255], "tooltip_text": [255, 255, 255, 255], From 50ac2eacc43110c26f2f7169d712880edc486371 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 2 Mar 2022 10:26:09 +0100 Subject: [PATCH 374/377] Fix property binding loop for height which was causing crashes when moving list items quickly up and down the list. CURA-8688 --- plugins/PostProcessingPlugin/PostProcessingPlugin.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index a095ccb352..9c59f9e879 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -116,7 +116,6 @@ UM.Dialog RowLayout { anchors.fill: parent - height: childrenRect.height UM.Label { From 30083c13d34e4a7d609a258ec3108b862a5551aa Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 2 Mar 2022 11:34:03 +0100 Subject: [PATCH 375/377] Swap implicit width/height for preferredWidth/Height to avoid binding loop error CURA-8688 --- plugins/Marketplace/resources/qml/Marketplace.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index 5a30141b32..8fcba852bd 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -64,8 +64,8 @@ Window // Page title. Item { - implicitWidth: parent.width - implicitHeight: childrenRect.height + UM.Theme.getSize("default_margin").height + Layout.preferredWidth: parent.width + Layout.preferredHeight: childrenRect.height + UM.Theme.getSize("default_margin").height Label { From 3cba9a9c7e59f065c75679a207a6f6fbde1cc008 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 2 Mar 2022 11:52:30 +0100 Subject: [PATCH 376/377] Update color of material after accepting the color dialog CURA-8938 --- resources/qml/Preferences/Materials/MaterialsView.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 758a73b8ca..6d153f5960 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -222,6 +222,7 @@ Item id: colorDialog title: catalog.i18nc("@title", "Material color picker") color: properties.color_code + onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) } } From 37ae1cd69df0c556134d8a9176f1531b10018791 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 2 Mar 2022 18:05:50 +0100 Subject: [PATCH 377/377] Workaround on Windows. part of CURA-8938 --- resources/qml/ColorDialog.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 4ae5b3c4bc..3818ea5cb4 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -24,11 +24,13 @@ UM.Dialog // In this case we would like to let the content of the dialog determine the size of the dialog // however with the current implementation of the dialog this is not possible, so instead we calculate // the size of the dialog ourselves. - minimumWidth: content.width + 2 * margin + minimumWidth: content.width + 4 * margin minimumHeight: content.height // content height + buttonRow.height // button row height - + 3 * margin // top and bottom margin and margin between buttons and content + + 5 * margin // top and bottom margin and margin between buttons and content + width: minimumWidth + height: minimumHeight property alias color: colorInput.text property var swatchColors: [