|
|
|
@ -6,12 +6,14 @@ import QGroundControl.Palette 1.0
@@ -6,12 +6,14 @@ import QGroundControl.Palette 1.0
|
|
|
|
|
import QGroundControl.ScreenTools 1.0 |
|
|
|
|
|
|
|
|
|
Button { |
|
|
|
|
property bool primary: false ///< primary button for a group of buttons |
|
|
|
|
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text |
|
|
|
|
property bool primary: false ///< primary button for a group of buttons |
|
|
|
|
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text |
|
|
|
|
property bool showBorder: _qgcPal.globalTheme === QGCPalette.Light |
|
|
|
|
property real backRadius: 0 |
|
|
|
|
property real heightFactor: 0.5 |
|
|
|
|
|
|
|
|
|
property var _qgcPal: QGCPalette { colorGroupEnabled: enabled } |
|
|
|
|
property bool _showHighlight: (pressed | hovered | checked) && !__forceHoverOff |
|
|
|
|
property bool _showBorder: _qgcPal.globalTheme === QGCPalette.Light |
|
|
|
|
|
|
|
|
|
// 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 |
|
|
|
@ -22,7 +24,7 @@ Button {
@@ -22,7 +24,7 @@ Button {
|
|
|
|
|
property int __lastGlobalMouseX: 0 |
|
|
|
|
property int __lastGlobalMouseY: 0 |
|
|
|
|
property int _horizontalPadding: ScreenTools.defaultFontPixelWidth |
|
|
|
|
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight / 2) |
|
|
|
|
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight * heightFactor) |
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
|
target: __behavior |
|
|
|
@ -58,9 +60,11 @@ Button {
@@ -58,9 +60,11 @@ Button {
|
|
|
|
|
|
|
|
|
|
/*! This defines the background of the button. */ |
|
|
|
|
background: Rectangle { |
|
|
|
|
id: backRect |
|
|
|
|
implicitWidth: ScreenTools.implicitButtonWidth |
|
|
|
|
implicitHeight: ScreenTools.implicitButtonHeight |
|
|
|
|
border.width: _showBorder ? 1: 0 |
|
|
|
|
radius: backRadius |
|
|
|
|
border.width: showBorder ? 1 : 0 |
|
|
|
|
border.color: _qgcPal.buttonText |
|
|
|
|
color: _showHighlight ? |
|
|
|
|
control._qgcPal.buttonHighlight : |
|
|
|
|