mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-10-10 15:27:53 -06:00
15.10 restyling of the layerview slider
Adds a textfield to the handle for per layer selection and removes the display of the min- and maxvalue Contributes to: issue CURA-60
This commit is contained in:
parent
96c63ef6e9
commit
534c277b00
4 changed files with 44 additions and 51 deletions
|
@ -67,10 +67,10 @@ QtObject {
|
|||
|
||||
Rectangle {
|
||||
id: tool_button_background
|
||||
anchors.top: parent.verticalCenter;
|
||||
anchors.top: parent.bottom
|
||||
|
||||
width: parent.width;
|
||||
height: control.hovered ? parent.height / 2 + label.height : 0;
|
||||
width: label.width > parent.width ? label.width : parent.width
|
||||
height: control.hovered ? label.height : 0;
|
||||
Behavior on height { NumberAnimation { duration: 100; } }
|
||||
|
||||
opacity: control.hovered ? 1.0 : 0.0;
|
||||
|
@ -416,26 +416,6 @@ QtObject {
|
|||
color: UM.Theme.colors.slider_groove_fill;
|
||||
width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width;
|
||||
}
|
||||
Label {
|
||||
id: maxValueLabel
|
||||
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
|
||||
text: control.maximumValue + 1
|
||||
font: control.maximumValue > 998 ? UM.Theme.fonts.small : UM.Theme.fonts.default
|
||||
transformOrigin: Item.BottomLeft
|
||||
rotation: 90
|
||||
x: parent.x + parent.width - maxValueLabel.height
|
||||
y: control.maximumValue > 998 ? parent.y + UM.Theme.sizes.slider_layerview_smalltext_margin.width : parent.y
|
||||
}
|
||||
Label {
|
||||
id: minValueLabel
|
||||
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
|
||||
text: '1'
|
||||
font: control.maximumValue > 998 ? UM.Theme.fonts.small : UM.Theme.fonts.default
|
||||
transformOrigin: Item.BottomLeft
|
||||
rotation: 90
|
||||
x: parent.x
|
||||
y: control.maximumValue > 998 ? parent.y + UM.Theme.sizes.slider_layerview_smalltext_margin.width : parent.y
|
||||
}
|
||||
}
|
||||
handle: Rectangle {
|
||||
id: layerSliderControl
|
||||
|
@ -443,26 +423,37 @@ QtObject {
|
|||
height: UM.Theme.sizes.slider_handle.height;
|
||||
color: control.hovered ? UM.Theme.colors.slider_handle_hover : UM.Theme.colors.slider_handle;
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
Label {
|
||||
TextField {
|
||||
id: valueLabel
|
||||
property int unremovableSpacing: 5
|
||||
property string maxValue: control.maximumValue + 1
|
||||
placeholderText: control.value + 1
|
||||
onEditingFinished: {
|
||||
if (valueLabel.text != ''){
|
||||
control.value = valueLabel.text - 1
|
||||
valueLabel.text = ''
|
||||
valueLabel.focus = false
|
||||
}
|
||||
|
||||
}
|
||||
validator: IntValidator {bottom: 1; top: control.maximumValue + 1;}
|
||||
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
|
||||
text: control.value + 1
|
||||
anchors.bottom: layerSliderControl.bottom
|
||||
anchors.right: layerSliderControl.left
|
||||
anchors.bottomMargin: parent.width + UM.Theme.sizes.default_margin.width
|
||||
font: UM.Theme.fonts.default
|
||||
anchors.rightMargin: valueLabel.unremovableSpacing / 2
|
||||
anchors.bottomMargin: parent.width + (UM.Theme.sizes.default_margin.width / 2)
|
||||
transformOrigin: Item.BottomRight
|
||||
rotation: 90
|
||||
Rectangle {
|
||||
width: (parent.width + UM.Theme.sizes.tooltip_margins.width) < 35 ? 35 : parent.width + UM.Theme.sizes.tooltip_margins.width
|
||||
height: parent.height + (UM.Theme.sizes.tooltip_margins.height / 2)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
z: parent.z - 1
|
||||
color: UM.Theme.colors.slider_text_background
|
||||
border.width: 1
|
||||
border.color: UM.Theme.colors.slider_groove_fill;
|
||||
|
||||
style: TextFieldStyle{
|
||||
textColor: UM.Theme.colors.setting_control_text;
|
||||
font: UM.Theme.fonts.default;
|
||||
background: Rectangle {
|
||||
radius: 0
|
||||
implicitWidth: control.maxValue.length * valueLabel.font.pixelSize
|
||||
implicitHeight: UM.Theme.sizes.slider_handle.height + valueLabel.unremovableSpacing
|
||||
border.width: 1;
|
||||
border.color: UM.Theme.colors.slider_groove_border;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue