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
333d5c99
Commit
333d5c99
authored
Mar 28, 2017
by
Gus Grubba
Committed by
GitHub
Mar 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4879 from dogmaphobic/alertMessage
QGCPalette work
parents
7363819d
0b00248c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
384 additions
and
466 deletions
+384
-466
QGCPalette.cc
src/QGCPalette.cc
+33
-119
QGCPalette.h
src/QGCPalette.h
+62
-172
QmlTest.qml
src/QmlControls/QmlTest.qml
+284
-170
MainWindowInner.qml
src/ui/MainWindowInner.qml
+5
-5
No files found.
src/QGCPalette.cc
View file @
333d5c99
...
...
@@ -20,122 +20,37 @@ QList<QGCPalette*> QGCPalette::_paletteObjects;
QGCPalette
::
Theme
QGCPalette
::
_theme
=
QGCPalette
::
Dark
;
QColor
QGCPalette
::
_window
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#ffffff"
),
QColor
(
"#ffffff"
)
},
{
QColor
(
0x22
,
0x22
,
0x22
),
QColor
(
0x22
,
0x22
,
0x22
)
}
};
QColor
QGCPalette
::
_windowShade
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#d9d9d9"
),
QColor
(
"#d9d9d9"
)
},
{
QColor
(
51
,
51
,
51
),
QColor
(
51
,
51
,
51
)
}
};
QColor
QGCPalette
::
_windowShadeDark
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#bdbdbd"
),
QColor
(
"#bdbdbd"
)
},
{
QColor
(
40
,
40
,
40
),
QColor
(
40
,
40
,
40
)
}
};
QColor
QGCPalette
::
_text
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#9d9d9d"
),
QColor
(
"#000000"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
0xFF
,
0xFF
,
0xFF
)
}
};
QColor
QGCPalette
::
_warningText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#cc0808"
),
QColor
(
"#cc0808"
)
},
{
QColor
(
"#f85761"
),
QColor
(
"#f85761"
)
}
};
QColor
QGCPalette
::
_button
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#ffffff"
),
QColor
(
"#ffffff"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
98
,
98
,
100
)
},
};
QColor
QGCPalette
::
_buttonText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#9d9d9d"
),
QColor
(
"#000000"
)
},
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0xFF
,
0xFF
,
0xFF
)
},
};
QColor
QGCPalette
::
_buttonHighlight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#e4e4e4"
),
QColor
(
"#946120"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#fff291"
)
},
};
QColor
QGCPalette
::
_buttonHighlightText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
"#ffffff"
)
},
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
};
QColor
QGCPalette
::
_primaryButton
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#8cb3be"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#8cb3be"
)
},
};
QColor
QGCPalette
::
_primaryButtonText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
};
QColor
QGCPalette
::
_textField
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#ffffff"
),
QColor
(
"#ffffff"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
255
,
255
,
255
)
},
};
QColor
QGCPalette
::
_textFieldText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#dedede"
),
QColor
(
"#000000"
)
},
{
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
)
},
};
// Map widget colors are not affecting by theming
QColor
QGCPalette
::
_mapWidgetBorderLight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
255
,
255
,
255
),
QColor
(
255
,
255
,
255
)
},
{
QColor
(
255
,
255
,
255
),
QColor
(
255
,
255
,
255
)
},
};
QColor
QGCPalette
::
_mapWidgetBorderDark
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0
,
0
,
0
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0
,
0
,
0
),
QColor
(
0
,
0
,
0
)
},
};
QColor
QGCPalette
::
_brandingPurple
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#4A2C6D"
),
QColor
(
"#4A2C6D"
)
},
{
QColor
(
"#4A2C6D"
),
QColor
(
"#4A2C6D"
)
},
};
QColor
QGCPalette
::
_brandingBlue
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#48D6FF"
),
QColor
(
"#48D6FF"
)
},
{
QColor
(
"#48D6FF"
),
QColor
(
"#48D6FF"
)
},
};
QColor
QGCPalette
::
_colorGreen
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#009431"
),
QColor
(
"#009431"
)
},
//-- Light
{
QColor
(
"#00e04b"
),
QColor
(
"#00e04b"
)
},
//-- Dark
};
QColor
QGCPalette
::
_colorOrange
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#b95604"
),
QColor
(
"#b95604"
)
},
{
QColor
(
"#de8500"
),
QColor
(
"#de8500"
)
},
};
QColor
QGCPalette
::
_colorRed
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#ed3939"
),
QColor
(
"#ed3939"
)
},
{
QColor
(
"#f32836"
),
QColor
(
"#f32836"
)
},
};
QColor
QGCPalette
::
_colorGrey
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#808080"
),
QColor
(
"#808080"
)
},
{
QColor
(
"#bfbfbf"
),
QColor
(
"#bfbfbf"
)
},
};
QColor
QGCPalette
::
_colorBlue
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#1a72ff"
),
QColor
(
"#1a72ff"
)
},
{
QColor
(
"#536dff"
),
QColor
(
"#536dff"
)
},
};
// Light Dark
// Disabled Enabled Disabled Enabled
DECLARE_QGC_COLOR
(
window
,
"#ffffff"
,
"#ffffff"
,
"#222222"
,
"#222222"
)
DECLARE_QGC_COLOR
(
windowShade
,
"#d9d9d9"
,
"#d9d9d9"
,
"#333333"
,
"#333333"
)
DECLARE_QGC_COLOR
(
windowShadeDark
,
"#bdbdbd"
,
"#bdbdbd"
,
"#282828"
,
"#282828"
)
DECLARE_QGC_COLOR
(
text
,
"#9d9d9d"
,
"#000000"
,
"#3a3a3a"
,
"#ffffff"
)
DECLARE_QGC_COLOR
(
warningText
,
"#cc0808"
,
"#cc0808"
,
"#f85761"
,
"#f85761"
)
DECLARE_QGC_COLOR
(
button
,
"#ffffff"
,
"#ffffff"
,
"#606060"
,
"#626270"
)
DECLARE_QGC_COLOR
(
buttonText
,
"#9d9d9d"
,
"#000000"
,
"#2c2c2c"
,
"#ffffff"
)
DECLARE_QGC_COLOR
(
buttonHighlight
,
"#e4e4e4"
,
"#946120"
,
"#3a3a3a"
,
"#fff291"
)
DECLARE_QGC_COLOR
(
buttonHighlightText
,
"#2c2c2c"
,
"#ffffff"
,
"#2c2c2c"
,
"#000000"
)
DECLARE_QGC_COLOR
(
primaryButton
,
"#585858"
,
"#8cb3be"
,
"#585858"
,
"#8cb3be"
)
DECLARE_QGC_COLOR
(
primaryButtonText
,
"#2c2c2c"
,
"#000000"
,
"#2c2c2c"
,
"#000000"
)
DECLARE_QGC_COLOR
(
textField
,
"#ffffff"
,
"#ffffff"
,
"#585858"
,
"#ffffff"
)
DECLARE_QGC_COLOR
(
textFieldText
,
"#dedede"
,
"#000000"
,
"#2c2c2c"
,
"#000000"
)
DECLARE_QGC_COLOR
(
mapButton
,
"#585858"
,
"#000000"
,
"#585858"
,
"#000000"
)
DECLARE_QGC_COLOR
(
mapButtonHighlight
,
"#585858"
,
"#be781c"
,
"#585858"
,
"#be781c"
)
DECLARE_QGC_COLOR
(
colorGreen
,
"#009431"
,
"#009431"
,
"#00e04b"
,
"#00e04b"
)
DECLARE_QGC_COLOR
(
colorOrange
,
"#b95604"
,
"#b95604"
,
"#de8500"
,
"#de8500"
)
DECLARE_QGC_COLOR
(
colorRed
,
"#ed3939"
,
"#ed3939"
,
"#f32836"
,
"#f32836"
)
DECLARE_QGC_COLOR
(
colorGrey
,
"#808080"
,
"#808080"
,
"#bfbfbf"
,
"#bfbfbf"
)
DECLARE_QGC_COLOR
(
colorBlue
,
"#1a72ff"
,
"#1a72ff"
,
"#536dff"
,
"#536dff"
)
DECLARE_QGC_COLOR
(
alertBackground
,
"#eecc44"
,
"#eecc44"
,
"#eecc44"
,
"#eecc44"
)
DECLARE_QGC_COLOR
(
alertBorder
,
"#808080"
,
"#808080"
,
"#808080"
,
"#808080"
)
DECLARE_QGC_COLOR
(
alertText
,
"#000000"
,
"#000000"
,
"#000000"
,
"#000000"
)
// Colors are not affecting by theming
DECLARE_QGC_COLOR
(
mapWidgetBorderLight
,
"#ffffff"
,
"#ffffff"
,
"#ffffff"
,
"#ffffff"
)
DECLARE_QGC_COLOR
(
mapWidgetBorderDark
,
"#000000"
,
"#000000"
,
"#000000"
,
"#000000"
)
DECLARE_QGC_COLOR
(
brandingPurple
,
"#4A2C6D"
,
"#4A2C6D"
,
"#4A2C6D"
,
"#4A2C6D"
)
DECLARE_QGC_COLOR
(
brandingBlue
,
"#48D6FF"
,
"#48D6FF"
,
"#48D6FF"
,
"#48D6FF"
)
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QObject
(
parent
),
...
...
@@ -167,7 +82,7 @@ void QGCPalette::setGlobalTheme(Theme newTheme)
}
}
void
QGCPalette
::
_signalPaletteChangeToAll
(
void
)
void
QGCPalette
::
_signalPaletteChangeToAll
()
{
// Notify all objects of the new theme
foreach
(
QGCPalette
*
palette
,
_paletteObjects
)
{
...
...
@@ -175,8 +90,7 @@ void QGCPalette::_signalPaletteChangeToAll(void)
}
}
void
QGCPalette
::
_signalPaletteChanged
(
void
)
void
QGCPalette
::
_signalPaletteChanged
()
{
emit
paletteChanged
();
}
src/QGCPalette.h
View file @
333d5c99
This diff is collapsed.
Click to expand it.
src/QmlControls/QmlTest.qml
View file @
333d5c99
This diff is collapsed.
Click to expand it.
src/ui/MainWindowInner.qml
View file @
333d5c99
...
...
@@ -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