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
b80a810a
Commit
b80a810a
authored
Mar 28, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding alert message colors
parent
d5e12680
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
321 additions
and
175 deletions
+321
-175
QGCPalette.cc
src/QGCPalette.cc
+15
-0
QGCPalette.h
src/QGCPalette.h
+17
-0
QmlTest.qml
src/QmlControls/QmlTest.qml
+284
-170
MainWindowInner.qml
src/ui/MainWindowInner.qml
+5
-5
No files found.
src/QGCPalette.cc
View file @
b80a810a
...
...
@@ -137,6 +137,21 @@ QColor QGCPalette::_colorBlue[QGCPalette::_cThemes][QGCPalette::_cColorGroups] =
{
QColor
(
"#536dff"
),
QColor
(
"#536dff"
)
},
};
QColor
QGCPalette
::
_alertBackground
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#eecc44"
),
QColor
(
"#eecc44"
)
},
{
QColor
(
"#eecc44"
),
QColor
(
"#eecc44"
)
},
};
QColor
QGCPalette
::
_alertBorder
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#808080"
),
QColor
(
"#808080"
)
},
{
QColor
(
"#808080"
),
QColor
(
"#808080"
)
},
};
QColor
QGCPalette
::
_alertText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0
,
0
,
0
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0
,
0
,
0
),
QColor
(
0
,
0
,
0
)
},
};
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QObject
(
parent
),
_colorGroupEnabled
(
true
)
...
...
src/QGCPalette.h
View file @
b80a810a
...
...
@@ -66,6 +66,10 @@ class QGCPalette : public QObject
Q_PROPERTY
(
QColor
colorGrey
READ
colorGrey
WRITE
setColorGrey
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorBlue
READ
colorBlue
WRITE
setColorBlue
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
alertBackground
READ
alertBackground
WRITE
setAlertBackground
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
alertBorder
READ
alertBorder
WRITE
setAlertBorder
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
alertText
READ
alertText
WRITE
setAlertText
NOTIFY
paletteChanged
)
public:
enum
ColorGroup
{
Disabled
=
0
,
...
...
@@ -148,6 +152,11 @@ public:
QColor
colorGrey
()
const
{
return
_colorGrey
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
colorBlue
()
const
{
return
_colorBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
/// Alert and important message dialogs
QColor
alertBackground
()
const
{
return
_alertBackground
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
alertBorder
()
const
{
return
_alertBorder
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
alertText
()
const
{
return
_alertText
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
void
setWindow
(
QColor
&
color
)
{
_window
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShade
(
QColor
&
color
)
{
_windowShade
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShadeDark
(
QColor
&
color
)
{
_windowShadeDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
...
...
@@ -172,6 +181,10 @@ public:
void
setColorGrey
(
QColor
&
color
)
{
_colorGrey
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setColorBlue
(
QColor
&
color
)
{
_colorBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setAlertBackground
(
QColor
&
color
)
{
_alertBackground
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setAlertBorder
(
QColor
&
color
)
{
_alertBorder
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setAlertText
(
QColor
&
color
)
{
_alertText
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
static
Theme
globalTheme
(
void
)
{
return
_theme
;
}
static
void
setGlobalTheme
(
Theme
newTheme
);
...
...
@@ -222,6 +235,10 @@ private:
static
QColor
_colorGrey
[
_cThemes
][
_cColorGroups
];
static
QColor
_colorBlue
[
_cThemes
][
_cColorGroups
];
static
QColor
_alertBackground
[
_cThemes
][
_cColorGroups
];
static
QColor
_alertBorder
[
_cThemes
][
_cColorGroups
];
static
QColor
_alertText
[
_cThemes
][
_cColorGroups
];
void
_themeChanged
(
void
);
static
QList
<
QGCPalette
*>
_paletteObjects
;
///< List of all active QGCPalette objects
...
...
src/QmlControls/QmlTest.qml
View file @
b80a810a
This diff is collapsed.
Click to expand it.
src/ui/MainWindowInner.qml
View file @
b80a810a
...
...
@@ -429,13 +429,13 @@ Item {
id
:
criticalMmessageArea
width
:
mainWindow
.
width
*
0.55
height
:
Math
.
min
(
criticalMessageText
.
height
+
_textMargins
*
2
,
ScreenTools
.
defaultFontPixelHeight
*
6
)
color
:
"
#eecc44
"
color
:
qgcPal
.
alertBackground
visible
:
false
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.top
:
parent
.
top
anchors.topMargin
:
toolBar
.
height
+
ScreenTools
.
defaultFontPixelHeight
/
2
border.color
:
"
#808080
"
border.color
:
qgcPal
.
alertBorder
border.width
:
2
readonly
property
real
_textMargins
:
ScreenTools
.
defaultFontPixelHeight
...
...
@@ -484,7 +484,7 @@ Item {
font.pointSize
:
ScreenTools
.
defaultFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
wrapMode
:
TextEdit
.
WordWrap
color
:
"
black
"
color
:
qgcPal
.
alertText
}
}
...
...
@@ -499,7 +499,7 @@ Item {
sourceSize.height
:
width
source
:
"
/res/XDelete.svg
"
fillMode
:
Image
.
PreserveAspectFit
color
:
"
black
"
color
:
qgcPal
.
alertText
MouseArea
{
anchors.fill
:
parent
anchors.margins
:
ScreenTools
.
isMobile
?
-
ScreenTools
.
defaultFontPixelHeight
:
0
...
...
@@ -520,7 +520,7 @@ Item {
source
:
"
/res/ArrowDown.svg
"
fillMode
:
Image
.
PreserveAspectFit
visible
:
criticalMessageText
.
lineCount
>
5
color
:
"
black
"
color
:
qgcPal
.
alertText
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
...
...
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