From 2df2c9c6c8d20bdb2a6480fbc800e6f609fb7dec Mon Sep 17 00:00:00 2001 From: Tamara Hogenhout Date: Wed, 19 Aug 2015 14:52:38 +0200 Subject: [PATCH] 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 --- resources/qml/Cura.qml | 10 +++--- resources/themes/cura/styles.qml | 54 ++++++++++---------------------- resources/themes/cura/theme.json | 7 +++++ 3 files changed, 27 insertions(+), 44 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index f01c3989b9..24fb33490f 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -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; } diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 77b1d2852e..4f2ab10422 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -35,54 +35,32 @@ QtObject { } } - property Component open_file_button: Component { + 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 } } } diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index b600db1c2c..af626895ed 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -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],