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
3c877924
Commit
3c877924
authored
Apr 29, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix inverted order of color definitions when exporting
Fix overall Palette Window UI
parent
7591e825
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
312 additions
and
314 deletions
+312
-314
QmlTest.qml
src/QmlControls/QmlTest.qml
+312
-314
No files found.
src/QmlControls/QmlTest.qml
View file @
3c877924
...
...
@@ -17,27 +17,6 @@ Rectangle {
property
var
enabledPalette
:
QGCPalette
{
colorGroupEnabled
:
true
}
property
var
disabledPalette
:
QGCPalette
{
colorGroupEnabled
:
false
}
QGCFlickable
{
anchors.fill
:
parent
contentWidth
:
_rootCol
.
width
contentHeight
:
_rootCol
.
height
clip
:
true
Column
{
id
:
_rootCol
Rectangle
{
id
:
_header
width
:
parent
.
width
height
:
themeChoice
.
height
*
2
color
:
palette
.
window
QGCLabel
{
id
:
windowColorLabel
text
:
qsTr
(
"
Window Color
"
)
anchors.left
:
parent
.
left
anchors.leftMargin
:
20
}
function
exportPaletteColors
(
pal
)
{
var
objToExport
=
{}
for
(
var
clrName
in
pal
)
{
...
...
@@ -82,7 +61,7 @@ Rectangle {
for
(
var
i
=
0
;
i
<
palette
.
colors
.
length
;
i
++
)
{
var
cs
=
palette
.
colors
[
i
]
var
csc
=
cs
+
'
Colors
'
palToExport
+=
'
DECLARE_QGC_COLOR(
'
+
cs
+
'
,
\
"
'
+
palette
[
csc
][
0
]
+
'
\
",
\
"
'
+
palette
[
csc
][
1
]
+
'
\
",
\
"
'
+
palette
[
csc
][
2
]
+
'
\
",
\
"
'
+
palette
[
csc
][
3
]
+
'
\
")
\n
'
palToExport
+=
'
DECLARE_QGC_COLOR(
'
+
cs
+
'
,
\
"
'
+
palette
[
csc
][
1
]
+
'
\
",
\
"
'
+
palette
[
csc
][
0
]
+
'
\
",
\
"
'
+
palette
[
csc
][
3
]
+
'
\
",
\
"
'
+
palette
[
csc
][
2
]
+
'
\
")
\n
'
}
themeImportExportEdit
.
text
=
palToExport
}
...
...
@@ -97,10 +76,10 @@ Rectangle {
}
palToExport
+=
'
if (colorName == QStringLiteral(
\
"
'
+
cs
+
'
\
")) {
\n
'
+
'
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor(
\
"
'
+
palette
[
csc
][
0
]
+
'
\
");
\n
'
+
'
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor(
\
"
'
+
palette
[
csc
][
1
]
+
'
\
");
\n
'
+
'
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor(
\
"
'
+
palette
[
csc
][
2
]
+
'
\
");
\n
'
+
'
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor(
\
"
'
+
palette
[
csc
][
3
]
+
'
\
");
\n
'
+
'
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor(
\
"
'
+
palette
[
csc
][
2
]
+
'
\
");
\n
'
+
'
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor(
\
"
'
+
palette
[
csc
][
3
]
+
'
\
");
\n
'
+
'
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor(
\
"
'
+
palette
[
csc
][
0
]
+
'
\
");
\n
'
+
'
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor(
\
"
'
+
palette
[
csc
][
1
]
+
'
\
");
\n
'
+
'
}
'
}
themeImportExportEdit
.
text
=
palToExport
...
...
@@ -128,6 +107,8 @@ Rectangle {
paletteImportExportPopup
.
close
()
}
//-------------------------------------------------------------------------
//-- Export/Import
Popup
{
id
:
paletteImportExportPopup
width
:
impCol
.
width
+
(
ScreenTools
.
defaultFontPixelWidth
*
4
)
...
...
@@ -140,7 +121,7 @@ Rectangle {
y
:
Math
.
round
((
mainWindow
.
height
-
height
)
*
0.5
)
onVisibleChanged
:
{
if
(
visible
)
{
_header
.
exportTheme
()
exportTheme
()
_jsonButton
.
checked
=
true
}
}
...
...
@@ -162,15 +143,15 @@ Rectangle {
QGCRadioButton
{
id
:
_jsonButton
text
:
"
Json
"
onClicked
:
_header
.
exportTheme
()
onClicked
:
exportTheme
()
}
QGCRadioButton
{
text
:
"
QGC
"
onClicked
:
_header
.
exportThemeCPP
()
onClicked
:
exportThemeCPP
()
}
QGCRadioButton
{
text
:
"
Custom Plugin
"
onClicked
:
_header
.
exportThemePlugin
()
onClicked
:
exportThemePlugin
()
}
}
Rectangle
{
...
...
@@ -218,7 +199,7 @@ Rectangle {
text
:
"
Import (Json Only)
"
enabled
:
themeImportExportEdit
.
text
[
0
]
===
"
{
"
&&
_jsonButton
.
checked
onClicked
:
{
_header
.
importTheme
(
themeImportExportEdit
.
text
);
importTheme
(
themeImportExportEdit
.
text
);
}
}
QGCButton
{
...
...
@@ -231,41 +212,60 @@ Rectangle {
}
}
Button
{
id
:
exportButton
text
:
"
Import/Export
"
width
:
200
height
:
30
anchors.left
:
windowColorLabel
.
right
anchors.leftMargin
:
20
onPressed
:
paletteImportExportPopup
.
open
()
}
//-------------------------------------------------------------------------
//-- Header
Rectangle
{
id
:
_header
width
:
parent
.
width
height
:
themeChoice
.
height
*
2
color
:
palette
.
window
anchors.top
:
parent
.
top
Row
{
id
:
themeChoice
spacing
:
20
anchors.centerIn
:
parent
anchors.margins
:
20
QGCLabel
{
text
:
qsTr
(
"
Window Color
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
}
QGCButton
{
text
:
qsTr
(
"
Import/Export
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
onClicked
:
paletteImportExportPopup
.
open
()
}
Row
{
spacing
:
20
ButtonGroup
{
id
:
themeGroup
;
exclusive
:
true
}
anchors.verticalCenter
:
parent
.
verticalCenter
QGCRadioButton
{
text
:
qsTr
(
"
Light
"
)
checked
:
palette
.
globalTheme
===
QGCPalette
.
Light
ButtonGroup.group
:
themeGroup
onClicked
:
{
palette
.
globalTheme
=
QGCPalette
.
Light
}
checked
:
_root
.
palette
.
globalTheme
===
QGCPalette
.
Light
onClicked
:
{
_root
.
palette
.
globalTheme
=
QGCPalette
.
Light
}
}
QGCRadioButton
{
text
:
qsTr
(
"
Dark
"
)
checked
:
palette
.
globalTheme
===
QGCPalette
.
Dark
ButtonGroup.group
:
themeGroup
onClicked
:
{
palette
.
globalTheme
=
QGCPalette
.
Dark
}
checked
:
_root
.
palette
.
globalTheme
===
QGCPalette
.
Dark
onClicked
:
{
_root
.
palette
.
globalTheme
=
QGCPalette
.
Dark
}
}
}
}
}
//-------------------------------------------------------------------------
//-- Main Contents
QGCFlickable
{
anchors.top
:
_header
.
bottom
anchors.bottom
:
parent
.
bottom
width
:
parent
.
width
contentWidth
:
_rootCol
.
width
contentHeight
:
_rootCol
.
height
clip
:
true
Column
{
id
:
_rootCol
Row
{
spacing
:
30
// Edit theme GroupBox
GroupBox
{
title
:
"
Preview and edit theme
"
...
...
@@ -377,24 +377,6 @@ Rectangle {
columns
:
3
spacing
:
10
Component
{
id
:
ctlRowHeader
Rectangle
{
width
:
ctlPrevColumn
.
_colWidth
height
:
ctlPrevColumn
.
_height
color
:
"
white
"
Text
{
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignRight
verticalAlignment
:
Text
.
AlignVCenter
color
:
"
black
"
text
:
parent
.
parent
.
text
}
}
}
// Header row
Text
{
width
:
ctlPrevColumn
.
_colWidth
...
...
@@ -660,6 +642,43 @@ Rectangle {
width
:
1
;
}
Row
{
spacing
:
10
anchors.horizontalCenter
:
parent
.
horizontalCenter
Loader
{
property
color
backgroundColor
:
qgcPal
.
window
sourceComponent
:
arbBox
}
Loader
{
property
color
backgroundColor
:
qgcPal
.
windowShade
sourceComponent
:
arbBox
}
Loader
{
property
color
backgroundColor
:
qgcPal
.
windowShadeDark
sourceComponent
:
arbBox
}
}
}
}
Component
{
id
:
ctlRowHeader
Rectangle
{
width
:
ctlPrevColumn
.
_colWidth
height
:
ctlPrevColumn
.
_height
color
:
"
white
"
Text
{
color
:
"
black
"
text
:
parent
.
parent
.
text
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignRight
verticalAlignment
:
Text
.
AlignVCenter
}
}
}
Component
{
id
:
arbBox
Rectangle
{
...
...
@@ -727,25 +746,4 @@ Rectangle {
}
}
}
Row
{
spacing
:
10
anchors.horizontalCenter
:
parent
.
horizontalCenter
Loader
{
property
color
backgroundColor
:
qgcPal
.
window
sourceComponent
:
arbBox
}
Loader
{
property
color
backgroundColor
:
qgcPal
.
windowShade
sourceComponent
:
arbBox
}
Loader
{
property
color
backgroundColor
:
qgcPal
.
windowShadeDark
sourceComponent
:
arbBox
}
}
}
}
}
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