15.10 Changes the styling for the open file button

Everything related to the font is not changed yet, first we have to agree on the chosen font

Contributes to: issue CURA-60
This commit is contained in:
Tamara Hogenhout 2015-08-19 14:52:38 +02:00
parent 43aee84f12
commit 2df2c9c6c8
3 changed files with 27 additions and 44 deletions

View File

@ -239,17 +239,15 @@ UM.MainWindow {
Button { Button {
id: openFileButton; id: openFileButton;
//style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
iconSource: UM.Theme.icons.open; style: UM.Theme.styles.open_file_button
style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
tooltip: ''; tooltip: '';
anchors { anchors {
top: parent.top; top: parent.top;
topMargin: UM.Theme.sizes.window_margin.height; topMargin: UM.Theme.sizes.loadfile_margin.height
left: parent.left; left: parent.left;
leftMargin: UM.Theme.sizes.window_margin.width; leftMargin: UM.Theme.sizes.loadfile_margin.width
} }
action: actions.open; action: actions.open;
} }

View File

@ -35,54 +35,32 @@ QtObject {
} }
} }
property Component open_file_button: Component { property Component open_file_button: Component {
ButtonStyle { ButtonStyle {
background: Item { background: Item{
implicitWidth: UM.Theme.sizes.button.width; implicitWidth: UM.Theme.sizes.loadfile_button.width
implicitHeight: UM.Theme.sizes.button.height; implicitHeight: UM.Theme.sizes.loadfile_button.height
Rectangle { Rectangle {
anchors.bottom: parent.verticalCenter; width: parent.width
width: parent.width; height: parent.height
height: control.hovered ? parent.height / 2 + label.height : 0;
Behavior on height { NumberAnimation { duration: 100; } }
opacity: control.hovered ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 100; } }
Label {
id: label;
anchors.horizontalCenter: parent.horizontalCenter;
text: control.text.replace("&", "");
font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text;
}
}
UM.AngledCornerRectangle {
anchors.fill: parent;
color: { color: {
if(control.hovered) { if(control.hovered) {
return UM.Theme.colors.button_active_hover; return UM.Theme.colors.open_file_button_hover
} else { } else {
return UM.Theme.colors.button_active; return UM.Theme.colors.open_file_button
} }
} }
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
cornerSize: UM.Theme.sizes.default_margin.width; }
Label {
anchors.centerIn: parent
text: control.text
color: UM.Theme.colors.open_file_button_text
font: UM.Theme.fonts.default
} }
} }
label: Label{
label: Item { visible: false
Image {
anchors.centerIn: parent;
source: control.iconSource;
width: UM.Theme.sizes.button_icon.width;
height: UM.Theme.sizes.button_icon.height;
sourceSize: UM.Theme.sizes.button_icon;
}
} }
} }
} }

View File

@ -75,6 +75,10 @@
"button_disabled": [245, 245, 245, 255], "button_disabled": [245, 245, 245, 255],
"button_tooltip_text": [35, 35, 35, 255], "button_tooltip_text": [35, 35, 35, 255],
"open_file_button": [0, 0, 0, 255],
"open_file_button_text": [255, 255, 255, 255],
"open_file_button_hover": [43, 45, 46, 255],
"scrollbar_background": [245, 245, 245, 255], "scrollbar_background": [245, 245, 245, 255],
"scrollbar_handle": [205, 202, 201, 255], "scrollbar_handle": [205, 202, 201, 255],
"scrollbar_handle_hover": [174, 174, 174, 255], "scrollbar_handle_hover": [174, 174, 174, 255],
@ -140,6 +144,9 @@
"toolbar_button": [2.0, 2.0], "toolbar_button": [2.0, 2.0],
"toolbar_spacing": [1.0, 1.0], "toolbar_spacing": [1.0, 1.0],
"loadfile_button": [11.0, 2.4],
"loadfile_margin": [0.8, 0.4],
"section": [22.0, 3.0], "section": [22.0, 3.0],
"section_icon": [2.14, 2.14], "section_icon": [2.14, 2.14],
"section_text_margin": [0.33, 0.33], "section_text_margin": [0.33, 0.33],