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
44afaa86
Commit
44afaa86
authored
Apr 24, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving QmtTest to the Settings Panel (in debug builds only). This used to be a separate "QtWidget".
parent
1d0a02d2
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1189 additions
and
951 deletions
+1189
-951
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
QGCHoverButton.qml
src/QmlControls/QGCHoverButton.qml
+158
-0
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+1
-0
QmlTest.qml
src/QmlControls/QmlTest.qml
+1023
-951
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+6
-0
No files found.
qgroundcontrol.qrc
View file @
44afaa86
...
...
@@ -187,6 +187,7 @@
<file alias="QGroundControl/FlightMap/VehicleMapItem.qml">src/FlightMap/MapItems/VehicleMapItem.qml</file>
<file alias="QGroundControl/ScreenTools/qmldir">src/QmlControls/QGroundControl.ScreenTools.qmldir</file>
<file alias="QGroundControl/ScreenTools/ScreenTools.qml">src/QmlControls/ScreenTools.qml</file>
<file alias="QGroundControl/Controls/QGCHoverButton.qml">src/QmlControls/QGCHoverButton.qml</file>
<file alias="QmlTest.qml">src/QmlControls/QmlTest.qml</file>
<file alias="RadioComponent.qml">src/AutoPilotPlugins/Common/RadioComponent.qml</file>
<file alias="SerialSettings.qml">src/ui/preferences/SerialSettings.qml</file>
...
...
src/QmlControls/QGCHoverButton.qml
0 → 100644
View file @
44afaa86
import
QtQuick
2.3
import
QtQuick
.
Controls
2.2
import
QtGraphicalEffects
1.0
// TODO: Use QT styles. Use default button style + custom style entries
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
Button
{
id
:
button
width
:
columnItem
.
contentWidth
+
contentLayoutItem
.
margins
*
2
height
:
width
flat
:
true
property
color
color
:
qgcPal
.
button
property
color
disabledColor
:
qgcPalDisabled
.
button
property
color
pressedColor
:
qgcPal
.
buttonHighlight
// TODO: remove after we add it to the palette
property
color
hoverColor
:
qgcPal
.
hoverColor
property
color
contentColor
:
qgcPal
.
buttonText
property
color
contentPressedColor
:
qgcPal
.
buttonHighlightText
property
color
borderColor
:
qgcPal
.
windowShadeDark
property
alias
radius
:
buttonBkRect
.
radius
property
alias
fontPointSize
:
innerText
.
font
.
pointSize
property
alias
imageSource
:
innerImage
.
source
property
alias
contentWidth
:
innerText
.
contentWidth
property
real
imageScale
:
0.8
property
real
borderWidth
:
0
property
real
contentMargins
:
innerText
.
height
*
0.1
property
color
_currentColor
:
checked
?
pressedColor
:
color
property
color
_currentContentColor
:
contentColor
QGCPalette
{
id
:
qgcPal
}
QGCPalette
{
id
:
qgcPalDisabled
;
colorGroupEnabled
:
false
}
// Initial state
state
:
"
Default
"
// Update state on status changed
onEnabledChanged
:
state
=
"
Default
"
property
real
_contentVDist
:
innerImage
.
height
/
innerText
.
contentHeight
// Content Icon + Text
contentItem
:
Item
{
id
:
contentLayoutItem
anchors.fill
:
parent
anchors.margins
:
contentMargins
Column
{
id
:
columnItem
anchors.fill
:
parent
Item
{
width
:
parent
.
width
height
:
(
contentLayoutItem
.
height
-
innerText
.
height
)
Image
{
id
:
innerImage
anchors.centerIn
:
parent
height
:
parent
.
height
*
imageScale
width
:
parent
.
width
*
imageScale
visible
:
false
smooth
:
true
antialiasing
:
true
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
sourceSize.width
:
width
horizontalAlignment
:
Image
.
AlignHCenter
verticalAlignment
:
Image
.
AlignVCenter
}
ColorOverlay
{
id
:
imageOverlay
anchors.fill
:
innerImage
source
:
innerImage
color
:
_currentContentColor
}
}
Text
{
id
:
innerText
text
:
button
.
text
color
:
_currentContentColor
width
:
parent
.
width
font.pointSize
:
ScreenTools
.
defaultFontPointSize
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
}
}
// Column - content
}
// Item - content
background
:
Rectangle
{
id
:
buttonBkRect
anchors.fill
:
parent
color
:
_currentColor
border.width
:
borderWidth
border.color
:
borderColor
}
// Change the aspect of the content in differen button states
states
:
[
State
{
name
:
"
Hovering
"
PropertyChanges
{
target
:
button
;
_currentColor
:
pressed
||
checked
?
pressedColor
:
hoverColor
_currentContentColor
:
pressed
||
checked
?
contentPressedColor
:
contentColor
}
},
State
{
name
:
"
Default
"
PropertyChanges
{
target
:
button
;
_currentColor
:
enabled
?
((
checked
||
pressed
)
?
pressedColor
:
color
)
:
disabledColor
_currentContentColor
:
contentColor
}
}
]
transitions
:
[
Transition
{
from
:
""
;
to
:
"
Hovering
"
ColorAnimation
{
duration
:
200
}
},
Transition
{
from
:
"
*
"
;
to
:
"
Pressed
"
ColorAnimation
{
duration
:
10
}
}
]
// Process hover events
MouseArea
{
enabled
:
!
ScreenTools
.
isMobile
hoverEnabled
:
true
propagateComposedEvents
:
true
preventStealing
:
true
anchors.fill
:
button
onEntered
:
{
button
.
state
=
'
Hovering
'
;
}
onExited
:
{
button
.
state
=
'
Default
'
;
}
// Propagate events down
onClicked
:
{
mouse
.
accepted
=
false
;
}
onDoubleClicked
:
{
mouse
.
accepted
=
false
;
}
onPositionChanged
:
{
mouse
.
accepted
=
false
;
}
onPressAndHold
:
{
mouse
.
accepted
=
false
;
}
onPressed
:
{
mouse
.
accepted
=
false
}
onReleased
:
{
mouse
.
accepted
=
false
}
}
}
src/QmlControls/QGroundControl.Controls.qmldir
View file @
44afaa86
...
...
@@ -77,3 +77,4 @@ ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml
QGCHoverButton 1.0 QGCHoverButton.qml
src/QmlControls/QmlTest.qml
View file @
44afaa86
This diff is collapsed.
Click to expand it.
src/api/QGCCorePlugin.cc
View file @
44afaa86
...
...
@@ -61,6 +61,8 @@ public:
delete
pMockLink
;
if
(
pDebug
)
delete
pDebug
;
if
(
pQmlTest
)
delete
pQmlTest
;
#endif
if
(
defaultOptions
)
delete
defaultOptions
;
...
...
@@ -84,6 +86,7 @@ public:
#if defined(QT_DEBUG)
QmlComponentInfo
*
pMockLink
=
nullptr
;
QmlComponentInfo
*
pDebug
=
nullptr
;
QmlComponentInfo
*
pQmlTest
=
nullptr
;
#endif
QmlComponentInfo
*
valuesPageWidgetInfo
=
nullptr
;
...
...
@@ -173,6 +176,9 @@ QVariantList &QGCCorePlugin::settingsPages()
_p
->
pDebug
=
new
QmlComponentInfo
(
tr
(
"Debug"
),
QUrl
::
fromUserInput
(
"qrc:/qml/DebugWindow.qml"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
(
reinterpret_cast
<
QmlComponentInfo
*>
(
_p
->
pDebug
)));
_p
->
pQmlTest
=
new
QmlComponentInfo
(
tr
(
"Palette Test"
),
QUrl
::
fromUserInput
(
"qrc:/qml/QmlTest.qml"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
(
reinterpret_cast
<
QmlComponentInfo
*>
(
_p
->
pQmlTest
)));
#endif
}
return
_p
->
settingsList
;
...
...
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