Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
ab0f772c
Commit
ab0f772c
authored
Mar 14, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More merge conflict errors
parent
e984fd95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
28 deletions
+37
-28
QGCButton.qml
src/QmlControls/QGCButton.qml
+37
-28
No files found.
src/QmlControls/QGCButton.qml
View file @
ab0f772c
...
@@ -8,12 +8,15 @@ import QGroundControl.ScreenTools 1.0
...
@@ -8,12 +8,15 @@ import QGroundControl.ScreenTools 1.0
Button
{
Button
{
activeFocusOnPress
:
true
activeFocusOnPress
:
true
property
bool
primary
:
false
///< primary button for a group of buttons
property
bool
primary
:
false
///< primary button for a group of buttons
property
real
pointSize
:
ScreenTools
.
defaultFontPointSize
///< Point size for button text
property
real
pointSize
:
ScreenTools
.
defaultFontPointSize
///< Point size for button text
property
bool
showBorder
:
_qgcPal
.
globalTheme
===
QGCPalette
.
Light
property
bool
iconLeft
:
false
property
real
backRadius
:
0
property
real
heightFactor
:
0.5
property
var
_qgcPal
:
QGCPalette
{
colorGroupEnabled
:
enabled
}
property
var
_qgcPal
:
QGCPalette
{
colorGroupEnabled
:
enabled
}
property
bool
_showHighlight
:
(
pressed
|
hovered
|
checked
)
&&
!
__forceHoverOff
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
// 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
...
@@ -24,7 +27,7 @@ Button {
...
@@ -24,7 +27,7 @@ Button {
property
int
__lastGlobalMouseX
:
0
property
int
__lastGlobalMouseX
:
0
property
int
__lastGlobalMouseY
:
0
property
int
__lastGlobalMouseY
:
0
property
int
_horizontalPadding
:
ScreenTools
.
defaultFontPixelWidth
property
int
_horizontalPadding
:
ScreenTools
.
defaultFontPixelWidth
property
int
_verticalPadding
:
Math
.
round
(
ScreenTools
.
defaultFontPixelHeight
/
2
)
property
int
_verticalPadding
:
Math
.
round
(
ScreenTools
.
defaultFontPixelHeight
*
heightFactor
)
Connections
{
Connections
{
target
:
__behavior
target
:
__behavior
...
@@ -60,9 +63,11 @@ Button {
...
@@ -60,9 +63,11 @@ Button {
/*! This defines the background of the button. */
/*! This defines the background of the button. */
background
:
Rectangle
{
background
:
Rectangle
{
id
:
backRect
implicitWidth
:
ScreenTools
.
implicitButtonWidth
implicitWidth
:
ScreenTools
.
implicitButtonWidth
implicitHeight
:
ScreenTools
.
implicitButtonHeight
implicitHeight
:
ScreenTools
.
implicitButtonHeight
border.width
:
_showBorder
?
1
:
0
radius
:
backRadius
border.width
:
showBorder
?
1
:
0
border.color
:
_qgcPal
.
buttonText
border.color
:
_qgcPal
.
buttonText
color
:
_showHighlight
?
color
:
_showHighlight
?
control
.
_qgcPal
.
buttonHighlight
:
control
.
_qgcPal
.
buttonHighlight
:
...
@@ -71,31 +76,35 @@ Button {
...
@@ -71,31 +76,35 @@ Button {
/*! This defines the label of the button. */
/*! This defines the label of the button. */
label
:
Item
{
label
:
Item
{
implicitWidth
:
row
.
implicitW
idth
implicitWidth
:
text
.
implicitWidth
+
icon
.
w
idth
implicitHeight
:
row
.
implicitHeight
implicitHeight
:
text
.
implicitHeight
baselineOffset
:
row
.
y
+
text
.
y
+
text
.
baselineOffset
baselineOffset
:
text
.
y
+
text
.
baselineOffset
Row
{
QGCColoredImage
{
id
:
row
id
:
icon
anchors.centerIn
:
parent
source
:
control
.
iconSource
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
0.25
height
:
source
===
""
?
0
:
text
.
height
width
:
height
Image
{
color
:
text
.
color
source
:
control
.
iconSource
fillMode
:
Image
.
PreserveAspectFit
anchors.verticalCenter
:
parent
.
verticalCenter
sourceSize.height
:
height
}
anchors.left
:
control
.
iconLeft
?
parent
.
left
:
undefined
anchors.leftMargin
:
control
.
iconLeft
?
ScreenTools
.
defaultFontPixelWidth
:
undefined
anchors.right
:
!
control
.
iconLeft
?
parent
.
right
:
undefined
anchors.rightMargin
:
!
control
.
iconLeft
?
ScreenTools
.
defaultFontPixelWidth
:
undefined
anchors.verticalCenter
:
parent
.
verticalCenter
}
Text
{
Text
{
id
:
text
id
:
text
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.centerIn
:
parent
antialiasing
:
true
antialiasing
:
true
text
:
control
.
text
text
:
control
.
text
font.pointSize
:
pointSize
font.pointSize
:
pointSize
font.family
:
ScreenTools
.
normalFontFamily
font.family
:
ScreenTools
.
normalFontFamily
color
:
_showHighlight
?
color
:
_showHighlight
?
control
.
_qgcPal
.
buttonHighlightText
:
control
.
_qgcPal
.
buttonHighlightText
:
(
primary
?
control
.
_qgcPal
.
primaryButtonText
:
control
.
_qgcPal
.
buttonText
)
(
primary
?
control
.
_qgcPal
.
primaryButtonText
:
control
.
_qgcPal
.
buttonText
)
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment