mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 15:38:59 +08:00
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:
parent
43aee84f12
commit
2df2c9c6c8
@ -239,17 +239,15 @@ UM.MainWindow {
|
||||
|
||||
Button {
|
||||
id: openFileButton;
|
||||
|
||||
iconSource: UM.Theme.icons.open;
|
||||
style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
|
||||
//style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
|
||||
style: UM.Theme.styles.open_file_button
|
||||
tooltip: '';
|
||||
anchors {
|
||||
top: parent.top;
|
||||
topMargin: UM.Theme.sizes.window_margin.height;
|
||||
topMargin: UM.Theme.sizes.loadfile_margin.height
|
||||
left: parent.left;
|
||||
leftMargin: UM.Theme.sizes.window_margin.width;
|
||||
leftMargin: UM.Theme.sizes.loadfile_margin.width
|
||||
}
|
||||
|
||||
action: actions.open;
|
||||
}
|
||||
|
||||
|
@ -37,52 +37,30 @@ QtObject {
|
||||
|
||||
property Component open_file_button: Component {
|
||||
ButtonStyle {
|
||||
background: Item {
|
||||
implicitWidth: UM.Theme.sizes.button.width;
|
||||
implicitHeight: UM.Theme.sizes.button.height;
|
||||
|
||||
background: Item{
|
||||
implicitWidth: UM.Theme.sizes.loadfile_button.width
|
||||
implicitHeight: UM.Theme.sizes.loadfile_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;
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: {
|
||||
if(control.hovered) {
|
||||
return UM.Theme.colors.button_active_hover;
|
||||
return UM.Theme.colors.open_file_button_hover
|
||||
} else {
|
||||
return UM.Theme.colors.button_active;
|
||||
return UM.Theme.colors.open_file_button
|
||||
}
|
||||
}
|
||||
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: 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,10 @@
|
||||
"button_disabled": [245, 245, 245, 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_handle": [205, 202, 201, 255],
|
||||
"scrollbar_handle_hover": [174, 174, 174, 255],
|
||||
@ -140,6 +144,9 @@
|
||||
"toolbar_button": [2.0, 2.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_icon": [2.14, 2.14],
|
||||
"section_text_margin": [0.33, 0.33],
|
||||
|
Loading…
x
Reference in New Issue
Block a user