From 207e48856d0512cc50b0e08033486a64604d392a Mon Sep 17 00:00:00 2001 From: Yasen Date: Wed, 31 Jul 2019 21:20:22 +0200 Subject: [PATCH] Custom Main Toolbar drawer visual improvements Drawer now affected by theme, consistent with the rest of the active elements. TODO: Add hover for desktop --- custom-example/res/Custom/Widgets/CustomToolBarButton.qml | 7 ++++--- custom-example/res/MainToolbar/CustomMainToolBar.qml | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/custom-example/res/Custom/Widgets/CustomToolBarButton.qml b/custom-example/res/Custom/Widgets/CustomToolBarButton.qml index cff1a0e..5e1aa93 100644 --- a/custom-example/res/Custom/Widgets/CustomToolBarButton.qml +++ b/custom-example/res/Custom/Widgets/CustomToolBarButton.qml @@ -22,7 +22,8 @@ Button { background: Rectangle { anchors.fill: parent - color: mouseArea.pressed ? qgcPal.buttonHighlight : Qt.rgba(0,0,0,0) + color: qgcPal.buttonHighlight + visible: (mouseArea.pressed || button.checked) } contentItem: Row { @@ -40,7 +41,7 @@ Button { width: height sourceSize.height: parent.height fillMode: Image.PreserveAspectFit - color: (mouseArea.pressed || button.checked) ? qgcPal.primaryButton : qgcPal.buttonText + color: qgcPal.buttonText source: button.icon.source anchors.verticalCenter: parent.verticalCenter } @@ -48,7 +49,7 @@ Button { id: _label visible: text !== "" text: button.text - color: (mouseArea.pressed || button.checked) ? qgcPal.primaryButton : qgcPal.buttonText + color: qgcPal.buttonText anchors.verticalCenter: parent.verticalCenter } } diff --git a/custom-example/res/MainToolbar/CustomMainToolBar.qml b/custom-example/res/MainToolbar/CustomMainToolBar.qml index 5072b0c..9b8d8a4 100644 --- a/custom-example/res/MainToolbar/CustomMainToolBar.qml +++ b/custom-example/res/MainToolbar/CustomMainToolBar.qml @@ -169,10 +169,10 @@ Item { } ColumnLayout { id: buttons + spacing: 0 anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - spacing: ScreenTools.defaultFontPixelHeight * 0.125 Rectangle { Layout.alignment: Qt.AlignVCenter width: parent.width @@ -181,6 +181,7 @@ Item { } CustomToolBarButton { id: flyButton + spacing: 1 text: qsTr("Fly") icon.source: "/qmlimages/PaperPlane.svg" Layout.fillWidth: true @@ -254,10 +255,9 @@ Item { ColumnLayout { id: lowerButtons anchors.bottom: parent.bottom - anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 0.125 anchors.left: parent.left anchors.right: parent.right - spacing: ScreenTools.defaultFontPixelHeight * 0.125 + spacing: 0 Rectangle { Layout.alignment: Qt.AlignVCenter width: parent.width