Browse Source

Made my own copy of showHighLight so I don't need to change the base class.

QGC4.4
dogmaphobic 10 years ago
parent
commit
17351cf27f
  1. 6
      src/QmlControls/QGCButton.qml
  2. 1
      src/QmlControls/QGCToolBarButton.qml

6
src/QmlControls/QGCButton.qml

@ -9,10 +9,10 @@ import QGroundControl.MousePosition 1.0
Button { Button {
// primary: true - this is the primary button for this group of buttons // primary: true - this is the primary button for this group of buttons
property bool primary: false property bool primary: false
property bool showHighlight: (pressed | hovered | checked) && !__forceHoverOff
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool __showHighLight: (pressed | hovered | checked) && !__forceHoverOff
// This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can // This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can
// move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn // move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn
@ -70,7 +70,7 @@ Button {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: showHighlight ? color: __showHighLight ?
control.__qgcPal.buttonHighlight : control.__qgcPal.buttonHighlight :
(primary ? control.__qgcPal.primaryButton : control.__qgcPal.button) (primary ? control.__qgcPal.primaryButton : control.__qgcPal.button)
} }
@ -107,7 +107,7 @@ Button {
renderType: Text.NativeRendering renderType: Text.NativeRendering
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: control.text text: control.text
color: showHighlight ? color: __showHighLight ?
control.__qgcPal.buttonHighlightText : control.__qgcPal.buttonHighlightText :
(primary ? control.__qgcPal.primaryButtonText : control.__qgcPal.buttonText) (primary ? control.__qgcPal.primaryButtonText : control.__qgcPal.buttonText)
} }

1
src/QmlControls/QGCToolBarButton.qml

@ -10,6 +10,7 @@ QGCButton {
id: button id: button
property bool repaintChevron: false property bool repaintChevron: false
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool showHighlight: __showHighLight
style: ButtonStyle { style: ButtonStyle {
background: Item { background: Item {
anchors.margins: 3 anchors.margins: 3

Loading…
Cancel
Save