From 101df0035d4c253638293793b1b2ca207ed654ae Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 19 Nov 2015 14:06:29 +0100 Subject: [PATCH] Restyle simple mode Infill controls Tweak scrollbar colors --- resources/qml/SidebarSimple.qml | 29 +++++++++++++++++------------ resources/themes/cura/styles.qml | 2 +- resources/themes/cura/theme.json | 11 ++++++----- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 07657b02de..ea3a41c09d 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -41,7 +41,7 @@ Item } Label{ id: infillCaption - width: infillCellLeft.width - UM.Theme.sizes.default_margin.width + width: infillCellLeft.width - UM.Theme.sizes.default_margin.width * 2 text: infillModel.count > 0 && infillListView.activeIndex != -1 ? infillModel.get(infillListView.activeIndex).text : "" font: UM.Theme.fonts.caption wrapMode: Text.Wrap @@ -57,10 +57,9 @@ Item height: childrenRect.height; width: base.width / 100 * 55 - spacing: 12 + spacing: UM.Theme.sizes.default_margin.width - anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width - (UM.Theme.sizes.default_margin.width/4) + anchors.left: infillCellLeft.right anchors.top: parent.top anchors.topMargin: UM.Theme.sizes.default_margin.height @@ -92,29 +91,35 @@ Item Rectangle{ id: infillIconLining - width: infillCellRight.width / 3 - UM.Theme.sizes.default_margin.width; + width: (infillCellRight.width - 2 * UM.Theme.sizes.default_margin.width) / 3; height: width - border.color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_text : UM.Theme.colors.setting_control_border - border.width: infillListView.activeIndex == index ? 2 : 1 - color: infillListView.activeIndex == index ? UM.Theme.colors.setting_category_active : "transparent" + border.color: (infillListView.activeIndex == index) ? UM.Theme.colors.setting_control_selected : + (parent.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border) + border.width: UM.Theme.sizes.default_lining.width + color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_selected : "transparent" - Image { + UM.RecolorImage { id: infillIcon anchors.fill: parent; - anchors.margins: UM.Theme.sizes.default_margin.width / 2 + anchors.margins: UM.Theme.sizes.default_margin.width sourceSize.width: width sourceSize.height: width source: UM.Theme.icons[model.icon]; + color: (infillListView.activeIndex == index) ? UM.Theme.colors.text_white : UM.Theme.colors.text } MouseArea { anchors.fill: parent onClicked: { - infillListView.activeIndex = index - UM.MachineManager.setSettingValue("infill_sparse_density", model.percentage) + if (infillListView.activeIndex != index) + { + infillListView.activeIndex = index + UM.MachineManager.setSettingValue("infill_sparse_density", model.percentage) + } } + cursorShape: (infillListView.activeIndex != index) ? Qt.PointingHandCursor : Qt.ArrowCursor } } Label{ diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 9eb7c5f156..d1520f318d 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -13,7 +13,7 @@ QtObject { background: Rectangle { color: UM.Theme.colors.setting_control border.width: 1 - border.color: UM.Theme.colors.setting_control_border + border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border UM.RecolorImage { id: downArrow anchors.verticalCenter: parent.verticalCenter diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 644d6d3f05..3e52fe0427 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -100,19 +100,20 @@ "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], - "scrollbar_handle_hover": [174, 174, 174, 255], + "scrollbar_background": [255, 255, 255, 255], + "scrollbar_handle": [24, 41, 77, 255], + "scrollbar_handle_hover": [12, 159, 227, 255], "scrollbar_handle_down": [12, 159, 227, 255], "setting_category": [255, 255, 255, 255], "setting_category_disabled": [255, 255, 255, 255], "setting_category_hover": [245, 245, 245, 255], - "setting_category_active": [240, 248, 255, 255], - "setting_category_active_hover": [233, 244, 245, 255], + "setting_category_active": [255, 255, 255, 255], + "setting_category_active_hover": [245, 245, 245, 255], "setting_category_text": [24, 41, 77, 255], "setting_control": [255, 255, 255, 255], + "setting_control_selected": [24, 41, 77, 255], "setting_control_highlight": [255, 255, 255, 0], "setting_control_border": [127, 127, 127, 255], "setting_control_border_highlight": [12, 169, 227, 255],