mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 04:55:54 +08:00
Makes the openfile button blue/active as long as there is no file loaded.
This is to make the UI more intuitive. Contributes to #43
This commit is contained in:
parent
4bd5aeda6a
commit
6add467477
@ -37,9 +37,30 @@ QtObject {
|
|||||||
|
|
||||||
property Component open_file_button: Component {
|
property Component open_file_button: Component {
|
||||||
ButtonStyle {
|
ButtonStyle {
|
||||||
background: UM.AngledCornerRectangle {
|
background: Item {
|
||||||
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 {
|
||||||
|
anchors.bottom: parent.verticalCenter;
|
||||||
|
width: parent.width;
|
||||||
|
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.button_active_hover;
|
||||||
@ -49,24 +70,6 @@ QtObject {
|
|||||||
}
|
}
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
cornerSize: UM.Theme.sizes.default_margin.width;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user