Reorient LayerView slider

Fix toolbar tooltip collisions
Refactor use of colors.text_default
This commit is contained in:
fieldOfView 2015-11-18 14:59:02 +01:00
parent a1123655ff
commit 2477617155
7 changed files with 40 additions and 45 deletions

View file

@ -10,14 +10,14 @@ import UM 1.0 as UM
Item Item
{ {
width: 250 width: UM.Theme.sizes.button.width
height: 250 height: UM.Theme.sizes.slider_layerview_size.height
Slider Slider
{ {
id: slider id: slider
width: 10 width: UM.Theme.sizes.slider_layerview_size.width
height: 250 height: UM.Theme.sizes.slider_layerview_size.height
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.slider_layerview_margin.width/2 anchors.leftMargin: UM.Theme.sizes.slider_layerview_margin.width/2
orientation: Qt.Vertical orientation: Qt.Vertical
@ -30,14 +30,6 @@ Item
style: UM.Theme.styles.layerViewSlider style: UM.Theme.styles.layerViewSlider
} }
Rectangle {
anchors.left: parent.left
y: -UM.Theme.sizes.slider_layerview_background_extension.height
z: slider.z - 1
width: UM.Theme.sizes.button.width
height: UM.Theme.sizes.slider_layerview_background_extension.height
color: UM.Theme.colors.slider_text_background
}
Rectangle { Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter

View file

@ -81,7 +81,7 @@ Item{
text: catalog.i18nc("@label","Global Profile:"); text: catalog.i18nc("@label","Global Profile:");
width: parent.width/100*45 width: parent.width/100*45
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default; color: UM.Theme.colors.text;
} }

View file

@ -52,7 +52,7 @@ Item
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default; color: UM.Theme.colors.text;
} }
ToolButton { ToolButton {

View file

@ -33,7 +33,7 @@ Item
//: Infill selection label //: Infill selection label
text: catalog.i18nc("@label","Infill:"); text: catalog.i18nc("@label","Infill:");
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default; color: UM.Theme.colors.text;
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left anchors.left: parent.left
@ -168,7 +168,7 @@ Item
//: Helpers selection label //: Helpers selection label
text: catalog.i18nc("@label:listbox","Helpers:"); text: catalog.i18nc("@label:listbox","Helpers:");
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default; color: UM.Theme.colors.text;
} }
} }
Rectangle { Rectangle {

View file

@ -47,6 +47,6 @@ Rectangle {
} }
wrapMode: Text.Wrap; wrapMode: Text.Wrap;
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default; color: UM.Theme.colors.text;
} }
} }

View file

@ -59,18 +59,22 @@ QtObject {
implicitWidth: UM.Theme.sizes.button.width; implicitWidth: UM.Theme.sizes.button.width;
implicitHeight: UM.Theme.sizes.button.height; implicitHeight: UM.Theme.sizes.button.height;
Rectangle { Rectangle {
anchors.left: parent.right id: tool_button_background
anchors.verticalCenter: parent.verticalCenter anchors.top: parent.verticalCenter;
color: UM.Theme.colors.button_text
width: control.hovered ? openFileLabel.width : 0; width: parent.width;
height: openFileLabel.height height: control.hovered ? parent.height / 2 + label.height : 0;
Behavior on width { NumberAnimation { duration: 100; } } Behavior on height { NumberAnimation { duration: 100; } }
opacity: control.hovered ? 1.0 : 0.0; opacity: control.hovered ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 100; } } Behavior on opacity { NumberAnimation { duration: 100; } }
Label { Label {
id: openFileLabel id: label
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: control.text text: control.text
width: UM.Theme.sizes.button.width;
wrapMode: Text.WordWrap
font: UM.Theme.fonts.button_tooltip; font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text; color: UM.Theme.colors.button_tooltip_text;
} }
@ -357,12 +361,14 @@ QtObject {
scrollBarBackground: Rectangle { scrollBarBackground: Rectangle {
implicitWidth: UM.Theme.sizes.scrollbar.width implicitWidth: UM.Theme.sizes.scrollbar.width
radius: implicitWidth / 2
color: UM.Theme.colors.scrollbar_background; color: UM.Theme.colors.scrollbar_background;
} }
handle: Rectangle { handle: Rectangle {
id: scrollViewHandle id: scrollViewHandle
implicitWidth: UM.Theme.sizes.scrollbar.width; implicitWidth: UM.Theme.sizes.scrollbar.width;
radius: implicitWidth / 2
color: styleData.pressed ? UM.Theme.colors.scrollbar_handle_down : styleData.hovered ? UM.Theme.colors.scrollbar_handle_hover : UM.Theme.colors.scrollbar_handle; color: styleData.pressed ? UM.Theme.colors.scrollbar_handle_down : styleData.hovered ? UM.Theme.colors.scrollbar_handle_hover : UM.Theme.colors.scrollbar_handle;
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
@ -463,9 +469,10 @@ QtObject {
id: layerSliderGroove id: layerSliderGroove
implicitWidth: control.width; implicitWidth: control.width;
implicitHeight: UM.Theme.sizes.slider_groove.height; implicitHeight: UM.Theme.sizes.slider_groove.height;
radius: width/2;
color: UM.Theme.colors.slider_groove; color: UM.Theme.colors.slider_groove;
border.width: 1; border.width: UM.Theme.sizes.default_lining;
border.color: UM.Theme.colors.slider_groove_border; border.color: UM.Theme.colors.slider_groove_border;
Rectangle { Rectangle {
anchors { anchors {
@ -475,6 +482,7 @@ QtObject {
} }
color: UM.Theme.colors.slider_groove_fill; color: UM.Theme.colors.slider_groove_fill;
width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width; width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width;
radius: width/2
} }
} }
handle: Rectangle { handle: Rectangle {
@ -485,7 +493,6 @@ QtObject {
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
TextField { TextField {
id: valueLabel id: valueLabel
property int unremovableSpacing: 5
property string maxValue: control.maximumValue + 1 property string maxValue: control.maximumValue + 1
placeholderText: control.value + 1 placeholderText: control.value + 1
onEditingFinished: { onEditingFinished: {
@ -498,19 +505,16 @@ QtObject {
} }
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.bottom: layerSliderControl.bottom anchors.top: layerSliderControl.bottom
anchors.right: layerSliderControl.left anchors.topMargin: UM.Theme.sizes.default_margin.width
anchors.rightMargin: valueLabel.unremovableSpacing / 2 anchors.horizontalCenter: layerSliderControl.horizontalCenter
anchors.bottomMargin: parent.width + (UM.Theme.sizes.default_margin.width / 2)
transformOrigin: Item.BottomRight
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 {
radius: 0
implicitWidth: control.maxValue.length * valueLabel.font.pixelSize implicitWidth: control.maxValue.length * valueLabel.font.pixelSize
implicitHeight: UM.Theme.sizes.slider_handle.height + valueLabel.unremovableSpacing implicitHeight: UM.Theme.sizes.slider_handle.height + UM.Theme.sizes.default_margin.width
border.width: 1; border.width: 1;
border.color: UM.Theme.colors.slider_groove_border; border.color: UM.Theme.colors.slider_groove_border;
} }

View file

@ -45,21 +45,20 @@
}, },
"colors": { "colors": {
"text_default": [0, 0, 0, 255],
"sidebar": [255, 255, 255, 255], "sidebar": [255, 255, 255, 255],
"lining": [208, 210, 211, 255], "lining": [127, 127, 127, 255],
"primary": [12, 169, 227, 255], "primary": [12, 169, 227, 255],
"primary_hover": [34, 150, 190, 255], "primary_hover": [48, 182, 231, 255],
"primary_text": [255, 255, 255, 255], "primary_text": [255, 255, 255, 255],
"border": [127, 127, 127, 255], "border": [127, 127, 127, 255],
"secondary": [205, 202, 201, 255], "secondary": [245, 245, 245, 255],
"text": [24, 41, 77, 255], "text": [24, 41, 77, 255],
"text_inactive": [174, 174, 174, 255], "text_inactive": [174, 174, 174, 255],
"text_white": [255, 255, 255, 255],
"text_hover": [35, 35, 35, 255], "text_hover": [35, 35, 35, 255],
"text_pressed": [12, 169, 227, 255], "text_pressed": [12, 169, 227, 255],
"text_white": [255, 255, 255, 255],
"text_subtext": [127, 127, 127, 255], "text_subtext": [127, 127, 127, 255],
"error": [255, 140, 0, 255], "error": [255, 140, 0, 255],
@ -118,10 +117,10 @@
"setting_control_border": [127, 127, 127, 255], "setting_control_border": [127, 127, 127, 255],
"setting_control_text": [24,41,77, 255], "setting_control_text": [24,41,77, 255],
"setting_control_depth_line": [162, 192, 227, 255], "setting_control_depth_line": [162, 192, 227, 255],
"setting_control_hover": [139, 143, 153, 255], "setting_control_hover": [127, 127, 127, 255],
"setting_control_selected": [35, 35, 35, 255], "setting_control_selected": [35, 35, 35, 255],
"setting_control_revert": [127, 127, 127, 255], "setting_control_revert": [127, 127, 127, 255],
"setting_unit": [174, 174, 174, 255], "setting_unit": [127, 127, 127, 255],
"setting_validation_error": [255, 57, 14, 255], "setting_validation_error": [255, 57, 14, 255],
"setting_validation_warning": [255, 186, 15, 255], "setting_validation_warning": [255, 186, 15, 255],
"setting_validation_ok": [255, 255, 255, 255], "setting_validation_ok": [255, 255, 255, 255],
@ -130,8 +129,8 @@
"progressbar_control": [24, 41, 77, 255], "progressbar_control": [24, 41, 77, 255],
"slider_groove": [245, 245, 245, 255], "slider_groove": [245, 245, 245, 255],
"slider_groove_border": [139, 143, 153, 255], "slider_groove_border": [127, 127, 127, 255],
"slider_groove_fill": [139, 143, 153, 255], "slider_groove_fill": [127, 127, 127, 255],
"slider_handle": [32, 166, 219, 255], "slider_handle": [32, 166, 219, 255],
"slider_handle_hover": [77, 182, 226, 255], "slider_handle_hover": [77, 182, 226, 255],
"slider_text_background": [255, 255, 255, 255], "slider_text_background": [255, 255, 255, 255],
@ -146,12 +145,12 @@
"message_background": [255, 255, 255, 255], "message_background": [255, 255, 255, 255],
"message_text": [32, 166, 219, 255], "message_text": [32, 166, 219, 255],
"message_dismiss": [139, 143, 153, 255], "message_dismiss": [127, 127, 127, 255],
"tool_panel_background": [255, 255, 255, 255], "tool_panel_background": [255, 255, 255, 255],
"per_object_settings_panel_background": [255, 255, 255, 255], "per_object_settings_panel_background": [255, 255, 255, 255],
"per_object_settings_panel_border": [208, 210, 211, 255] "per_object_settings_panel_border": [127, 127, 127, 255]
}, },
"sizes": { "sizes": {
@ -198,9 +197,9 @@
"slider_groove": [0.5, 0.5], "slider_groove": [0.5, 0.5],
"slider_handle": [1.5, 1.5], "slider_handle": [1.5, 1.5],
"slider_layerview_size": [1.0, 20.0],
"slider_layerview_background": [4.0, 0.0], "slider_layerview_background": [4.0, 0.0],
"slider_layerview_smalltext_margin": [0.3, 0.00], "slider_layerview_smalltext_margin": [0.3, 0.00],
"slider_layerview_background_extension": [0.0, 2.2],
"slider_layerview_margin": [3.0, 3.0], "slider_layerview_margin": [3.0, 3.0],
"checkbox": [2.0, 2.0], "checkbox": [2.0, 2.0],