mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:29:01 +08:00
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:
parent
74cf027421
commit
5f24b70453
@ -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"))
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user