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
3ec958c2
Commit
3ec958c2
authored
Apr 28, 2019
by
Stefan Dunca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toolstrip and QmlTest tweaks
parent
b4b57bc1
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
348 additions
and
870 deletions
+348
-870
QGCHoverButton.qml
src/QmlControls/QGCHoverButton.qml
+17
-14
QmlTest.qml
src/QmlControls/QmlTest.qml
+328
-851
ToolStrip.qml
src/QmlControls/ToolStrip.qml
+3
-5
No files found.
src/QmlControls/QGCHoverButton.qml
View file @
3ec958c2
...
...
@@ -6,19 +6,13 @@ import QtGraphicalEffects 1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
// TODO: use QT palette
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
...
...
@@ -30,8 +24,8 @@ Button {
property
real
borderWidth
:
0
property
real
contentMargins
:
innerText
.
height
*
0.1
property
color
_currentColor
:
checked
?
pressedColor
:
color
property
color
_currentContentColor
:
contentColor
property
color
_currentColor
:
qgcPal
.
button
property
color
_currentContentColor
:
qgcPal
.
buttonText
QGCPalette
{
id
:
qgcPal
}
QGCPalette
{
id
:
qgcPalDisabled
;
colorGroupEnabled
:
false
}
...
...
@@ -102,27 +96,36 @@ Button {
id
:
buttonBkRect
anchors.fill
:
parent
color
:
_currentColor
visible
:
!
flat
border.width
:
borderWidth
border.color
:
borderColor
}
// Change the
aspect of the content in differe
n button states
// Change the
colors based o
n button states
states
:
[
State
{
name
:
"
Hovering
"
PropertyChanges
{
target
:
button
;
_currentColor
:
pressed
||
checked
?
pressedColor
:
hoverColor
_currentContentColor
:
pressed
||
checked
?
contentPressedColor
:
contentColor
_currentColor
:
(
checked
||
pressed
)
?
qgcPal
.
buttonHighlight
:
qgcPal
.
hoverColor
_currentContentColor
:
qgcPal
.
buttonHighlightText
}
PropertyChanges
{
target
:
buttonBkRect
visible
:
true
}
},
State
{
name
:
"
Default
"
PropertyChanges
{
target
:
button
;
_currentColor
:
enabled
?
((
checked
||
pressed
)
?
pressedColor
:
color
)
:
disabledColor
_currentContentColor
:
contentColor
_currentColor
:
enabled
?
((
checked
||
pressed
)
?
qgcPal
.
buttonHighlight
:
qgcPal
.
button
)
:
qgcPalDisabled
.
button
_currentContentColor
:
enabled
?
((
checked
||
pressed
)
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonHighlight
)
:
qgcPalDisabled
.
buttonText
}
PropertyChanges
{
target
:
buttonBkRect
visible
:
!
flat
||
(
checked
||
pressed
)
}
}
]
...
...
src/QmlControls/QmlTest.qml
View file @
3ec958c2
This diff is collapsed.
Click to expand it.
src/QmlControls/ToolStrip.qml
View file @
3ec958c2
...
...
@@ -32,7 +32,7 @@ Rectangle {
property
AbstractButton
lastClickedButton
:
null
// Ensure we don't get lower than
property
real
_idealWidth
:
(
ScreenTools
.
isMobile
?
ScreenTools
.
minTouchPixels
:
ScreenTools
.
defaultFontPixelWidth
*
10
)
+
toolStripColumn
.
anchors
.
margins
*
2
property
real
_idealWidth
:
(
ScreenTools
.
isMobile
?
ScreenTools
.
minTouchPixels
:
ScreenTools
.
defaultFontPixelWidth
*
8
)
+
toolStripColumn
.
anchors
.
margins
*
2
signal
clicked
(
int
index
,
bool
checked
)
...
...
@@ -44,7 +44,7 @@ Rectangle {
Column
{
id
:
toolStripColumn
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
*
0.
8
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
*
0.
4
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -55,13 +55,11 @@ Rectangle {
QGCHoverButton
{
id
:
buttonTemplate
color
:
_root
.
color
anchors.left
:
toolStripColumn
.
left
anchors.right
:
toolStripColumn
.
right
height
:
width
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
fontPointSize
:
ScreenTools
.
isMobile
?
ScreenTools
.
smallFontPointSize
:
ScreenTools
.
medium
FontPointSize
fontPointSize
:
ScreenTools
.
isMobile
?
ScreenTools
.
smallFontPointSize
:
ScreenTools
.
default
FontPointSize
enabled
:
_root
.
buttonEnabled
?
_root
.
buttonEnabled
[
index
]
:
true
visible
:
_root
.
buttonVisible
?
_root
.
buttonVisible
[
index
]
:
true
...
...
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