Adds layer count

Brings back the layer count, the min & max. And it does not display these untill Cura is done slicing.

Fixes #117
This commit is contained in:
Tamara Hogenhout 2015-07-08 18:01:03 +02:00
parent ef86eb480f
commit 53a94c23e1
5 changed files with 90 additions and 5 deletions

View file

@ -272,6 +272,7 @@ QtObject {
}
handle: UM.AngledCornerRectangle {
id: scrollViewHandle
implicitWidth: UM.Theme.sizes.scrollbar.width;
cornerSize: UM.Theme.sizes.scrollbar.width;
@ -367,6 +368,72 @@ QtObject {
}
}
property Component layerViewSlider: Component {
SliderStyle {
groove: Rectangle {
id: layerSliderGroove
implicitWidth: control.width;
implicitHeight: UM.Theme.sizes.slider_groove.height;
color: UM.Theme.colors.slider_groove;
border.width: 1;
border.color: UM.Theme.colors.slider_groove_border;
Rectangle {
anchors {
left: parent.left;
top: parent.top;
bottom: parent.bottom;
}
color: UM.Theme.colors.slider_groove_fill;
width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width;
}
Label {
id: maxValueLabel
text: control.maximumValue + 1
transformOrigin: Item.BottomLeft
rotation: 90
x: parent.x + parent.width - maxValueLabel.height
y: parent.y
}
Label {
id: minValueLabel
text: '1'
transformOrigin: Item.BottomLeft
rotation: 90
x: parent.x
y: parent.y
}
}
handle: Rectangle {
id: layerSliderControl
width: UM.Theme.sizes.slider_handle.width;
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 {
id: valueLabel
text: control.value + 1
anchors.bottom: layerSliderControl.bottom
anchors.right: layerSliderControl.left
anchors.bottomMargin: parent.width + UM.Theme.sizes.default_margin.width
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
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;
}
}
}
}
}
property Component text_field: Component {
TextFieldStyle {
textColor: UM.Theme.colors.setting_control_text;

View file

@ -100,6 +100,7 @@
"slider_groove_fill": [160, 163, 171, 255],
"slider_handle": [12, 169, 227, 255],
"slider_handle_hover": [34, 150, 190, 255],
"slider_text_background": [255, 255, 255, 255],
"checkbox": [255, 255, 255, 255],
"checkbox_hover": [245, 245, 245, 255],