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
62fb732c
Commit
62fb732c
authored
Mar 27, 2017
by
Gus Grubba
Committed by
GitHub
Mar 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4866 from dogmaphobic/paletteAdjustments
Palette adjustments
parents
926fa895
74dc5416
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
320 additions
and
32 deletions
+320
-32
SafetyComponent.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+5
-5
FactTextField.qml
src/FactSystem/FactControls/FactTextField.qml
+1
-1
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+5
-5
QGCPalette.cc
src/QGCPalette.cc
+27
-6
QGCPalette.h
src/QGCPalette.h
+23
-12
QmlTest.qml
src/QmlControls/QmlTest.qml
+259
-3
No files found.
src/AutoPilotPlugins/PX4/SafetyComponent.qml
View file @
62fb732c
...
@@ -330,7 +330,7 @@ SetupPage {
...
@@ -330,7 +330,7 @@ SetupPage {
id
:
fenceAltMaxCheckBox
id
:
fenceAltMaxCheckBox
anchors.baseline
:
fenceAltMaxField
.
baseline
anchors.baseline
:
fenceAltMaxField
.
baseline
text
:
qsTr
(
"
Max altitude:
"
)
text
:
qsTr
(
"
Max altitude:
"
)
checked
:
_fenceAlt
.
value
>
0
checked
:
_fenceAlt
?
_fenceAlt
.
value
>
0
:
false
onClicked
:
_fenceAlt
.
value
=
checked
?
100
:
0
onClicked
:
_fenceAlt
.
value
=
checked
?
100
:
0
width
:
_middleRowWidth
width
:
_middleRowWidth
}
}
...
@@ -408,21 +408,21 @@ SetupPage {
...
@@ -408,21 +408,21 @@ SetupPage {
ExclusiveGroup
{
id
:
homeLoiterGroup
}
ExclusiveGroup
{
id
:
homeLoiterGroup
}
QGCRadioButton
{
QGCRadioButton
{
id
:
homeLandRadio
id
:
homeLandRadio
checked
:
_rtlLandDelay
.
value
===
0
checked
:
_rtlLandDelay
?
_rtlLandDelay
.
value
===
0
:
false
exclusiveGroup
:
homeLoiterGroup
exclusiveGroup
:
homeLoiterGroup
text
:
"
Land immediately
"
text
:
"
Land immediately
"
onClicked
:
_rtlLandDelay
.
value
=
0
onClicked
:
_rtlLandDelay
.
value
=
0
}
}
QGCRadioButton
{
QGCRadioButton
{
id
:
homeLoiterNoLandRadio
id
:
homeLoiterNoLandRadio
checked
:
_rtlLandDelay
.
value
<
0
checked
:
_rtlLandDelay
?
_rtlLandDelay
.
value
<
0
:
false
exclusiveGroup
:
homeLoiterGroup
exclusiveGroup
:
homeLoiterGroup
text
:
"
Loiter and do not land
"
text
:
"
Loiter and do not land
"
onClicked
:
_rtlLandDelay
.
value
=
-
1
onClicked
:
_rtlLandDelay
.
value
=
-
1
}
}
QGCRadioButton
{
QGCRadioButton
{
id
:
homeLoiterLandRadio
id
:
homeLoiterLandRadio
checked
:
_rtlLandDelay
.
value
>
0
checked
:
_rtlLandDelay
?
_rtlLandDelay
.
value
>
0
:
false
exclusiveGroup
:
homeLoiterGroup
exclusiveGroup
:
homeLoiterGroup
text
:
qsTr
(
"
Loiter and land after specified time
"
)
text
:
qsTr
(
"
Loiter and land after specified time
"
)
onClicked
:
_rtlLandDelay
.
value
=
60
onClicked
:
_rtlLandDelay
.
value
=
60
...
@@ -504,7 +504,7 @@ SetupPage {
...
@@ -504,7 +504,7 @@ SetupPage {
spacing
:
_margins
*
0.5
spacing
:
_margins
*
0.5
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
Row
{
Row
{
visible
:
!
controller
.
vehicle
.
fixedWing
&&
(
_landSpeedMC
!==
-
1
)
visible
:
controller
.
vehicle
?
(
!
controller
.
vehicle
.
fixedWing
&&
(
_landSpeedMC
!==
-
1
))
:
false
QGCLabel
{
QGCLabel
{
anchors.baseline
:
landVelField
.
baseline
anchors.baseline
:
landVelField
.
baseline
width
:
_middleRowWidth
width
:
_middleRowWidth
...
...
src/FactSystem/FactControls/FactTextField.qml
View file @
62fb732c
...
@@ -21,7 +21,7 @@ QGCTextField {
...
@@ -21,7 +21,7 @@ QGCTextField {
property
string
_validateString
property
string
_validateString
// At this point all Facts are numeric
// At this point all Facts are numeric
inputMethodHints
:
(
fact
.
typeIsString
||
ScreenTools
.
isiOS
)
?
inputMethodHints
:
(
fact
||
fact
.
typeIsString
||
ScreenTools
.
isiOS
)
?
Qt
.
ImhNone
:
// iOS numeric keyboard has no done button, we can't use it
Qt
.
ImhNone
:
// iOS numeric keyboard has no done button, we can't use it
Qt
.
ImhFormattedNumbersOnly
// Forces use of virtual numeric keyboard
Qt
.
ImhFormattedNumbersOnly
// Forces use of virtual numeric keyboard
...
...
src/PlanView/MissionItemEditor.qml
View file @
62fb732c
...
@@ -15,7 +15,7 @@ Rectangle {
...
@@ -15,7 +15,7 @@ Rectangle {
id
:
_root
id
:
_root
height
:
editorLoader
.
y
+
editorLoader
.
height
+
(
_margin
*
2
)
height
:
editorLoader
.
y
+
editorLoader
.
height
+
(
_margin
*
2
)
color
:
_currentItem
?
qgcPal
.
buttonHighlight
:
qgcPal
.
windowShade
color
:
_currentItem
?
qgcPal
.
primaryButton
:
qgcPal
.
windowShade
radius
:
_radius
radius
:
_radius
property
var
map
///< Map control
property
var
map
///< Map control
...
@@ -26,10 +26,10 @@ Rectangle {
...
@@ -26,10 +26,10 @@ Rectangle {
signal
remove
signal
remove
signal
insert
signal
insert
property
bool
_currentItem
:
missionItem
.
isCurrentItem
property
bool
_currentItem
:
missionItem
.
isCurrentItem
property
color
_outerTextColor
:
_currentItem
?
"
black
"
:
qgcPal
.
text
property
color
_outerTextColor
:
_currentItem
?
qgcPal
.
primaryButtonText
:
qgcPal
.
text
property
bool
_noMissionItemsAdded
:
ListView
.
view
.
model
.
count
===
1
property
bool
_noMissionItemsAdded
:
ListView
.
view
.
model
.
count
===
1
property
real
_sectionSpacer
:
ScreenTools
.
defaultFontPixelWidth
/
2
// spacing between section headings
property
real
_sectionSpacer
:
ScreenTools
.
defaultFontPixelWidth
/
2
// spacing between section headings
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_margin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_margin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
...
...
src/QGCPalette.cc
View file @
62fb732c
...
@@ -42,7 +42,7 @@ QColor QGCPalette::_text[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
...
@@ -42,7 +42,7 @@ QColor QGCPalette::_text[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
QColor
QGCPalette
::
_warningText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_warningText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#cc0808"
),
QColor
(
"#cc0808"
)
},
{
QColor
(
"#cc0808"
),
QColor
(
"#cc0808"
)
},
{
QColor
(
"#f
d5d13"
),
QColor
(
"#fd5d13
"
)
}
{
QColor
(
"#f
85761"
),
QColor
(
"#f85761
"
)
}
};
};
QColor
QGCPalette
::
_button
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_button
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
...
@@ -56,18 +56,18 @@ QColor QGCPalette::_buttonText[QGCPalette::_cThemes][QGCPalette::_cColorGroups]
...
@@ -56,18 +56,18 @@ QColor QGCPalette::_buttonText[QGCPalette::_cThemes][QGCPalette::_cColorGroups]
};
};
QColor
QGCPalette
::
_buttonHighlight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_buttonHighlight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#e4e4e4"
),
QColor
(
"#
33b5e5
"
)
},
{
QColor
(
"#e4e4e4"
),
QColor
(
"#
946120
"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
0xed
,
0xd4
,
0x69
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#fff291"
)
},
};
};
QColor
QGCPalette
::
_buttonHighlightText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_buttonHighlightText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
"#ffffff"
)
},
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0x2c
,
0x2c
,
0x2c
),
QColor
(
0
,
0
,
0
)
},
};
};
QColor
QGCPalette
::
_primaryButton
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_primaryButton
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#
badec5
"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#
8cb3be
"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#
badec5
"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
"#
8cb3be
"
)
},
};
};
QColor
QGCPalette
::
_primaryButtonText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_primaryButtonText
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
...
@@ -116,6 +116,27 @@ QColor QGCPalette::_brandingBlue[QGCPalette::_cThemes][QGCPalette::_cColorGroups
...
@@ -116,6 +116,27 @@ 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"
)
},
};
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QObject
(
parent
),
QObject
(
parent
),
_colorGroupEnabled
(
true
)
_colorGroupEnabled
(
true
)
...
...
src/QGCPalette.h
View file @
62fb732c
...
@@ -60,12 +60,11 @@ class QGCPalette : public QObject
...
@@ -60,12 +60,11 @@ class QGCPalette : public QObject
Q_PROPERTY
(
QColor
brandingPurple
READ
brandingPurple
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
brandingPurple
READ
brandingPurple
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
brandingBlue
READ
brandingBlue
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
brandingBlue
READ
brandingBlue
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorGreen
READ
colorGreen
CONSTANT
)
Q_PROPERTY
(
QColor
colorGreen
READ
colorGreen
WRITE
setColorGreen
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorOrange
READ
colorOrange
CONSTANT
)
Q_PROPERTY
(
QColor
colorOrange
READ
colorOrange
WRITE
setColorOrange
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorRed
READ
colorRed
CONSTANT
)
Q_PROPERTY
(
QColor
colorRed
READ
colorRed
WRITE
setColorRed
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorGrey
READ
colorGrey
CONSTANT
)
Q_PROPERTY
(
QColor
colorGrey
READ
colorGrey
WRITE
setColorGrey
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorBlue
READ
colorBlue
CONSTANT
)
Q_PROPERTY
(
QColor
colorBlue
READ
colorBlue
WRITE
setColorBlue
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorWhite
READ
colorWhite
CONSTANT
)
public:
public:
enum
ColorGroup
{
enum
ColorGroup
{
...
@@ -142,12 +141,12 @@ public:
...
@@ -142,12 +141,12 @@ public:
/// Blue color from branding guidelines
/// Blue color from branding guidelines
QColor
brandingBlue
(
void
)
const
{
return
_brandingBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
brandingBlue
(
void
)
const
{
return
_brandingBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
colorGreen
()
{
return
QColor
(
"#05f068"
);
}
/// Arbitrary colors used for UI elements. Usually over _window and _windowShade.
QColor
color
Orange
()
{
return
QColor
(
"#f0ab06"
)
;
}
QColor
color
Green
()
const
{
return
_colorGreen
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
;
}
QColor
color
Red
()
{
return
QColor
(
"#fc4638"
)
;
}
QColor
color
Orange
()
const
{
return
_colorOrange
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
;
}
QColor
color
Grey
()
{
return
QColor
(
"#7f7f7f"
)
;
}
QColor
color
Red
()
const
{
return
_colorRed
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
;
}
QColor
color
Blue
()
{
return
QColor
(
"#636efe"
)
;
}
QColor
color
Grey
()
const
{
return
_colorGrey
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
;
}
QColor
color
White
()
{
return
QColor
(
"#ffffff"
)
;
}
QColor
color
Blue
()
const
{
return
_colorBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
;
}
void
setWindow
(
QColor
&
color
)
{
_window
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindow
(
QColor
&
color
)
{
_window
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShade
(
QColor
&
color
)
{
_windowShade
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShade
(
QColor
&
color
)
{
_windowShade
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
...
@@ -167,6 +166,12 @@ public:
...
@@ -167,6 +166,12 @@ public:
void
setMapWidgetBorderLight
(
QColor
&
color
)
{
_mapWidgetBorderLight
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapWidgetBorderLight
(
QColor
&
color
)
{
_mapWidgetBorderLight
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapWidgetBorderDark
(
QColor
&
color
)
{
_mapWidgetBorderDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapWidgetBorderDark
(
QColor
&
color
)
{
_mapWidgetBorderDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setColorGreen
(
QColor
&
color
)
{
_colorGreen
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setColorOrange
(
QColor
&
color
)
{
_colorOrange
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setColorRed
(
QColor
&
color
)
{
_colorRed
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setColorGrey
(
QColor
&
color
)
{
_colorGrey
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setColorBlue
(
QColor
&
color
)
{
_colorBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
static
Theme
globalTheme
(
void
)
{
return
_theme
;
}
static
Theme
globalTheme
(
void
)
{
return
_theme
;
}
static
void
setGlobalTheme
(
Theme
newTheme
);
static
void
setGlobalTheme
(
Theme
newTheme
);
...
@@ -211,6 +216,12 @@ private:
...
@@ -211,6 +216,12 @@ private:
static
QColor
_brandingPurple
[
_cThemes
][
_cColorGroups
];
static
QColor
_brandingPurple
[
_cThemes
][
_cColorGroups
];
static
QColor
_brandingBlue
[
_cThemes
][
_cColorGroups
];
static
QColor
_brandingBlue
[
_cThemes
][
_cColorGroups
];
static
QColor
_colorGreen
[
_cThemes
][
_cColorGroups
];
static
QColor
_colorOrange
[
_cThemes
][
_cColorGroups
];
static
QColor
_colorRed
[
_cThemes
][
_cColorGroups
];
static
QColor
_colorGrey
[
_cThemes
][
_cColorGroups
];
static
QColor
_colorBlue
[
_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/QmlTest.qml
View file @
62fb732c
This diff is collapsed.
Click to expand it.
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