Commit bbde40eb authored by Gus Grubba's avatar Gus Grubba

Expand/Colapse Controllers

Adjust colors
Remove unused image
parent 6929d269
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
<file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file> <file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file>
<file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file> <file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file>
<file alias="Help.svg">src/FlightMap/Images/Help.svg</file> <file alias="Help.svg">src/FlightMap/Images/Help.svg</file>
<file alias="Home.svg">src/FlightMap/Images/Home.svg</file>
<file alias="HelpBlack.svg">src/FlightMap/Images/HelpBlack.svg</file> <file alias="HelpBlack.svg">src/FlightMap/Images/HelpBlack.svg</file>
<file alias="MapAddMission.svg">src/FlightMap/Images/MapAddMission.svg</file> <file alias="MapAddMission.svg">src/FlightMap/Images/MapAddMission.svg</file>
<file alias="MapAddMissionBlack.svg">src/FlightMap/Images/MapAddMissionBlack.svg</file> <file alias="MapAddMissionBlack.svg">src/FlightMap/Images/MapAddMissionBlack.svg</file>
...@@ -175,6 +176,7 @@ ...@@ -175,6 +176,7 @@
</qresource> </qresource>
<qresource prefix="/airmap"> <qresource prefix="/airmap">
<file alias="advisory-icon.svg">src/Airmap/images/advisory-icon.svg</file> <file alias="advisory-icon.svg">src/Airmap/images/advisory-icon.svg</file>
<file alias="expand.svg">src/Airmap/images/expand.svg</file>
<file alias="pencil.svg">src/Airmap/images/pencil.svg</file> <file alias="pencil.svg">src/Airmap/images/pencil.svg</file>
</qresource> </qresource>
<qresource prefix="/res"> <qresource prefix="/res">
......
...@@ -63,6 +63,16 @@ Item { ...@@ -63,6 +63,16 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
QGCColoredImage {
width: height
height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height
source: "qrc:/airmap/expand.svg"
color: _colorWhite
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: colapsed = false onClicked: colapsed = false
...@@ -115,11 +125,6 @@ Item { ...@@ -115,11 +125,6 @@ Item {
} }
} }
} }
MouseArea {
anchors.fill: parent
enabled: !colapsed
onClicked: colapsed = true
}
} }
//-- Contents (Brown Box) //-- Contents (Brown Box)
Rectangle { Rectangle {
...@@ -189,7 +194,7 @@ Item { ...@@ -189,7 +194,7 @@ Item {
} }
Rectangle { Rectangle {
id: regButton id: regButton
height: regLabel.height + ScreenTools.defaultFontPixelHeight height: regLabel.height + ScreenTools.defaultFontPixelHeight * 0.5
radius: 2 radius: 2
color: _colorMidBrown color: _colorMidBrown
Layout.fillWidth: true Layout.fillWidth: true
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<g>
<polygon points="70.2,41.7 36,1.797 1.8,41.7 10.35,41.7 10.35,70.203 27.45,70.203 27.45,47.401 44.55,47.401 44.55,70.203
61.65,70.203 61.65,41.7 "/>
</g>
</svg>
...@@ -42,7 +42,7 @@ QGCFlickable { ...@@ -42,7 +42,7 @@ QGCFlickable {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
text: qsTr("GeoFence") text: qsTr("GeoFence")
color: "black" anchors.leftMargin: ScreenTools.defaultFontPixelWidth
} }
Rectangle { Rectangle {
......
...@@ -15,7 +15,7 @@ import QGroundControl.Palette 1.0 ...@@ -15,7 +15,7 @@ import QGroundControl.Palette 1.0
/// Mission item edit control /// Mission item edit control
Rectangle { Rectangle {
id: _root id: _root
height: editorLoader.y + (editorLoader.visible ? editorLoader.height : 0) + (_margin * 2) height: header.height + (editorLoader.visible ? (editorLoader.height + (_margin * 3)) : 0)
color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade
radius: _radius radius: _radius
...@@ -33,15 +33,14 @@ Rectangle { ...@@ -33,15 +33,14 @@ Rectangle {
property var _masterController: masterController property var _masterController: masterController
property var _missionController: _masterController.missionController property var _missionController: _masterController.missionController
property bool _currentItem: missionItem.isCurrentItem property bool _currentItem: missionItem.isCurrentItem
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
property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1
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 * 0.5
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property real _hamburgerSize: commandPicker.height * 0.75 readonly property real _hamburgerSize: header.height * 0.75
readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly
QGCPalette { QGCPalette {
...@@ -52,7 +51,6 @@ Rectangle { ...@@ -52,7 +51,6 @@ Rectangle {
FocusScope { FocusScope {
id: currentItemScope id: currentItemScope
anchors.fill: parent anchors.fill: parent
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
...@@ -62,38 +60,76 @@ Rectangle { ...@@ -62,38 +60,76 @@ Rectangle {
} }
} }
//-- Dialog
Component { Component {
id: editPositionDialog id: editPositionDialog
EditPositionDialog { EditPositionDialog {
coordinate: missionItem.coordinate coordinate: missionItem.coordinate
onCoordinateChanged: missionItem.coordinate = coordinate onCoordinateChanged: missionItem.coordinate = coordinate
} }
} }
//-- Header
Row {
id: header
spacing: ScreenTools.defaultFontPixelWidth
height: ScreenTools.defaultFontPixelHeight * 3
anchors.verticalCenter: editorLoader.visible ? undefined : parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
Item {
width: ScreenTools.defaultFontPixelWidth * 3
height: parent.height
QGCColoredImage {
width: ScreenTools.defaultFontPixelHeight
height: width
sourceSize.height: width
source: "qrc:/qmlimages/Home.svg"
visible: missionItem.homePosition
color: qgcPal.text
anchors.centerIn: parent
}
QGCLabel {
text: missionItem.sequenceNumber
color: qgcPal.text
visible: !missionItem.homePosition
anchors.centerIn: parent
}
}
QGCLabel { QGCLabel {
id: label id: label
anchors.verticalCenter: commandPicker.verticalCenter visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode
anchors.leftMargin: _margin text: missionItem.commandName
anchors.left: parent.left color: qgcPal.text
text: missionItem.homePosition ? "H" : missionItem.sequenceNumber anchors.verticalCenter: parent.verticalCenter
color: _outerTextColor
} }
QGCButton {
id: commandPicker
visible: !label.visible
text: missionItem.commandName
anchors.verticalCenter: parent.verticalCenter
Component {
id: commandDialog
MissionCommandDialog {
missionItem: _root.missionItem
}
}
onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
}
}
//-- Hamburger button at the right of header
QGCColoredImage { QGCColoredImage {
id: hamburger id: hamburger
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: commandPicker.verticalCenter anchors.verticalCenter: header.verticalCenter
width: _hamburgerSize width: _hamburgerSize
height: _hamburgerSize height: _hamburgerSize
sourceSize.height: _hamburgerSize sourceSize.height: _hamburgerSize
source: "qrc:/qmlimages/Hamburger.svg" source: "qrc:/qmlimages/Hamburger.svg"
visible: missionItem.isCurrentItem && missionItem.sequenceNumber != 0 visible: missionItem.isCurrentItem && missionItem.sequenceNumber !== 0
color: qgcPal.windowShade color: qgcPal.text
} }
//-- Hamburger Menu
QGCMouseArea { QGCMouseArea {
fillItem: hamburger fillItem: hamburger
visible: hamburger.visible visible: hamburger.visible
...@@ -101,66 +137,53 @@ Rectangle { ...@@ -101,66 +137,53 @@ Rectangle {
currentItemScope.focus = true currentItemScope.focus = true
hamburgerMenu.popup() hamburgerMenu.popup()
} }
Menu { Menu {
id: hamburgerMenu id: hamburgerMenu
MenuItem { MenuItem {
text: qsTr("Insert waypoint") text: qsTr("Insert waypoint")
onTriggered: insertWaypoint() onTriggered: insertWaypoint()
} }
Menu { Menu {
id: patternMenu id: patternMenu
title: qsTr("Insert pattern") title: qsTr("Insert pattern")
visible: !_singleComplexItem visible: !_singleComplexItem
Instantiator { Instantiator {
model: _missionController.complexMissionItemNames model: _missionController.complexMissionItemNames
onObjectAdded: patternMenu.insertItem(index, object) onObjectAdded: patternMenu.insertItem(index, object)
onObjectRemoved: patternMenu.removeItem(object) onObjectRemoved: patternMenu.removeItem(object)
MenuItem { MenuItem {
text: modelData text: modelData
onTriggered: insertComplexItem(modelData) onTriggered: insertComplexItem(modelData)
} }
} }
} }
MenuItem { MenuItem {
text: qsTr("Insert ") + _missionController.complexMissionItemNames[0] text: qsTr("Insert ") + _missionController.complexMissionItemNames[0]
visible: _singleComplexItem visible: _singleComplexItem
onTriggered: insertComplexItem(_missionController.complexMissionItemNames[0]) onTriggered: insertComplexItem(_missionController.complexMissionItemNames[0])
} }
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: remove() onTriggered: remove()
} }
MenuItem { MenuItem {
text: qsTr("Change command...") text: qsTr("Change command...")
onTriggered: commandPicker.clicked() onTriggered: commandPicker.clicked()
visible: !_waypointsOnlyMode visible: !_waypointsOnlyMode
} }
MenuItem { MenuItem {
text: qsTr("Edit position...") text: qsTr("Edit position...")
visible: missionItem.specifiesCoordinate visible: missionItem.specifiesCoordinate
onTriggered: qgcView.showDialog(editPositionDialog, qsTr("Edit Position"), qgcView.showDialogDefaultWidth, StandardButton.Cancel) onTriggered: qgcView.showDialog(editPositionDialog, qsTr("Edit Position"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
} }
MenuSeparator { MenuSeparator {
visible: missionItem.isSimpleItem && !_waypointsOnlyMode visible: missionItem.isSimpleItem && !_waypointsOnlyMode
} }
MenuItem { MenuItem {
text: qsTr("Show all values") text: qsTr("Show all values")
checkable: true checkable: true
checked: missionItem.isSimpleItem ? missionItem.rawEdit : false checked: missionItem.isSimpleItem ? missionItem.rawEdit : false
visible: missionItem.isSimpleItem && !_waypointsOnlyMode visible: missionItem.isSimpleItem && !_waypointsOnlyMode
onTriggered: { onTriggered: {
if (missionItem.rawEdit) { if (missionItem.rawEdit) {
if (missionItem.friendlyEditAllowed) { if (missionItem.friendlyEditAllowed) {
...@@ -176,48 +199,16 @@ Rectangle { ...@@ -176,48 +199,16 @@ Rectangle {
} }
} }
} }
//-- Editor Content
QGCButton {
id: commandPicker
anchors.topMargin: _margin / 2
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.left: label.right
anchors.top: parent.top
visible: !commandLabel.visible
text: missionItem.commandName
Component {
id: commandDialog
MissionCommandDialog {
missionItem: _root.missionItem
}
}
onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel)
}
QGCLabel {
id: commandLabel
anchors.fill: commandPicker
visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode
verticalAlignment: Text.AlignVCenter
text: missionItem.commandName
color: _outerTextColor
}
Loader { Loader {
id: editorLoader id: editorLoader
anchors.leftMargin: _margin anchors.leftMargin: _margin
anchors.topMargin: _margin
anchors.left: parent.left anchors.left: parent.left
anchors.top: commandPicker.bottom anchors.top: header.bottom
source: missionItem.editorQml source: missionItem.editorQml
visible: _currentItem visible: _currentItem
property var masterController: _masterController property var masterController: _masterController
property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be
property var editorRoot: _root property var editorRoot: _root
} }
} // Rectangle }
This diff is collapsed.
...@@ -28,7 +28,6 @@ QGCFlickable { ...@@ -28,7 +28,6 @@ QGCFlickable {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
text: qsTr("Rally Points") text: qsTr("Rally Points")
color: "black"
} }
Rectangle { Rectangle {
......
...@@ -17,8 +17,7 @@ Rectangle { ...@@ -17,8 +17,7 @@ Rectangle {
property var rallyPoint ///< RallyPoint object associated with editor property var rallyPoint ///< RallyPoint object associated with editor
property var controller ///< RallyPointController property var controller ///< RallyPointController
property bool _currentItem: rallyPoint ? rallyPoint == controller.currentRallyPoint : false property bool _currentItem: rallyPoint ? rallyPoint === controller.currentRallyPoint : false
property color _outerTextColor: _currentItem ? "black" : qgcPal.text
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2
...@@ -47,10 +46,9 @@ Rectangle { ...@@ -47,10 +46,9 @@ Rectangle {
anchors.left: indicator.right anchors.left: indicator.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: qsTr("Rally Point") text: qsTr("Rally Point")
color: _outerTextColor
} }
Image { QGCColoredImage {
id: hamburger id: hamburger
anchors.rightMargin: _margin anchors.rightMargin: _margin
anchors.right: parent.right anchors.right: parent.right
...@@ -59,14 +57,12 @@ Rectangle { ...@@ -59,14 +57,12 @@ Rectangle {
height: width height: width
sourceSize.height: height sourceSize.height: height
source: "qrc:/qmlimages/Hamburger.svg" source: "qrc:/qmlimages/Hamburger.svg"
color: qgcPal.text
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: hamburgerMenu.popup() onClicked: hamburgerMenu.popup()
Menu { Menu {
id: hamburgerMenu id: hamburgerMenu
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: controller.removePoint(rallyPoint) onTriggered: controller.removePoint(rallyPoint)
...@@ -74,7 +70,7 @@ Rectangle { ...@@ -74,7 +70,7 @@ Rectangle {
} }
} }
} }
} // Item - titleBar }
Rectangle { Rectangle {
id: valuesRect id: valuesRect
......
...@@ -73,13 +73,13 @@ void QGCPalette::_buildMap(void) ...@@ -73,13 +73,13 @@ void QGCPalette::_buildMap(void)
DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44") DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44")
DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080") DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080")
DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000") DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000")
DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#8cb3be", "#585858", "#8cb3be") DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#a39fd3", "#585858", "#4e4480")
// Colors are not affecting by theming // Colors are not affecting by theming
DECLARE_QGC_COLOR(mapWidgetBorderLight, "#ffffff", "#ffffff", "#ffffff", "#ffffff") DECLARE_QGC_COLOR(mapWidgetBorderLight, "#ffffff", "#ffffff", "#ffffff", "#ffffff")
DECLARE_QGC_COLOR(mapWidgetBorderDark, "#000000", "#000000", "#000000", "#000000") DECLARE_QGC_COLOR(mapWidgetBorderDark, "#000000", "#000000", "#000000", "#000000")
DECLARE_QGC_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D", "#4A2C6D", "#4A2C6D") DECLARE_QGC_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D", "#4A2C6D", "#4A2C6D")
DECLARE_QGC_COLOR(brandingBlue, "#48D6FF", "#48D6FF", "#48D6FF", "#48D6FF") DECLARE_QGC_COLOR(brandingBlue, "#48D6FF", "#6045c5", "#48D6FF", "#6045c5")
} }
void QGCPalette::setColorGroupEnabled(bool enabled) void QGCPalette::setColorGroupEnabled(bool enabled)
......
...@@ -841,6 +841,38 @@ Rectangle { ...@@ -841,6 +841,38 @@ Rectangle {
text: palette.alertText text: palette.alertText
} }
// missionItemEditor
Loader {
sourceComponent: rowHeader
property var text: "missionItemEditor"
}
ClickableColor {
property var palette: QGCPalette { colorGroupEnabled: false }
color: palette.missionItemEditor
onColorSelected: palette.missionItemEditor = color
}
ClickableColor {
property var palette: QGCPalette { colorGroupEnabled: true }
color: palette.missionItemEditor
onColorSelected: palette.missionItemEditor = color
}
Text {
width: 80
height: 20
color: "black"
horizontalAlignment: Text.AlignHCenter
property var palette: QGCPalette { colorGroupEnabled: false }
text: palette.missionItemEditor
}
Text {
width: 80
height: 20
color: "black"
horizontalAlignment: Text.AlignHCenter
property var palette: QGCPalette { colorGroupEnabled: true }
text: palette.missionItemEditor
}
} }
Column { Column {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment