mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-03 01:04:35 +08:00
implements the new load file button styling
(so that the mouse-over label can be translated..). The final icon will be added later. Contributes to: issue CURA-129
This commit is contained in:
parent
096065a441
commit
7ef41d1556
@ -301,7 +301,7 @@ UM.MainWindow
|
||||
//style: UM.Theme.styles.open_file_button
|
||||
text: catalog.i18nc("@action:button","Open File");
|
||||
iconSource: UM.Theme.icons.open
|
||||
style: UM.Theme.styles.tool_button;
|
||||
style: UM.Theme.styles.open_file_button
|
||||
tooltip: '';
|
||||
anchors
|
||||
{
|
||||
|
@ -56,23 +56,39 @@ QtObject {
|
||||
property Component open_file_button: Component {
|
||||
ButtonStyle {
|
||||
background: Item{
|
||||
implicitWidth: UM.Theme.sizes.loadfile_button.width
|
||||
implicitHeight: UM.Theme.sizes.loadfile_button.height
|
||||
implicitWidth: UM.Theme.sizes.button.width;
|
||||
implicitHeight: UM.Theme.sizes.button.width;
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
anchors.left: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: "white"
|
||||
width: control.hovered ? openFileLabel.width : 0;
|
||||
height: openFileLabel.height
|
||||
Behavior on width { NumberAnimation { duration: 100; } }
|
||||
opacity: control.hovered ? 1.0 : 0.0;
|
||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||
Label {
|
||||
id: openFileLabel
|
||||
anchors.bottom: parent.bottom
|
||||
text: control.text
|
||||
font: UM.Theme.fonts.button_tooltip;
|
||||
color: UM.Theme.colors.button_tooltip_text;
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent;
|
||||
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
}
|
||||
Label {
|
||||
anchors.centerIn: parent
|
||||
text: control.text
|
||||
color: UM.Theme.colors.load_save_button_text
|
||||
font: UM.Theme.fonts.default
|
||||
}
|
||||
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;
|
||||
}
|
||||
label: Label{
|
||||
visible: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user