mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-09 07:19:01 +08:00
Fix layer slider label size and behavior
This commit is contained in:
parent
ed0fea125c
commit
15e09efeef
@ -493,7 +493,7 @@ QtObject {
|
|||||||
radius: width/2;
|
radius: width/2;
|
||||||
|
|
||||||
color: UM.Theme.colors.slider_groove;
|
color: UM.Theme.colors.slider_groove;
|
||||||
border.width: UM.Theme.sizes.default_lining;
|
border.width: UM.Theme.sizes.default_lining.width;
|
||||||
border.color: UM.Theme.colors.slider_groove_border;
|
border.color: UM.Theme.colors.slider_groove_border;
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors {
|
anchors {
|
||||||
@ -515,26 +515,24 @@ QtObject {
|
|||||||
TextField {
|
TextField {
|
||||||
id: valueLabel
|
id: valueLabel
|
||||||
property string maxValue: control.maximumValue + 1
|
property string maxValue: control.maximumValue + 1
|
||||||
placeholderText: control.value + 1
|
text: control.value + 1
|
||||||
|
horizontalAlignment: TextInput.AlignHCenter
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
if (valueLabel.text != ''){
|
if (valueLabel.text != ''){
|
||||||
control.value = valueLabel.text - 1
|
control.value = valueLabel.text - 1
|
||||||
valueLabel.text = ''
|
|
||||||
valueLabel.focus = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
validator: IntValidator {bottom: 1; top: control.maximumValue + 1;}
|
validator: IntValidator {bottom: 1; top: control.maximumValue + 1;}
|
||||||
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
|
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
|
||||||
anchors.top: layerSliderControl.bottom
|
anchors.top: layerSliderControl.bottom
|
||||||
anchors.topMargin: UM.Theme.sizes.default_margin.width
|
anchors.topMargin: width/2 - UM.Theme.sizes.default_margin.width/2
|
||||||
anchors.horizontalCenter: layerSliderControl.horizontalCenter
|
anchors.horizontalCenter: layerSliderControl.horizontalCenter
|
||||||
rotation: 90
|
rotation: 90
|
||||||
style: TextFieldStyle{
|
style: TextFieldStyle{
|
||||||
textColor: UM.Theme.colors.setting_control_text;
|
textColor: UM.Theme.colors.setting_control_text;
|
||||||
font: UM.Theme.fonts.default;
|
font: UM.Theme.fonts.default;
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: control.maxValue.length * valueLabel.font.pixelSize
|
implicitWidth: control.maxValue.length * valueLabel.font.pixelSize + UM.Theme.sizes.default_margin.width
|
||||||
implicitHeight: UM.Theme.sizes.slider_handle.height + UM.Theme.sizes.default_margin.width
|
implicitHeight: UM.Theme.sizes.slider_handle.height + UM.Theme.sizes.default_margin.width
|
||||||
border.width: UM.Theme.sizes.default_lining.width;
|
border.width: UM.Theme.sizes.default_lining.width;
|
||||||
border.color: UM.Theme.colors.slider_groove_border;
|
border.color: UM.Theme.colors.slider_groove_border;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user