Browse Source

Custom Main Toolbar drawer visual improvements

Drawer now affected by theme, consistent with the rest of the active elements.

TODO: Add hover for desktop
QGC4.4
Yasen 6 years ago
parent
commit
207e48856d
  1. 7
      custom-example/res/Custom/Widgets/CustomToolBarButton.qml
  2. 6
      custom-example/res/MainToolbar/CustomMainToolBar.qml

7
custom-example/res/Custom/Widgets/CustomToolBarButton.qml

@ -22,7 +22,8 @@ Button { @@ -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 { @@ -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 { @@ -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
}
}

6
custom-example/res/MainToolbar/CustomMainToolBar.qml

@ -169,10 +169,10 @@ Item { @@ -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 { @@ -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 { @@ -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

Loading…
Cancel
Save