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
b7915158
Commit
b7915158
authored
Sep 08, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
d1940918
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
171 additions
and
0 deletions
+171
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
QGCOptionsComboBox.qml
src/QmlControls/QGCOptionsComboBox.qml
+169
-0
qmldir
src/QmlControls/QGroundControl/Controls/qmldir
+1
-0
No files found.
qgroundcontrol.qrc
View file @
b7915158
...
...
@@ -123,6 +123,7 @@
<file alias="QGroundControl/Controls/QGCMenuSeparator.qml">src/QmlControls/QGCMenuSeparator.qml</file>
<file alias="QGroundControl/Controls/QGCMouseArea.qml">src/QmlControls/QGCMouseArea.qml</file>
<file alias="QGroundControl/Controls/QGCMovableItem.qml">src/QmlControls/QGCMovableItem.qml</file>
<file alias="QGroundControl/Controls/QGCOptionsComboBox.qml">src/QmlControls/QGCOptionsComboBox.qml</file>
<file alias="QGroundControl/Controls/QGCPipable.qml">src/QmlControls/QGCPipable.qml</file>
<file alias="QGroundControl/Controls/QGCRadioButton.qml">src/QmlControls/QGCRadioButton.qml</file>
<file alias="QGroundControl/Controls/QGCSlider.qml">src/QmlControls/QGCSlider.qml</file>
...
...
src/QmlControls/QGCOptionsComboBox.qml
0 → 100644
View file @
b7915158
/****************************************************************************
*
* (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
* @file
* @author Gus Grubba <gus@auterion.com>
*/
import
QtQuick
2.11
import
QtQuick
.
Controls
2.4
import
QtQuick
.
Layouts
1.11
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
ComboBox
{
id
:
control
padding
:
ScreenTools
.
comboBoxPadding
property
string
labelText
:
qsTr
(
"
Options
"
)
signal
itemClicked
(
int
index
)
property
var
_controlQGCPal
:
QGCPalette
{
colorGroupEnabled
:
enabled
}
property
bool
_flashChecked
property
string
_flashText
property
bool
_showFlash
:
false
background
:
Rectangle
{
implicitWidth
:
ScreenTools
.
implicitComboBoxWidth
implicitHeight
:
ScreenTools
.
implicitComboBoxHeight
color
:
_controlQGCPal
.
window
border.width
:
enabled
?
1
:
0
border.color
:
"
#999
"
}
/*! Adding the Combobox list item to the theme. */
delegate
:
ItemDelegate
{
implicitHeight
:
modelData
.
visible
?
(
Math
.
max
(
background
?
background
.
implicitHeight
:
0
,
Math
.
max
(
contentItem
.
implicitHeight
,
indicator
?
indicator
.
implicitHeight
:
0
)
+
topPadding
+
bottomPadding
))
:
0
width
:
control
.
width
checkable
:
true
enabled
:
modelData
.
enabled
text
:
modelData
.
text
property
var
_checkedValue
:
1
property
var
_uncheckedValue
:
0
property
var
_itemQGCPal
:
QGCPalette
{
colorGroupEnabled
:
enabled
}
property
var
_control
:
control
Binding
on
checked
{
value
:
modelData
.
fact
?
(
modelData
.
fact
.
typeIsBool
?
(
modelData
.
fact
.
value
===
false
?
Qt
.
Unchecked
:
Qt
.
Checked
)
:
(
modelData
.
fact
.
value
===
0
?
Qt
.
Unchecked
:
Qt
.
Checked
))
:
modelData
.
checked
}
contentItem
:
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Rectangle
{
height
:
ScreenTools
.
defaultFontPixelHeight
width
:
height
border.color
:
_itemQGCPal
.
buttonText
border.width
:
1
color
:
_itemQGCPal
.
button
QGCColoredImage
{
anchors.centerIn
:
parent
width
:
parent
.
width
*
0.75
height
:
width
source
:
"
/qmlimages/checkbox-check.svg
"
color
:
_itemQGCPal
.
buttonText
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
visible
:
checked
}
}
Text
{
text
:
modelData
.
text
color
:
_itemQGCPal
.
buttonText
}
}
background
:
Rectangle
{
color
:
_controlQGCPal
.
button
}
onClicked
:
{
if
(
modelData
.
fact
)
{
modelData
.
fact
.
value
=
(
checked
?
_checkedValue
:
_uncheckedValue
)
}
else
{
itemClicked
(
index
)
}
_control
.
_flashChecked
=
checked
_control
.
_flashText
=
text
_control
.
_showFlash
=
true
_control
.
popup
.
close
()
}
}
/*! This defines the label of the button. */
contentItem
:
Item
{
implicitWidth
:
_showFlash
?
flash
.
implicitWidth
:
text
.
implicitWidth
implicitHeight
:
_showFlash
?
flash
.
implicitHeight
:
text
.
implicitHeight
QGCLabel
{
id
:
text
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
labelText
color
:
_controlQGCPal
.
text
visible
:
!
_showFlash
}
RowLayout
{
id
:
flash
anchors.verticalCenter
:
parent
.
verticalCenter
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_showFlash
onVisibleChanged
:
{
if
(
visible
)
{
flashTimer
.
restart
()
}
}
Timer
{
id
:
flashTimer
interval
:
1500
repeat
:
false
running
:
false
onTriggered
:
_showFlash
=
false
}
Rectangle
{
height
:
ScreenTools
.
defaultFontPixelHeight
width
:
height
border.color
:
_controlQGCPal
.
buttonText
border.width
:
1
color
:
_controlQGCPal
.
window
QGCColoredImage
{
anchors.centerIn
:
parent
width
:
parent
.
width
*
0.75
height
:
width
source
:
"
/qmlimages/checkbox-check.svg
"
color
:
_controlQGCPal
.
text
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
visible
:
_flashChecked
}
}
Text
{
text
:
_flashText
color
:
_controlQGCPal
.
buttonText
}
}
}
}
src/QmlControls/QGroundControl/Controls/qmldir
View file @
b7915158
...
...
@@ -58,6 +58,7 @@ QGCMenuItem 1.0 QGCMenuItem.qml
QGCMenuSeparator 1.0 QGCMenuSeparator.qml
QGCMouseArea 1.0 QGCMouseArea.qml
QGCMovableItem 1.0 QGCMovableItem.qml
QGCOptionsComboBox 1.0 QGCOptionsComboBox.qml
QGCPipable 1.0 QGCPipable.qml
QGCRadioButton 1.0 QGCRadioButton.qml
QGCSlider 1.0 QGCSlider.qml
...
...
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