|
|
|
@ -22,7 +22,8 @@ Button {
@@ -22,7 +22,8 @@ Button {
|
|
|
|
|
|
|
|
|
|
property int __lastGlobalMouseX: 0 |
|
|
|
|
property int __lastGlobalMouseY: 0 |
|
|
|
|
property int __padding: Math.round(ScreenTools.defaultFontPixelHeight * 0.5) |
|
|
|
|
property int _horizontalPadding: ScreenTools.defaultFontPixelWidth |
|
|
|
|
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight / 2) |
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
|
target: __behavior |
|
|
|
@ -50,42 +51,26 @@ Button {
@@ -50,42 +51,26 @@ Button {
|
|
|
|
|
style: ButtonStyle { |
|
|
|
|
/*! The padding between the background and the label components. */ |
|
|
|
|
padding { |
|
|
|
|
top: __padding * 0.5 |
|
|
|
|
left: __padding |
|
|
|
|
right: control.menu !== null ? Math.round(ScreenTools.defaultFontPixelHeight) : __padding |
|
|
|
|
bottom: __padding * 0.5 |
|
|
|
|
top: _verticalPadding |
|
|
|
|
bottom: _verticalPadding |
|
|
|
|
left: _horizontalPadding |
|
|
|
|
right: _horizontalPadding |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*! This defines the background of the button. */ |
|
|
|
|
background: Item { |
|
|
|
|
property bool down: control.pressed || (control.checkable && control.checked) |
|
|
|
|
implicitWidth: Math.round(ScreenTools.defaultFontPixelWidth * 4.5) |
|
|
|
|
implicitHeight: ScreenTools.isMobile ? Math.max(25, Math.round(ScreenTools.defaultFontPixelHeight * 2)) : Math.max(25, Math.round(ScreenTools.defaultFontPixelHeight * 1.2)) |
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
anchors.fill: parent |
|
|
|
|
background: Rectangle { |
|
|
|
|
implicitWidth: ScreenTools.implicitButtonWidth |
|
|
|
|
implicitHeight: ScreenTools.implicitButtonHeight |
|
|
|
|
border.width: _showBorder ? 1: 0 |
|
|
|
|
border.color: _qgcPal.buttonText |
|
|
|
|
//radius: 3 |
|
|
|
|
color: _showHighlight ? |
|
|
|
|
control._qgcPal.buttonHighlight : |
|
|
|
|
(primary ? control._qgcPal.primaryButton : control._qgcPal.button) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
id: imageItem |
|
|
|
|
visible: control.menu !== null |
|
|
|
|
source: "/qmlimages/arrow-down.png" |
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
anchors.right: parent.right |
|
|
|
|
anchors.rightMargin: __padding |
|
|
|
|
opacity: control.enabled ? 0.6 : 0.5 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*! This defines the label of the button. */ |
|
|
|
|
label: Item { |
|
|
|
|
implicitWidth: control.menu === null ? row.implicitWidth : row.implicitWidth + ScreenTools.defaultFontPixelWidth |
|
|
|
|
implicitWidth: row.implicitWidth |
|
|
|
|
implicitHeight: row.implicitHeight |
|
|
|
|
baselineOffset: row.y + text.y + text.baselineOffset |
|
|
|
|
|
|
|
|
@ -101,11 +86,11 @@ Button {
@@ -101,11 +86,11 @@ Button {
|
|
|
|
|
|
|
|
|
|
Text { |
|
|
|
|
id: text |
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
antialiasing: true |
|
|
|
|
text: control.text |
|
|
|
|
font.pointSize: pointSize |
|
|
|
|
font.family: ScreenTools.normalFontFamily |
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
color: _showHighlight ? |
|
|
|
|
control._qgcPal.buttonHighlightText : |
|
|
|
|
(primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText) |
|
|
|
|