Highlight Open button when no files are loaded

This helps with first-run to make it clear where to start.

Fixes #37
This commit is contained in:
Tamara Hogenhout 2015-06-10 14:57:37 +02:00
parent 74cf027421
commit 5f24b70453
2 changed files with 51 additions and 1 deletions

View File

@ -192,7 +192,7 @@ UM.MainWindow {
id: openFileButton;
iconSource: UM.Theme.icons.open;
style: UM.Theme.styles.tool_button;
style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
anchors {
top: parent.top;
@ -433,3 +433,4 @@ UM.MainWindow {
Component.onCompleted: UM.Theme.load(UM.Resources.getPath(UM.Resources.ThemesLocation, "cura"))
}

View File

@ -35,6 +35,55 @@ QtObject {
}
}
property Component open_file_button: Component {
ButtonStyle {
background: UM.AngledCornerRectangle {
implicitWidth: UM.Theme.sizes.button.width;
implicitHeight: UM.Theme.sizes.button.height;
color: {
if(control.hovered) {
return UM.Theme.colors.button_active_hover;
} else {
return UM.Theme.colors.button_active;
}
}
Behavior on color { ColorAnimation { duration: 50; } }
cornerSize: UM.Theme.sizes.default_margin.width;
Rectangle {
anchors.bottom: parent.top;
width: parent.width;
height: control.hovered ? label.height : 0;
Behavior on height { NumberAnimation { duration: 75; } }
opacity: control.hovered ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 75; } }
Label {
id: label
anchors.horizontalCenter: parent.horizontalCenter;
text: control.text;
font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text;
}
}
}
label: Item {
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;
}
}
}
}
property Component tool_button: Component {
ButtonStyle {
background: UM.AngledCornerRectangle {