From ff65689eb6feba1eac39933ade43965da4bf43a8 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 2 Apr 2021 14:57:01 +0100 Subject: [PATCH] Launcher: fix some missing hard-coded styles --- src/GUI/qml/AddButton.qml | 2 +- src/GUI/qml/AddCatalogPanel.qml | 1 + src/GUI/qml/AddOns.qml | 4 ++++ src/GUI/qml/AdvancedSettingsToggle.qml | 3 +-- src/GUI/qml/AircraftGridDelegate.qml | 4 ++-- src/GUI/qml/AircraftList.qml | 2 +- src/GUI/qml/Checkbox.qml | 3 ++- src/GUI/qml/Launcher.qml | 10 ++++++++++ src/GUI/qml/LineEdit.qml | 3 ++- src/GUI/qml/Location.qml | 14 +++++++------- src/GUI/qml/LocationAirportView.qml | 3 +-- src/GUI/qml/LocationCarrierView.qml | 3 +-- src/GUI/qml/LocationNavaidView.qml | 3 +-- src/GUI/qml/Menu.qml | 4 ++-- src/GUI/qml/NumericalEdit.qml | 1 + src/GUI/qml/OverlayMenu.qml | 3 +-- src/GUI/qml/PlainTextEditBox.qml | 3 ++- src/GUI/qml/PopupChoice.qml | 2 +- src/GUI/qml/SearchButton.qml | 3 ++- src/GUI/qml/Settings.qml | 10 ++++++++-- src/GUI/qml/Style.qml | 1 + src/GUI/qml/Summary.qml | 7 +------ src/GUI/qml/TabButton.qml | 4 ++-- 23 files changed, 55 insertions(+), 38 deletions(-) diff --git a/src/GUI/qml/AddButton.qml b/src/GUI/qml/AddButton.qml index 9eedaad73..cc47af620 100644 --- a/src/GUI/qml/AddButton.qml +++ b/src/GUI/qml/AddButton.qml @@ -16,7 +16,7 @@ Rectangle { Text { id: label text: qsTr("Add") - color: Style.backgroundColor + color: Style.themeContrastTextColor anchors { left: parent.left diff --git a/src/GUI/qml/AddCatalogPanel.qml b/src/GUI/qml/AddCatalogPanel.qml index 819c3ffd3..e49a0a377 100644 --- a/src/GUI/qml/AddCatalogPanel.qml +++ b/src/GUI/qml/AddCatalogPanel.qml @@ -7,6 +7,7 @@ Rectangle { id: addCatalogPanel state: "start" height: column.height + color: Style.panelBackground readonly property bool isActive: (state != "start") Behavior on height { diff --git a/src/GUI/qml/AddOns.qml b/src/GUI/qml/AddOns.qml index a13783a13..257d9697d 100644 --- a/src/GUI/qml/AddOns.qml +++ b/src/GUI/qml/AddOns.qml @@ -63,6 +63,7 @@ Item { border.width: 1 border.color: Style.frameColor clip: true + color: Style.panelBackground Column { id: catalogsColumn @@ -129,6 +130,7 @@ Item { border.width: 1 border.color: Style.frameColor clip: true + color: Style.panelBackground Column { id: aircraftPathsColumn @@ -185,6 +187,7 @@ Item { border.width: 1 border.color: Style.frameColor clip: true + color: Style.panelBackground Column { id: addonModulePathsColumn @@ -252,6 +255,7 @@ Item { border.width: 1 border.color: Style.frameColor clip: true + color: Style.panelBackground Column { id: sceneryPathsColumn diff --git a/src/GUI/qml/AdvancedSettingsToggle.qml b/src/GUI/qml/AdvancedSettingsToggle.qml index 7b5bedc14..4ba3ee65f 100644 --- a/src/GUI/qml/AdvancedSettingsToggle.qml +++ b/src/GUI/qml/AdvancedSettingsToggle.qml @@ -1,5 +1,4 @@ import QtQuick 2.4 -import "." Item { id: root @@ -32,7 +31,7 @@ Item { anchors.right: gearIcon.left anchors.rightMargin: Style.margin anchors.verticalCenter: parent.verticalCenter - color: "white" + color: Style.themeContrastTextColor font.underline: mouse.containsMouse font.pixelSize: Style.baseFontPixelSize } diff --git a/src/GUI/qml/AircraftGridDelegate.qml b/src/GUI/qml/AircraftGridDelegate.qml index 0d8f4b7f6..7e4b9af47 100644 --- a/src/GUI/qml/AircraftGridDelegate.qml +++ b/src/GUI/qml/AircraftGridDelegate.qml @@ -17,7 +17,7 @@ Item { height: parent.height - 4 color: "transparent" border.width: 1 - border.color: "#dfdfdf" + border.color: Style.minorFrameColor } MouseArea { @@ -47,7 +47,7 @@ Item { Rectangle { anchors.centerIn: parent border.width: 1 - border.color: "#7f7f7f" + border.color: Style.minorFrameColor width: thumbnail.width height: thumbnail.height diff --git a/src/GUI/qml/AircraftList.qml b/src/GUI/qml/AircraftList.qml index 651cf6f85..a06b0efa6 100644 --- a/src/GUI/qml/AircraftList.qml +++ b/src/GUI/qml/AircraftList.qml @@ -1,7 +1,6 @@ import QtQuick 2.2 import FlightGear.Launcher 1.0 as FG import FlightGear 1.0 -import "." // -> forces the qmldir to be loaded FocusScope { @@ -38,6 +37,7 @@ FocusScope id: tabBar height: searchButton.height + (Style.margin * 2) width: parent.width + color: Style.backgroundColor GridToggleButton { id: gridModeToggle diff --git a/src/GUI/qml/Checkbox.qml b/src/GUI/qml/Checkbox.qml index f2c1ffc9d..3843c5630 100644 --- a/src/GUI/qml/Checkbox.qml +++ b/src/GUI/qml/Checkbox.qml @@ -17,13 +17,14 @@ Item { anchors.left: parent.left anchors.leftMargin: 8 anchors.verticalCenter: parent.verticalCenter + color: Style.panelBackground Rectangle { width: 12 height: 12 anchors.centerIn: parent id: checkMark - color: Style.themeColor + color: mouseArea.containsMouse ? Style.activeColor : Style.themeColor visible: checked } } diff --git a/src/GUI/qml/Launcher.qml b/src/GUI/qml/Launcher.qml index ca7694557..c074fc29f 100644 --- a/src/GUI/qml/Launcher.qml +++ b/src/GUI/qml/Launcher.qml @@ -124,6 +124,16 @@ Item { } } + // background fill + Rectangle { + height: parent.height + anchors { + left: sidebar.right + right: parent.right + } + color: Style.backgroundColor + } + Settings { id: settings diff --git a/src/GUI/qml/LineEdit.qml b/src/GUI/qml/LineEdit.qml index f2c03757e..cc8390fd0 100644 --- a/src/GUI/qml/LineEdit.qml +++ b/src/GUI/qml/LineEdit.qml @@ -53,7 +53,8 @@ FocusScope { border.color: root.enabled ? (edit.activeFocus ? Style.frameColor : Style.minorFrameColor) : Style.disabledMinorFrameColor border.width: 1 clip: true - + color: Style.backgroundColor + TextInput { id: edit enabled: root.enabled diff --git a/src/GUI/qml/Location.qml b/src/GUI/qml/Location.qml index f0723a43f..9fcde2812 100644 --- a/src/GUI/qml/Location.qml +++ b/src/GUI/qml/Location.qml @@ -3,7 +3,6 @@ import QtQuick.Controls 2.2 import FlightGear 1.0 import FlightGear.Launcher 1.0 -import "." Item { id: root @@ -93,7 +92,7 @@ Item { Rectangle { anchors.fill: parent - color: "white" + color: Style.backgroundColor } Component { @@ -102,6 +101,7 @@ Item { id: delegateRoot height: delegateContent.height + Style.margin width: searchView.width + color: Style.backgroundColor function itemDescription() { @@ -126,10 +126,10 @@ Item { height: Math.max(delegateIcon.height, delegateText.height) width: parent.width - Rectangle { - visible: delegateMouse.containsMouse - color: "#cfcfcf" - } + // Rectangle { + // visible: delegateMouse.containsMouse + // color: "#cfcfcf" + // } PixmapImage { id: delegateIcon @@ -180,7 +180,7 @@ Item { } } - Text { + StyledText { id: headerText text: qsTr("Location") font.pixelSize: Style.headingFontPixelSize diff --git a/src/GUI/qml/LocationAirportView.qml b/src/GUI/qml/LocationAirportView.qml index 646d3b7f5..5e8937939 100644 --- a/src/GUI/qml/LocationAirportView.qml +++ b/src/GUI/qml/LocationAirportView.qml @@ -1,7 +1,6 @@ import QtQuick 2.4 import FlightGear 1.0 import FlightGear.Launcher 1.0 -import "." Item { id: root @@ -94,7 +93,7 @@ Item { anchors.fill: parent z: -1 opacity: Style.panelOpacity - color: "white" + color: Style.panelBackground } Column { diff --git a/src/GUI/qml/LocationCarrierView.qml b/src/GUI/qml/LocationCarrierView.qml index 77935d226..1884fc2c0 100644 --- a/src/GUI/qml/LocationCarrierView.qml +++ b/src/GUI/qml/LocationCarrierView.qml @@ -1,7 +1,6 @@ import QtQuick 2.4 import FlightGear 1.0 import FlightGear.Launcher 1.0 -import "." Item { property alias geod: diagram.geod @@ -53,7 +52,7 @@ Item { anchors.fill: parent z: -1 opacity: Style.panelOpacity - color: "white" + color: Style.panelBackground } RadioButtonGroup { diff --git a/src/GUI/qml/LocationNavaidView.qml b/src/GUI/qml/LocationNavaidView.qml index 38486fde0..3093e2791 100644 --- a/src/GUI/qml/LocationNavaidView.qml +++ b/src/GUI/qml/LocationNavaidView.qml @@ -1,7 +1,6 @@ import QtQuick 2.4 import FlightGear 1.0 import FlightGear.Launcher 1.0 -import "." Item { property alias location: navaidData.guid @@ -58,7 +57,7 @@ Item { anchors.fill: parent z: -1 opacity: Style.panelOpacity - color: "white" + color: Style.panelBackground } Column { diff --git a/src/GUI/qml/Menu.qml b/src/GUI/qml/Menu.qml index dc0e26b2a..424656749 100644 --- a/src/GUI/qml/Menu.qml +++ b/src/GUI/qml/Menu.qml @@ -45,9 +45,9 @@ Item { Rectangle { id: menuFrame border.width: 1 - border.color: Style.themeColor + border.color: Style.minorFrameColor height: contentBox.childrenRect.height + 2 - color: "white" + color: Style.panelBackground // width is computed during show(), but if we don't see a valid // value here, the Column doesn't position the items until diff --git a/src/GUI/qml/NumericalEdit.qml b/src/GUI/qml/NumericalEdit.qml index fadce9fd2..b55ee9159 100644 --- a/src/GUI/qml/NumericalEdit.qml +++ b/src/GUI/qml/NumericalEdit.qml @@ -191,6 +191,7 @@ FocusScope { radius: Style.roundRadius border.color: root.enable ? (edit.activeFocus ? Style.frameColor : Style.minorFrameColor) : Style.disabledMinorFrameColor border.width: 1 + color: root.enabled ? Style.panelBackground : Style.backgroundColor ClickableText { id: prefix diff --git a/src/GUI/qml/OverlayMenu.qml b/src/GUI/qml/OverlayMenu.qml index ee294de7e..e671735db 100644 --- a/src/GUI/qml/OverlayMenu.qml +++ b/src/GUI/qml/OverlayMenu.qml @@ -1,7 +1,6 @@ import QtQuick 2.4 import QtQuick.Controls 2.2 import FlightGear 1.0 -import "." Rectangle { id: root @@ -12,7 +11,7 @@ Rectangle { property int maximumPermittedHeight: 450 property string displayRole: "display" - color: "white" + color: Style.panelBackground border.width: 1 border.color: Style.minorFrameColor width: flick.width + Style.margin diff --git a/src/GUI/qml/PlainTextEditBox.qml b/src/GUI/qml/PlainTextEditBox.qml index 1b126f26f..5f93648b9 100644 --- a/src/GUI/qml/PlainTextEditBox.qml +++ b/src/GUI/qml/PlainTextEditBox.qml @@ -12,7 +12,8 @@ Rectangle { implicitHeight: edit.height + Style.margin border.color: edit.activeFocus ? Style.frameColor : Style.minorFrameColor border.width: 1 - + color: Style.panelBackground + signal editingFinished(); TextEdit { diff --git a/src/GUI/qml/PopupChoice.qml b/src/GUI/qml/PopupChoice.qml index 98fa1564d..a2f81fd15 100644 --- a/src/GUI/qml/PopupChoice.qml +++ b/src/GUI/qml/PopupChoice.qml @@ -1,7 +1,6 @@ import QtQuick 2.4 import FlightGear.Launcher 1.0 import FlightGear 1.0 -import "." Item { id: root @@ -62,6 +61,7 @@ Item { border.width: 1 height: currentChoiceText.implicitHeight + Style.margin clip: true + color: Style.backgroundColor anchors.left: label.right anchors.leftMargin: Style.margin diff --git a/src/GUI/qml/SearchButton.qml b/src/GUI/qml/SearchButton.qml index 014808a51..ee8489f8a 100644 --- a/src/GUI/qml/SearchButton.qml +++ b/src/GUI/qml/SearchButton.qml @@ -42,7 +42,8 @@ FocusScope border.width: 1 border.color: (mouse.containsMouse | active) ? Style.themeColor: Style.minorFrameColor clip: true - + color: Style.backgroundColor + TextInput { id: buttonText anchors.left: parent.left diff --git a/src/GUI/qml/Settings.qml b/src/GUI/qml/Settings.qml index 13a3b41be..6652738d0 100644 --- a/src/GUI/qml/Settings.qml +++ b/src/GUI/qml/Settings.qml @@ -3,10 +3,16 @@ import QtQuick.Controls 2.2 import FlightGear.Launcher 1.0 import FlightGear 1.0 -import "." Item { id: settings + + Rectangle { + visible: _launcher.isSearchActive + anchors.fill: parent + color: Style.backgroundColor + } + Rectangle { // search 'dimming' rectangle visible: _launcher.isSearchActive @@ -52,7 +58,7 @@ Item { width: parent.width height: headerText.height - Text { + StyledText { id: headerText text: qsTr("Settings") font.pixelSize: Style.headingFontPixelSize diff --git a/src/GUI/qml/Style.qml b/src/GUI/qml/Style.qml index 0f279b585..39cd70e8d 100644 --- a/src/GUI/qml/Style.qml +++ b/src/GUI/qml/Style.qml @@ -15,6 +15,7 @@ QtObject readonly property string backgroundColor: "#ffffff" readonly property string themeColor: "#1b7ad3" readonly property string destructiveActionColor: "#c62703" + readonly property string panelBackground: "#efefef" readonly property string activeColor: Qt.darker(themeColor) readonly property string inverseActiveColor: "#2f2f2f" diff --git a/src/GUI/qml/Summary.qml b/src/GUI/qml/Summary.qml index 0aa8eeaa6..0c08e62f3 100644 --- a/src/GUI/qml/Summary.qml +++ b/src/GUI/qml/Summary.qml @@ -14,11 +14,6 @@ Item { GettingStartedScope.controller: tips.controller - Rectangle { - anchors.fill: parent - color: "#7f7f7f" - } - readonly property string __aircraftDescription: _launcher.selectedAircraftInfo.description PreviewImage { @@ -129,7 +124,7 @@ Item { anchors.fill: parent z: -1 opacity: Style.panelOpacity - color: "white" + color: Style.panelBackground } Grid { diff --git a/src/GUI/qml/TabButton.qml b/src/GUI/qml/TabButton.qml index 5cdf6b159..9e64d3b7c 100644 --- a/src/GUI/qml/TabButton.qml +++ b/src/GUI/qml/TabButton.qml @@ -12,12 +12,12 @@ Rectangle { height: buttonText.height + (radius * 2) radius: 6 - color: mouse.containsMouse ? "#064989" : (active ? "#1b7ad3" : "white") + color: mouse.containsMouse ? Style.activeColor : (active ? Style.themeColor : Style.backgroundColor) StyledText { id: buttonText anchors.centerIn: parent - color: (active | mouse.containsMouse) ? "white" : "#3f3f3f" + color: (active | mouse.containsMouse) ? Style.themeContrastTextColor : Style.baseTextColor } MouseArea {