From 211b45d9fb4dd2f0713bd2b734e0b809124db6a4 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 12 Nov 2015 08:16:34 +0100 Subject: [PATCH] Remove "specs" from Save Button Restyle Save Button Tweak Simple mode --- resources/qml/SaveButton.qml | 56 +++++++++++++++----------------- resources/qml/Sidebar.qml | 13 ++++---- resources/qml/SidebarSimple.qml | 6 ++-- resources/themes/cura/styles.qml | 17 ++++++---- resources/themes/cura/theme.json | 41 +++++++++++++---------- 5 files changed, 71 insertions(+), 62 deletions(-) diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index 70b43ffb72..445203372e 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -14,7 +14,7 @@ Rectangle { property real progress: UM.Backend.progress; property bool activity: Printer.getPlatformActivity; Behavior on progress { NumberAnimation { duration: 250; } } - property int totalHeight: childrenRect.height + property int totalHeight: childrenRect.height + UM.Theme.sizes.default_margin.height*1.5 property string fileBaseName property variant activeMachineInstance: UM.MachineManager.activeMachineInstance @@ -48,7 +48,7 @@ Rectangle { } } } - printJobTextfield.text = abbrMachine + '_' + base.fileBaseName + //printJobTextfield.text = abbrMachine + '_' + base.fileBaseName } Connections { @@ -67,7 +67,7 @@ Rectangle { base.createFileName() } } - +/* Rectangle{ id: printJobRow implicitWidth: base.width; @@ -179,12 +179,13 @@ Rectangle { } } } - +*/ Rectangle{ id: saveRow width: base.width height: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin - anchors.top: specsRow.bottom + anchors.top: parent.top + anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.left: parent.left Button { @@ -206,16 +207,12 @@ Rectangle { background: Rectangle { //opacity: control.enabled ? 1.0 : 0.5 //Behavior on opacity { NumberAnimation { duration: 50; } } - color: { - if(!control.enabled){ - return UM.Theme.colors.button; - } - else if(control.enabled && control.hovered) { - return UM.Theme.colors.load_save_button_hover - } else { - return UM.Theme.colors.load_save_button - } - } + border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border : + control.pressed ? UM.Theme.colors.action_button_active_border : + control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border + color: !control.enabled ? UM.Theme.colors.action_button_disabled : + control.pressed ? UM.Theme.colors.action_button_active : + control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button Behavior on color { ColorAnimation { duration: 50; } } width: { var w = 0; @@ -234,10 +231,11 @@ Rectangle { } Label { id: actualLabel - opacity: control.enabled ? 1.0 : 0.4 //Behavior on opacity { NumberAnimation { duration: 50; } } anchors.centerIn: parent - color: UM.Theme.colors.load_save_button_text + color: !control.enabled ? UM.Theme.colors.action_button_disabled_text : + control.pressed ? UM.Theme.colors.action_button_active_text : + control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text font: UM.Theme.fonts.default text: control.text; } @@ -260,16 +258,12 @@ Rectangle { style: ButtonStyle { background: Rectangle { id: deviceSelectionIcon - color: { - if(!control.enabled){ - return UM.Theme.colors.button; - } - else if(control.enabled && control.hovered) { - return UM.Theme.colors.load_save_button_hover - } else { - return UM.Theme.colors.load_save_button - } - } + border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border : + control.pressed ? UM.Theme.colors.action_button_active_border : + control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border + color: !control.enabled ? UM.Theme.colors.action_button_disabled : + control.pressed ? UM.Theme.colors.action_button_active : + control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button Behavior on color { ColorAnimation { duration: 50; } } anchors.left: parent.left anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2; @@ -282,9 +276,11 @@ Rectangle { width: UM.Theme.sizes.standard_arrow.width height: UM.Theme.sizes.standard_arrow.height sourceSize.width: width - sourceSize.height: width - color: UM.Theme.colors.load_save_button_text - source: UM.Theme.icons.arrow_bottom + sourceSize.height: height + color: !control.enabled ? UM.Theme.colors.action_button_disabled_text : + control.pressed ? UM.Theme.colors.action_button_active_text : + control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text; + source: UM.Theme.icons.arrow_bottom; } } label: Label{ } diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 2a5a176591..be5cae80ee 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -55,7 +55,8 @@ Rectangle ProfileSetup { id: profileItem manageProfilesAction: base.manageProfilesAction - anchors.top: header.bottom + anchors.top: settingsModeSelection.bottom + anchors.topMargin: UM.Theme.sizes.default_margin.height width: parent.width height: totalHeightProfileSetup } @@ -76,13 +77,13 @@ Rectangle Label { id: settingsModeLabel - text: catalog.i18nc("@label:listbox","Print Setup:"); + text: catalog.i18nc("@label:listbox","Setup"); anchors.left: parent.left anchors.leftMargin: UM.Theme.sizes.default_margin.width; - anchors.top: profileItem.bottom + anchors.top: header.bottom anchors.topMargin: UM.Theme.sizes.default_margin.height width: parent.width/100*45 - font: UM.Theme.fonts.default; + font: UM.Theme.fonts.large; color: UM.Theme.colors.text } @@ -92,7 +93,7 @@ Rectangle height: UM.Theme.sizes.sidebar_header_mode_toggle.height anchors.right: parent.right anchors.rightMargin: UM.Theme.sizes.default_margin.width - anchors.top: profileItem.bottom + anchors.top: header.bottom anchors.topMargin: UM.Theme.sizes.default_margin.height Component{ id: wizardDelegate @@ -145,7 +146,7 @@ Rectangle { id: sidebarContents; anchors.bottom: saveButton.top - anchors.top: settingsModeSelection.bottom + anchors.top: profileItem.bottom anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.left: base.left anchors.right: base.right diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index a16b0af225..0bc8deb5cd 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -25,7 +25,7 @@ Item id: infillCellLeft anchors.top: parent.top anchors.left: parent.left - width: base.width/100* 55 - UM.Theme.sizes.default_margin.width + width: base.width/100* 45 - UM.Theme.sizes.default_margin.width height: childrenRect.height < UM.Theme.sizes.simple_mode_infill_caption.height ? UM.Theme.sizes.simple_mode_infill_caption.height : childrenRect.height Label{ @@ -56,12 +56,14 @@ Item id: infillCellRight height: childrenRect.height; - width: base.width / 100 * 45 + width: base.width / 100 * 55 + spacing: 12 anchors.right: parent.right anchors.rightMargin: UM.Theme.sizes.default_margin.width - (UM.Theme.sizes.default_margin.width/4) anchors.top: parent.top anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.fill: width Repeater { id: infillListView diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 7d5a23348d..967b936883 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -407,13 +407,16 @@ QtObject { border.width: 1 border.color: UM.Theme.colors.checkbox_border; - Label { - anchors.centerIn: parent; - color: UM.Theme.colors.checkbox_mark; - - text: "✓"; - - opacity: control.checked ? 1 : 0; + UM.RecolorImage { + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width/2.5 + height: parent.height/2.5 + sourceSize.width: width + sourceSize.height: width + color: UM.Theme.colors.checkbox_mark + source: UM.Theme.icons.check + opacity: control.checked Behavior on opacity { NumberAnimation { duration: 100; } } } } diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 8a5e366150..c767c252e1 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -57,7 +57,7 @@ "primary": [12, 169, 227, 255], "primary_hover": [34, 150, 190, 255], "primary_text": [255, 255, 255, 255], - "border": [205, 202, 201, 255], + "border": [127, 127, 127, 255], "secondary": [205, 202, 201, 255], "text": [24, 41, 77, 255], @@ -91,11 +91,18 @@ "toggle_active_border": [32, 166, 219, 255], "toggle_active_text": [255, 255, 255, 255], - "load_save_button": [0, 0, 0, 255], - "load_save_button_text": [255, 255, 255, 255], - "load_save_button_hover": [43, 45, 46, 255], - "load_save_button_inactive": [176, 184, 191, 255], - "load_save_button_inactive_text": [209, 214, 219, 255], + "action_button": [255, 255, 255, 255], + "action_button_text": [24, 41, 77, 255], + "action_button_border": [127, 127, 127, 255], + "action_button_hovered": [255, 255, 255, 255], + "action_button_hovered_text": [24, 41, 77, 255], + "action_button_hovered_border": [12, 169, 227, 255], + "action_button_active": [12, 169, 227, 255], + "action_button_active_text": [255, 255, 255, 255], + "action_button_active_border": [12, 169, 227, 255], + "action_button_disabled": [245, 245, 245, 255], + "action_button_disabled_text": [127, 127, 127, 255], + "action_button_disabled_border": [127, 127, 127, 255], "scrollbar_background": [245, 245, 245, 255], "scrollbar_handle": [12, 159, 227, 255], @@ -111,19 +118,19 @@ "setting_control": [255, 255, 255, 255], "setting_control_highlight": [245, 245, 245, 255], - "setting_control_border": [174, 174, 174, 255], - "setting_control_text": [0, 0, 0, 255], + "setting_control_border": [127, 127, 127, 255], + "setting_control_text": [24,41,77, 255], "setting_control_depth_line": [162, 192, 227, 255], "setting_control_hover": [139, 143, 153, 255], "setting_control_selected": [35, 35, 35, 255], - "setting_control_revert": [85, 85, 85, 255], + "setting_control_revert": [127, 127, 127, 255], "setting_unit": [174, 174, 174, 255], "setting_validation_error": [255, 57, 14, 255], "setting_validation_warning": [255, 186, 15, 255], "setting_validation_ok": [255, 255, 255, 255], - "progressbar_background": [208, 210, 211, 255], - "progressbar_control": [12, 169, 227, 255], + "progressbar_background": [245, 245, 245, 255], + "progressbar_control": [24, 41, 77, 255], "slider_groove": [245, 245, 245, 255], "slider_groove_border": [139, 143, 153, 255], @@ -134,9 +141,9 @@ "checkbox": [255, 255, 255, 255], "checkbox_hover": [245, 245, 245, 255], - "checkbox_border": [174, 174, 174, 255], - "checkbox_mark": [35, 35, 35, 255], - "checkbox_text": [0, 0, 0, 255], + "checkbox_border": [127, 127, 127, 255], + "checkbox_mark": [24, 41, 77, 255], + "checkbox_text": [24, 41, 77, 255], "tooltip": [255, 225, 146, 255], @@ -153,12 +160,12 @@ "sizes": { "window_margin": [1.0, 1.0], "default_margin": [1.0, 1.0], - "default_lining": [0.1, 0.1], + "default_lining": [0.25, 0.25], "logo": [9.5, 2.0], "sidebar": [30.0, 10.0], "sidebar_header": [0.0, 4.0], - "sidebar_header_mode_toggle": [0.0, 2.4], + "sidebar_header_mode_toggle": [0.0, 2.0], "sidebar_setup": [0.0, 2.6], "sidebar_subParts": [0.0, 2.4], "sidebar_specs_bar": [0.0, 2.2], @@ -199,7 +206,7 @@ "slider_layerview_background_extension": [0.0, 2.2], "slider_layerview_margin": [3.0, 3.0], - "checkbox": [1.5, 1.5], + "checkbox": [2.0, 2.0], "tooltip": [20.0, 10.0], "tooltip_margins": [1.0, 1.0],