mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-10 13:29:02 +08:00
commit
eab43f038a
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user