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
1388ac3a
Commit
1388ac3a
authored
Oct 12, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a palette for map buttons.
parent
6d20e85d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
QGCPalette.cc
src/QGCPalette.cc
+10
-0
QGCPalette.h
src/QGCPalette.h
+12
-0
DropButton.qml
src/QmlControls/DropButton.qml
+1
-1
RoundButton.qml
src/QmlControls/RoundButton.qml
+4
-1
No files found.
src/QGCPalette.cc
View file @
1388ac3a
...
@@ -98,6 +98,16 @@ QColor QGCPalette::_textFieldText[QGCPalette::_cThemes][QGCPalette::_cColorGroup
...
@@ -98,6 +98,16 @@ QColor QGCPalette::_textFieldText[QGCPalette::_cThemes][QGCPalette::_cColorGroup
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
};
};
QColor
QGCPalette
::
_mapButton
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
0
,
0
,
0
)
},
};
QColor
QGCPalette
::
_mapButtonHighlight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
190
,
120
,
28
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
190
,
120
,
28
)
},
};
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QObject
(
parent
),
QObject
(
parent
),
_colorGroupEnabled
(
true
)
_colorGroupEnabled
(
true
)
...
...
src/QGCPalette.h
View file @
1388ac3a
...
@@ -86,6 +86,12 @@ class QGCPalette : public QObject
...
@@ -86,6 +86,12 @@ class QGCPalette : public QObject
// Text color for TextFields
// Text color for TextFields
Q_PROPERTY
(
QColor
textFieldText
READ
textFieldText
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
textFieldText
READ
textFieldText
NOTIFY
paletteChanged
)
/// Background color for map buttons
Q_PROPERTY
(
QColor
mapButton
READ
mapButton
NOTIFY
paletteChanged
)
/// Background color for map button in selected or hover state
Q_PROPERTY
(
QColor
mapButtonHighlight
READ
mapButtonHighlight
NOTIFY
paletteChanged
)
public:
public:
enum
ColorGroup
{
enum
ColorGroup
{
Disabled
=
0
,
Disabled
=
0
,
...
@@ -121,6 +127,9 @@ public:
...
@@ -121,6 +127,9 @@ public:
QColor
textField
(
void
)
const
{
return
_textField
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
textField
(
void
)
const
{
return
_textField
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
textFieldText
(
void
)
const
{
return
_textFieldText
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
textFieldText
(
void
)
const
{
return
_textFieldText
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapButton
(
void
)
const
{
return
_mapButton
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapButtonHighlight
(
void
)
const
{
return
_mapButtonHighlight
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
static
Theme
globalTheme
(
void
)
{
return
_theme
;
}
static
Theme
globalTheme
(
void
)
{
return
_theme
;
}
static
void
setGlobalTheme
(
Theme
newTheme
);
static
void
setGlobalTheme
(
Theme
newTheme
);
...
@@ -154,6 +163,9 @@ private:
...
@@ -154,6 +163,9 @@ private:
static
QColor
_textField
[
_cThemes
][
_cColorGroups
];
static
QColor
_textField
[
_cThemes
][
_cColorGroups
];
static
QColor
_textFieldText
[
_cThemes
][
_cColorGroups
];
static
QColor
_textFieldText
[
_cThemes
][
_cColorGroups
];
static
QColor
_mapButton
[
_cThemes
][
_cColorGroups
];
static
QColor
_mapButtonHighlight
[
_cThemes
][
_cColorGroups
];
void
_themeChanged
(
void
);
void
_themeChanged
(
void
);
static
QList
<
QGCPalette
*>
_paletteObjects
;
///< List of all active QGCPalette objects
static
QList
<
QGCPalette
*>
_paletteObjects
;
///< List of all active QGCPalette objects
...
...
src/QmlControls/DropButton.qml
View file @
1388ac3a
...
@@ -162,7 +162,7 @@ Item {
...
@@ -162,7 +162,7 @@ Item {
border.width
:
2
border.width
:
2
border.color
:
"
white
"
border.color
:
"
white
"
opacity
:
checked
?
0.95
:
0.65
opacity
:
checked
?
0.95
:
0.65
color
:
checked
?
"
orange
"
:
"
black
"
color
:
checked
?
qgcPal
.
mapButtonHighlight
:
qgcPal
.
mapButton
Image
{
Image
{
id
:
button
id
:
button
...
...
src/QmlControls/RoundButton.qml
View file @
1388ac3a
...
@@ -3,6 +3,7 @@ import QtQuick.Controls 1.2
...
@@ -3,6 +3,7 @@ import QtQuick.Controls 1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
Item
{
Item
{
id
:
_root
id
:
_root
...
@@ -17,6 +18,8 @@ Item {
...
@@ -17,6 +18,8 @@ Item {
property
bool
checked
:
false
property
bool
checked
:
false
property
ExclusiveGroup
exclusiveGroup
:
null
property
ExclusiveGroup
exclusiveGroup
:
null
QGCPalette
{
id
:
qgcPal
}
onExclusiveGroupChanged
:
{
onExclusiveGroupChanged
:
{
if
(
exclusiveGroup
)
{
if
(
exclusiveGroup
)
{
exclusiveGroup
.
bindCheckable
(
_root
)
exclusiveGroup
.
bindCheckable
(
_root
)
...
@@ -29,7 +32,7 @@ Item {
...
@@ -29,7 +32,7 @@ Item {
border.width
:
2
border.width
:
2
border.color
:
"
white
"
border.color
:
"
white
"
opacity
:
checked
?
0.95
:
0.65
opacity
:
checked
?
0.95
:
0.65
color
:
checked
?
"
orange
"
:
"
black
"
color
:
checked
?
qgcPal
.
mapButtonHighlight
:
qgcPal
.
mapButton
Image
{
Image
{
id
:
button
id
:
button
anchors.fill
:
parent
anchors.fill
:
parent
...
...
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