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
fb0e158e
Commit
fb0e158e
authored
Dec 24, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Fact controls
parent
e79c7162
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
4 deletions
+76
-4
FactCheckBox.qml
qml/QGroundControl/FactControls/FactCheckBox.qml
+26
-0
FactLabel.qml
qml/QGroundControl/FactControls/FactLabel.qml
+1
-1
FactTextField.qml
qml/QGroundControl/FactControls/FactTextField.qml
+49
-3
No files found.
qml/QGroundControl/FactControls/FactCheckBox.qml
0 → 100644
View file @
fb0e158e
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
.
FactSystem
1.0
CheckBox
{
property
Fact
fact
:
Fact
{
value
:
0
}
property
variant
checkedValue
:
1
property
variant
uncheckedValue
:
0
partiallyCheckedEnabled
:
fact
.
value
!=
checkedValue
&&
fact
.
value
!=
uncheckedValue
checkedState
:
fact
.
value
==
checkedValue
?
Qt
.
Checked
:
(
fact
.
value
==
uncheckedValue
?
Qt
.
Unchecked
:
Qt
.
PartiallyChecked
)
text
:
"
Label
"
onClicked
:
{
fact
.
value
=
checked
?
checkedValue
:
uncheckedValue
}
style
:
CheckBoxStyle
{
label
:
Text
{
color
:
palette
.
windowText
text
:
control
.
text
}
}
}
qml/QGroundControl/FactControls/FactLabel.qml
View file @
fb0e158e
...
...
@@ -9,5 +9,5 @@ Label {
color
:
palette
.
windowText
text
:
fact
.
value
text
:
fact
.
value
String
}
qml/QGroundControl/FactControls/FactTextField.qml
View file @
fb0e158e
...
...
@@ -5,10 +5,56 @@ import QGroundControl.FactSystem 1.0
TextField
{
property
Fact
fact
:
Fact
{
value
:
0
}
property
bool
showUnits
:
false
QGCPalette
{
id
:
palette
;
colorGroup
:
enabled
?
QGCPalette
.
Active
:
QGCPalette
.
Disabled
}
QGCPalette
{
id
:
palette
;
colorGroup
:
QGCPalette
.
Active
}
text
:
fact
.
valueString
textColor
:
palette
.
text
text
:
fact
.
value
Label
{
id
:
unitsLabelWidthGenerator
text
:
parent
.
fact
.
units
width
:
contentWidth
+
((
parent
.
__contentHeight
/
3
)
*
2
)
visible
:
false
}
onAccepted
:
fact
.
value
=
text
style
:
TextFieldStyle
{
background
:
Item
{
id
:
backgroundItem
Rectangle
{
anchors.fill
:
parent
anchors.bottomMargin
:
-
1
color
:
"
#44ffffff
"
}
Rectangle
{
anchors.fill
:
parent
border.color
:
control
.
activeFocus
?
"
#47b
"
:
"
#999
"
color
:
palette
.
base
}
Text
{
id
:
unitsLabel
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
verticalAlignment
:
Text
.
AlignVCenter
horizontalAlignment
:
Text
.
AlignHCenter
x
:
parent
.
width
-
width
width
:
unitsLabelWidthGenerator
.
width
text
:
control
.
fact
.
units
color
:
control
.
textColor
visible
:
control
.
showUnits
}
}
padding.right
:
control
.
showUnits
?
unitsLabelWidthGenerator
.
width
:
control
.
__contentHeight
/
3
}
onEditingFinished
:
fact
.
value
=
text
}
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