From 1746e24dd9225c6ab0862db4a0b9b1ef7aa6aaf9 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 7 Feb 2022 19:59:57 +0100 Subject: [PATCH 01/12] 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 50820048f7046e65eac2c4d5ee6a815d11f6761b Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 8 Feb 2022 11:34:54 +0100 Subject: [PATCH 02/12] 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 03/12] 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 04/12] 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 05/12] 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 06/12] 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 ddc43446e6baf5e81c99ecbe743f97e32b519a69 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Feb 2022 10:37:26 +0100 Subject: [PATCH 07/12] 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 08/12] 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 09/12] 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 10/12] 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 11/12] 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 12/12] 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)