Browse Source

Merge pull request #6305 from DonLakeFlyer/MessageAreaPalette

Make the Message Indicator respect palette settings
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
a792ad5cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 38
      src/ui/MainWindowInner.qml
  2. 2
      src/ui/toolbar/MessageIndicator.qml

38
src/ui/MainWindowInner.qml

@ -212,10 +212,10 @@ Item {
} }
} }
function formatMessage(message) { function formatMessage(message) {
message = message.replace(new RegExp("<#E>", "g"), "color: #f95e5e; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;"); message = message.replace(new RegExp("<#E>", "g"), "color: " + qgcPal.warningText + "; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;");
message = message.replace(new RegExp("<#I>", "g"), "color: #f9b55e; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;"); message = message.replace(new RegExp("<#I>", "g"), "color: " + qgcPal.warningText + "; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;");
message = message.replace(new RegExp("<#N>", "g"), "color: #ffffff; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;"); message = message.replace(new RegExp("<#N>", "g"), "color: " + qgcPal.text + "; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;");
return message; return message;
} }
@ -400,22 +400,22 @@ Item {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- System Message Area //-- System Message Area
Rectangle { Rectangle {
id: messageArea id: messageArea
width: mainWindow.width * 0.5
height: mainWindow.height * 0.5
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: toolBar.height + ScreenTools.defaultFontPixelHeight
radius: ScreenTools.defaultFontPixelHeight * 0.5
color: qgcPal.window
border.color: qgcPal.text
visible: false
function close() { function close() {
currentPopUp = null currentPopUp = null
messageText.text = "" messageText.text = ""
messageArea.visible = false messageArea.visible = false
} }
width: mainWindow.width * 0.5
height: mainWindow.height * 0.5
color: Qt.rgba(0,0,0,0.8)
visible: false
radius: ScreenTools.defaultFontPixelHeight * 0.5
border.color: "#808080"
border.width: 2
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: toolBar.height + ScreenTools.defaultFontPixelHeight
MouseArea { MouseArea {
// This MouseArea prevents the Map below it from getting Mouse events. Without this // This MouseArea prevents the Map below it from getting Mouse events. Without this
// things like mousewheel will scroll the Flickable and then scroll the map as well. // things like mousewheel will scroll the Flickable and then scroll the map as well.
@ -435,11 +435,11 @@ Item {
id: messageText id: messageText
readOnly: true readOnly: true
textFormat: TextEdit.RichText textFormat: TextEdit.RichText
color: "white" color: qgcPal.text
} }
} }
//-- Dismiss System Message //-- Dismiss System Message
Image { QGCColoredImage {
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
@ -450,6 +450,7 @@ Item {
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
mipmap: true mipmap: true
smooth: true smooth: true
color: qgcPal.text
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
anchors.margins: ScreenTools.isMobile ? -ScreenTools.defaultFontPixelHeight : 0 anchors.margins: ScreenTools.isMobile ? -ScreenTools.defaultFontPixelHeight : 0
@ -459,7 +460,7 @@ Item {
} }
} }
//-- Clear Messages //-- Clear Messages
Image { QGCColoredImage {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
@ -470,6 +471,7 @@ Item {
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
mipmap: true mipmap: true
smooth: true smooth: true
color: qgcPal.text
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {

2
src/ui/toolbar/MessageIndicator.qml

@ -19,7 +19,7 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- GPS Indicator //-- Message Indicator
Item { Item {
width: height width: height
anchors.top: parent.top anchors.top: parent.top

Loading…
Cancel
Save