diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index c59521cdc3..3231d924ee 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 UltiMaker // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.11 @@ -12,7 +12,7 @@ Item property color materialColor property alias textColor: extruderNumberText.color property bool extruderEnabled: true - property var iconSize: UM.Theme.getSize("extruder_icon").width + property int iconSize: UM.Theme.getSize("extruder_icon").width property string iconVariant: "medium" property alias font: extruderNumberText.font @@ -36,7 +36,6 @@ Item } UM.ColorImage { - id: mainIcon anchors.fill: parent width: iconSize height: iconSize @@ -48,12 +47,14 @@ Item UM.Label { id: extruderNumberText - anchors.centerIn: parent - text: index + 1 - font: UM.Theme.getFont("small_emphasis") width: contentWidth height: contentHeight + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: parent.right horizontalAlignment: Text.AlignHCenter + text: (index + 1).toString() + font: UM.Theme.getFont("small_emphasis") } } } diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml index 9d3da51356..52a22c6c76 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml @@ -67,6 +67,10 @@ Item top: parent.top } visible: currentModeIndex == PrintSetupSelectorContents.Mode.Recommended + height: { + const height = base.height - (customPrintSetup.mapToItem(null, 0, 0).y + buttonRow.height + UM.Theme.getSize("default_margin").height); + return Math.min(implicitHeight, height); + } function onModeChanged() { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index f78ae38dce..80e171bed4 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -2,34 +2,41 @@ //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 +import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 import UM 1.6 as UM import Cura 1.6 as Cura import ".." -Item +ScrollView { id: recommendedPrintSetup - height: childrenRect.height + 2 * padding + implicitHeight: settingsColumn.height + 2 * padding property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1 - property real padding: UM.Theme.getSize("default_margin").width + + padding: UM.Theme.getSize("default_margin").width function onModeChanged() {} - Column - { - spacing: UM.Theme.getSize("default_margin").height - + ScrollBar.vertical: UM.ScrollBar { + id: scroll anchors { - left: parent.left - right: parent.right top: parent.top - margins: parent.padding + right: parent.right + bottom: parent.bottom } + } + + Column + { + id: settingsColumn + spacing: UM.Theme.getSize("default_margin").height + + width: recommendedPrintSetup.width - 2 * recommendedPrintSetup.padding - (scroll.visible ? scroll.width : 0) // TODO property real firstColumnWidth: Math.round(width / 3) diff --git a/resources/qml/Widgets/SingleSettingTextField.qml b/resources/qml/Widgets/SingleSettingTextField.qml index 5bff7fdb5a..12d24d285d 100644 --- a/resources/qml/Widgets/SingleSettingTextField.qml +++ b/resources/qml/Widgets/SingleSettingTextField.qml @@ -87,15 +87,17 @@ UM.TextField function parseValueUpdateSetting() { - if (propertyProvider.properties.value === text || (parseFloat(propertyProvider.properties.value) === parseFloat(text))) + // User convenience. We use dots for decimal values + const modified_text = text.replace(",", "."); + if (propertyProvider.properties.value === modified_text || (parseFloat(propertyProvider.properties.value) === parseFloat(modified_text))) { // Don't set the property value from the control. It already has the same value return } - if (propertyProvider && text !== propertyProvider.properties.value) + if (propertyProvider && modified_text !== propertyProvider.properties.value) { - updateSetting(text); + updateSetting(modified_text); } } @@ -138,7 +140,7 @@ UM.TextField color: UM.Theme.getColor("setting_validation_warning_background") } }, - State + State { name: "disabled" when: !control.enabled