From 7e4f1dce7bf030e4118cd29fefa1854c3e2a859b Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 21 Nov 2016 23:29:18 +0100 Subject: [PATCH] Add button for toggling the find settings textbox The toggle is only shown when advanced mode is selected. --- resources/qml/Sidebar.qml | 38 +++++++++++++++++++++++++- resources/themes/cura/icons/search.svg | 4 +++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 resources/themes/cura/icons/search.svg diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 1c1eb5e5a0..a74b684213 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -214,7 +214,7 @@ Rectangle anchors.left: parent.left anchors.leftMargin: model.index * (settingsModeSelection.width / 2) anchors.verticalCenter: parent.verticalCenter - width: parent.width / 2 + width: 0.5 * parent.width - (index == 1 ? toggleFilterButton.width : 0) text: model.text exclusiveGroup: modeMenuGroup; checkable: true; @@ -256,6 +256,42 @@ Rectangle } } + Button + { + id: toggleFilterButton + + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width + anchors.top: headerSeparator.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + + height: settingsModeSelection.height + width: visible ? height : 0 + + visible: !monitoringPrint && base.currentModeIndex == 1 + opacity: visible ? 1 : 0 + + style: ButtonStyle + { + background: Rectangle + { + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("toggle_checked_border") + color: visible ? UM.Theme.getColor("toggle_checked") : UM.Theme.getColor("toggle_hovered") + Behavior on color { ColorAnimation { duration: 50; } } + } + label: UM.RecolorImage + { + anchors.verticalCenter: control.verticalCenter + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2 + + source: UM.Theme.getIcon("search") + color: UM.Theme.getColor("toggle_checked_text") + } + } + } + Label { id: monitorLabel text: catalog.i18nc("@label","Printer Monitor"); diff --git a/resources/themes/cura/icons/search.svg b/resources/themes/cura/icons/search.svg new file mode 100644 index 0000000000..8272991300 --- /dev/null +++ b/resources/themes/cura/icons/search.svg @@ -0,0 +1,4 @@ + + +