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
a01da581
Commit
a01da581
authored
Jul 11, 2013
by
Bill Bonney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APMToolBar as a docking widget [complete]
parent
aa582da2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
TextButton.qml
qml/components/TextButton.qml
+70
-0
No files found.
qml/components/TextButton.qml
0 → 100644
View file @
a01da581
import
QtQuick
1.1
Rectangle
{
signal
clicked
property
string
label
:
"
Text Button label
"
property
int
minWidth
:
75
property
int
minHeight
:
0
property
int
margin
:
5
width
:
textBox
.
width
height
:
72
anchors.verticalCenter
:
parent
.
verticalCenter
color
:
"
black
"
signal
buttonClick
()
onButtonClick
:
{
console
.
log
(
label
+
"
clicked calling signal
"
)
clicked
()
}
// Highlighting and ativation section
property
color
buttonColor
:
"
black
"
property
color
onHoverbuttonColor
:
"
lightblue
"
property
color
onHoverColor
:
"
darkblue
"
property
color
borderColor
:
"
white
"
Rectangle
{
width
:
textButtonLabel
.
paintedwidth
anchors.centerIn
:
parent
Rectangle
{
id
:
textBox
anchors.centerIn
:
parent
width
:
minWidth
>
textButtonLabel
.
paintedWidth
+
margin
?
minWidth
:
textButtonLabel
.
paintedWidth
+
margin
height
:
minHeight
>
textButtonLabel
.
paintedHeight
+
margin
?
minHeight
:
textButtonLabel
.
paintedHeight
+
margin
Text
{
id
:
textButtonLabel
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.margins
:
2
text
:
label
color
:
"
white
"
font.pointSize
:
11
}
MouseArea
{
id
:
textButtonMouseArea
anchors.fill
:
parent
onClicked
:
buttonClick
()
hoverEnabled
:
true
onEntered
:
{
parent
.
border
.
color
=
onHoverColor
parent
.
color
=
onHoverbuttonColor
}
onExited
:
{
parent
.
border
.
color
=
borderColor
parent
.
color
=
buttonColor
}
onPressed
:
parent
.
color
=
Qt
.
darker
(
onHoverbuttonColor
,
1.5
)
onReleased
:
parent
.
color
=
buttonColor
}
color
:
buttonColor
border.color
:
borderColor
border.width
:
1
}
}
}
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