diff --git a/src/GUI/CMakeLists.txt b/src/GUI/CMakeLists.txt index 3a90f62ab..21289ecf7 100644 --- a/src/GUI/CMakeLists.txt +++ b/src/GUI/CMakeLists.txt @@ -217,6 +217,8 @@ if (HAVE_QT) TipBackgroundBox.hxx GettingStartedScope.hxx GettingStartedScope.cxx + QmlColoredImageProvider.hxx + QmlColoredImageProvider.cxx ${QQUI_SOURCES} ) diff --git a/src/GUI/LauncherController.cxx b/src/GUI/LauncherController.cxx index 7769393c4..0081d5aec 100644 --- a/src/GUI/LauncherController.cxx +++ b/src/GUI/LauncherController.cxx @@ -87,8 +87,6 @@ LauncherController::LauncherController(QObject *parent, QWindow* window) : connect(m_location, &LocationController::descriptionChanged, this, &LauncherController::summaryChanged); - initQML(); - m_aircraftModel = new AircraftItemModel(this); m_installedAircraftModel = new AircraftProxyModel(this, m_aircraftModel); m_installedAircraftModel->setInstalledFilterEnabled(true); @@ -158,7 +156,7 @@ LauncherController::LauncherController(QObject *parent, QWindow* window) : QTimer::singleShot(2000, this, &LauncherController::checkForOldDownloadDir); } -void LauncherController::initQML() +void LauncherController::initQML(int& styleTypeId) { qmlRegisterUncreatableType("FlightGear.Launcher", 1, 0, "LauncherController", "no"); qmlRegisterUncreatableType("FlightGear.Launcher", 1, 0, "LocationController", "no"); @@ -203,6 +201,7 @@ void LauncherController::initQML() qmlRegisterType("FlightGear", 1, 0, "ModelDataExtractor"); qmlRegisterSingletonType(QUrl("qrc:/qml/OverlayShared.qml"), "FlightGear", 1, 0, "OverlayShared"); + styleTypeId = qmlRegisterSingletonType(QUrl("qrc:/qml/Style.qml"), "FlightGear", 1, 0, "Style"); qmlRegisterType("FlightGear", 1, 0, "GettingStartedScope"); qmlRegisterType("FlightGear", 1, 0, "GettingStartedController"); diff --git a/src/GUI/LauncherController.hxx b/src/GUI/LauncherController.hxx index 2c4510235..b796dc6dc 100644 --- a/src/GUI/LauncherController.hxx +++ b/src/GUI/LauncherController.hxx @@ -101,7 +101,7 @@ class LauncherController : public QObject public: explicit LauncherController(QObject *parent, QWindow* win); - void initQML(); + void initQML(int& styleTypeId); Q_INVOKABLE bool validateMetarString(QString metar); diff --git a/src/GUI/LauncherMainWindow.cxx b/src/GUI/LauncherMainWindow.cxx index 6033a8b95..965bc304a 100755 --- a/src/GUI/LauncherMainWindow.cxx +++ b/src/GUI/LauncherMainWindow.cxx @@ -21,15 +21,16 @@ #include "AddOnsController.hxx" #include "AircraftItemModel.hxx" #include "DefaultAircraftLocator.hxx" +#include "GettingStartedTip.hxx" #include "LaunchConfig.hxx" #include "LauncherController.hxx" #include "LauncherNotificationsController.hxx" #include "LauncherPackageDelegate.hxx" #include "LocalAircraftCache.hxx" #include "LocationController.hxx" +#include "QmlColoredImageProvider.hxx" #include "QtLauncher.hxx" #include "UpdateChecker.hxx" -#include "GettingStartedTip.hxx" #include
@@ -40,7 +41,9 @@ LauncherMainWindow::LauncherMainWindow(bool inSimMode) : QQuickView() setTitle("FlightGear " FLIGHTGEAR_VERSION); m_controller = new LauncherController(this, this); - m_controller->initQML(); + + int styleTypeId = 0; + m_controller->initQML(styleTypeId); // use a direct connection to be notified synchronously when the render thread // starts OpenGL. We use this to log the OpenGL information from the @@ -49,6 +52,9 @@ LauncherMainWindow::LauncherMainWindow(bool inSimMode) : QQuickView() this, &LauncherMainWindow::renderTheadSceneGraphInitialized, Qt::DirectConnection); + m_coloredIconProvider = new QmlColoredImageProvider; + engine()->addImageProvider("colored-icon", m_coloredIconProvider); + if (!inSimMode) { #if defined(Q_OS_MAC) QMenuBar* mb = new QMenuBar(); @@ -100,6 +106,8 @@ LauncherMainWindow::LauncherMainWindow(bool inSimMode) : QQuickView() "On Ubuntu/Debian systems, the package is called 'qml-module-qtquick-controls2'")); } + m_coloredIconProvider->loadStyleColors(engine(), styleTypeId); + connect(this, &QQuickView::statusChanged, this, &LauncherMainWindow::onQuickStatusChanged); m_controller->initialRestoreSettings(); diff --git a/src/GUI/LauncherMainWindow.hxx b/src/GUI/LauncherMainWindow.hxx index abebed9ce..65d58fd28 100644 --- a/src/GUI/LauncherMainWindow.hxx +++ b/src/GUI/LauncherMainWindow.hxx @@ -35,6 +35,7 @@ class LaunchConfig; class ViewCommandLinePage; class QQuickItem; class LauncherController; +class QmlColoredImageProvider; class LauncherMainWindow : public QQuickView { @@ -57,6 +58,7 @@ private: bool checkQQC2Availability(); LauncherController* m_controller; + QmlColoredImageProvider* m_coloredIconProvider; }; #endif // of LAUNCHER_MAIN_WINDOW_HXX diff --git a/src/GUI/QmlColoredImageProvider.cxx b/src/GUI/QmlColoredImageProvider.cxx new file mode 100644 index 000000000..412349a05 --- /dev/null +++ b/src/GUI/QmlColoredImageProvider.cxx @@ -0,0 +1,96 @@ +// Copyright (C) 2021 James Turner +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +#include "QmlColoredImageProvider.hxx" + +#include +#include +#include + +QmlColoredImageProvider::QmlColoredImageProvider() : QQuickImageProvider(QQmlImageProviderBase::Image) +{ +} + +void QmlColoredImageProvider::loadStyleColors(QQmlEngine* engine, int styleTypeId) +{ + QJSValue styleObject = engine->singletonInstance(styleTypeId); + if (styleObject.isNull() || !styleObject.isQObject()) { + qWarning() << "Unable to load Style object"; + return; + } + + _themeColor = QColor{styleObject.property("themeColor").toString()}; + _textColor = QColor{styleObject.property("baseTextColor").toString()}; + _themeContrastColor = QColor{styleObject.property("themeContrastTextColor").toString()}; + _activeColor = QColor{styleObject.property("activeColor").toString()}; + _destructiveColor = QColor{styleObject.property("destructiveActionColor").toString()}; +} + + +QImage QmlColoredImageProvider::requestImage(const QString& id, QSize* size, const QSize& requestedSize) +{ + QString path = ":/icon/" + id; + QColor c = _themeColor; + + auto queryPos = id.indexOf('?'); + if (queryPos >= 0) { + path = ":/icon/" + id.left(queryPos); // without the query part + const QString q = id.mid(queryPos + 1); + if (q == "text") { + c = _textColor; + } else if (q == "themeContrast") { + c = _themeContrastColor; + } else if (q == "active") { + c = _activeColor; + } else if (q == "destructive") { + c = _destructiveColor; + } else if (q == "theme") { + // default already + } else { + qWarning() << Q_FUNC_INFO << "Unrecognized color specification:" << id; + } + } + + QImage originalImage = QImage{path}; + if (originalImage.isNull()) { + qWarning() << Q_FUNC_INFO << "Failed to load image:" << path; + return {}; + } + + if (!originalImage.isGrayscale()) { + qWarning() << Q_FUNC_INFO << "Source image is not a greyscale mask:" << path; + } + + const int baseRed = c.red(); + const int baseGreen = c.green(); + const int baseBlue = c.blue(); + *size = originalImage.size(); + + // colorize it + QImage colored{originalImage.size(), QImage::Format_ARGB32_Premultiplied}; + const int width = size->width(); + const int height = size->height(); + + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) { + // this is 0..255 ranged alpha/intensity value + const int alpha = originalImage.pixel(x, y); + colored.setPixel(x, y, qPremultiply(qRgba(baseRed, baseGreen, baseBlue, alpha))); + } + } + + return colored; +} diff --git a/src/GUI/QmlColoredImageProvider.hxx b/src/GUI/QmlColoredImageProvider.hxx new file mode 100644 index 000000000..04b4a2f40 --- /dev/null +++ b/src/GUI/QmlColoredImageProvider.hxx @@ -0,0 +1,41 @@ +// Copyright (C) 2021 James Turner +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +#pragma once + +#include +#include + +class QQmlEngine; + +/** + * @brief Heper image provider to allow re-colorizing + * images based on the active style + * + */ +class QmlColoredImageProvider : public QQuickImageProvider +{ +public: + QmlColoredImageProvider(); + + QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize) override; + + void loadStyleColors(QQmlEngine* engine, int styleTypeId); + +private: + QColor _themeColor, _textColor, _themeContrastColor, _activeColor; + QColor _destructiveColor; +}; diff --git a/src/GUI/assets/mask-add.png b/src/GUI/assets/mask-add.png new file mode 100644 index 000000000..320685d97 Binary files /dev/null and b/src/GUI/assets/mask-add.png differ diff --git a/src/GUI/assets/mask-aircraft-carrier.png b/src/GUI/assets/mask-aircraft-carrier.png new file mode 100644 index 000000000..54127c324 Binary files /dev/null and b/src/GUI/assets/mask-aircraft-carrier.png differ diff --git a/src/GUI/assets/mask-airplane.png b/src/GUI/assets/mask-airplane.png new file mode 100644 index 000000000..b8af37c8f Binary files /dev/null and b/src/GUI/assets/mask-airplane.png differ diff --git a/src/GUI/assets/mask-airport.png b/src/GUI/assets/mask-airport.png new file mode 100644 index 000000000..cf8f05478 Binary files /dev/null and b/src/GUI/assets/mask-airport.png differ diff --git a/src/GUI/assets/mask-arrow-left.png b/src/GUI/assets/mask-arrow-left.png new file mode 100644 index 000000000..e02e989bd Binary files /dev/null and b/src/GUI/assets/mask-arrow-left.png differ diff --git a/src/GUI/assets/mask-arrow-right.png b/src/GUI/assets/mask-arrow-right.png new file mode 100644 index 000000000..755ff0086 Binary files /dev/null and b/src/GUI/assets/mask-arrow-right.png differ diff --git a/src/GUI/assets/mask-back.png b/src/GUI/assets/mask-back.png new file mode 100644 index 000000000..f027086cc Binary files /dev/null and b/src/GUI/assets/mask-back.png differ diff --git a/src/GUI/assets/mask-cancel-small.png b/src/GUI/assets/mask-cancel-small.png new file mode 100644 index 000000000..0a778d1b4 Binary files /dev/null and b/src/GUI/assets/mask-cancel-small.png differ diff --git a/src/GUI/assets/mask-cancel.png b/src/GUI/assets/mask-cancel.png new file mode 100644 index 000000000..7340f3f08 Binary files /dev/null and b/src/GUI/assets/mask-cancel.png differ diff --git a/src/GUI/assets/mask-carrier2.png b/src/GUI/assets/mask-carrier2.png new file mode 100644 index 000000000..16593c9b0 Binary files /dev/null and b/src/GUI/assets/mask-carrier2.png differ diff --git a/src/GUI/assets/mask-clear.png b/src/GUI/assets/mask-clear.png new file mode 100644 index 000000000..e8224a88a Binary files /dev/null and b/src/GUI/assets/mask-clear.png differ diff --git a/src/GUI/assets/mask-cross.png b/src/GUI/assets/mask-cross.png new file mode 100644 index 000000000..c9f10faa9 Binary files /dev/null and b/src/GUI/assets/mask-cross.png differ diff --git a/src/GUI/assets/mask-ellipsis.png b/src/GUI/assets/mask-ellipsis.png new file mode 100644 index 000000000..25a029cc8 Binary files /dev/null and b/src/GUI/assets/mask-ellipsis.png differ diff --git a/src/GUI/assets/mask-hide.png b/src/GUI/assets/mask-hide.png new file mode 100644 index 000000000..cbd2cdedc Binary files /dev/null and b/src/GUI/assets/mask-hide.png differ diff --git a/src/GUI/assets/mask-history.png b/src/GUI/assets/mask-history.png new file mode 100644 index 000000000..0d31e84da Binary files /dev/null and b/src/GUI/assets/mask-history.png differ diff --git a/src/GUI/assets/mask-preview.png b/src/GUI/assets/mask-preview.png new file mode 100644 index 000000000..5f76a85a6 Binary files /dev/null and b/src/GUI/assets/mask-preview.png differ diff --git a/src/GUI/assets/mask-reorder-list.png b/src/GUI/assets/mask-reorder-list.png new file mode 100644 index 000000000..cc68260f9 Binary files /dev/null and b/src/GUI/assets/mask-reorder-list.png differ diff --git a/src/GUI/assets/mask-reorder-small.png b/src/GUI/assets/mask-reorder-small.png new file mode 100644 index 000000000..83a2765e5 Binary files /dev/null and b/src/GUI/assets/mask-reorder-small.png differ diff --git a/src/GUI/assets/mask-scroll-down.png b/src/GUI/assets/mask-scroll-down.png new file mode 100644 index 000000000..35207143b Binary files /dev/null and b/src/GUI/assets/mask-scroll-down.png differ diff --git a/src/GUI/assets/mask-search.png b/src/GUI/assets/mask-search.png new file mode 100644 index 000000000..f544af1bc Binary files /dev/null and b/src/GUI/assets/mask-search.png differ diff --git a/src/GUI/assets/mask-settings-gear.png b/src/GUI/assets/mask-settings-gear.png new file mode 100644 index 000000000..40e58535e Binary files /dev/null and b/src/GUI/assets/mask-settings-gear.png differ diff --git a/src/GUI/assets/mask-star-filled.png b/src/GUI/assets/mask-star-filled.png new file mode 100644 index 000000000..1ee4f8e53 Binary files /dev/null and b/src/GUI/assets/mask-star-filled.png differ diff --git a/src/GUI/assets/mask-star-outline.png b/src/GUI/assets/mask-star-outline.png new file mode 100644 index 000000000..6c9846e1d Binary files /dev/null and b/src/GUI/assets/mask-star-outline.png differ diff --git a/src/GUI/assets/mask-toolbox-help.png b/src/GUI/assets/mask-toolbox-help.png new file mode 100644 index 000000000..826571572 Binary files /dev/null and b/src/GUI/assets/mask-toolbox-help.png differ diff --git a/src/GUI/assets/mask-up-down.png b/src/GUI/assets/mask-up-down.png new file mode 100644 index 000000000..8e947a97d Binary files /dev/null and b/src/GUI/assets/mask-up-down.png differ diff --git a/src/GUI/qml/AddButton.qml b/src/GUI/qml/AddButton.qml index de488d745..84491f121 100644 --- a/src/GUI/qml/AddButton.qml +++ b/src/GUI/qml/AddButton.qml @@ -1,5 +1,5 @@ import QtQuick 2.4 -import "." +import FlightGear 1.0 Rectangle { id: root @@ -16,7 +16,8 @@ Rectangle { Text { id: label text: qsTr("Add") - color: "white" + color: Style.backgroundColor + anchors { left: parent.left leftMargin: Style.margin @@ -28,7 +29,8 @@ Rectangle { Image { id: icon anchors.right: parent.right - source: "qrc:///add-icon" + source: mouse.containsMouse ? "image:///colored-icon/add?active" + : "image:///colored-icon/add?text" } MouseArea { diff --git a/src/GUI/qml/AdvancedSettingsToggle.qml b/src/GUI/qml/AdvancedSettingsToggle.qml index e326144a9..7b5bedc14 100644 --- a/src/GUI/qml/AdvancedSettingsToggle.qml +++ b/src/GUI/qml/AdvancedSettingsToggle.qml @@ -40,7 +40,7 @@ Item { Image { id: gearIcon - source: "qrc:///settings-gear-white" + source: "image://colored-icon/settings?themeContrast" height: root.height - 2 fillMode: Image.PreserveAspectFit anchors.right: parent.right diff --git a/src/GUI/qml/AircraftVariantChoice.qml b/src/GUI/qml/AircraftVariantChoice.qml index 8dcfdbae2..bfcabea25 100644 --- a/src/GUI/qml/AircraftVariantChoice.qml +++ b/src/GUI/qml/AircraftVariantChoice.qml @@ -62,7 +62,7 @@ Rectangle { Image { id: upDownIcon - source: "qrc:///up-down-arrow" + source: headingMouseArea.containsMouse ? "image://colored-icon/up-down?theme" : "image://colored-icon/up-down?text" // x: root.centerX + Math.min(title.implicitWidth * 0.5, title.width * 0.5) anchors.verticalCenter: parent.verticalCenter visible: __enabled diff --git a/src/GUI/qml/BackButton.qml b/src/GUI/qml/BackButton.qml index ec997ddf3..92b0ef19e 100644 --- a/src/GUI/qml/BackButton.qml +++ b/src/GUI/qml/BackButton.qml @@ -12,7 +12,7 @@ Item { Image { id: image anchors.centerIn: parent - source: "qrc:///back-icon" + source: mouse.containsMouse ? "image://colored-icon/back?active" : "image://colored-icon/back" } MouseArea { diff --git a/src/GUI/qml/DateTimeValueEdit.qml b/src/GUI/qml/DateTimeValueEdit.qml index c517f7780..7abb0f744 100644 --- a/src/GUI/qml/DateTimeValueEdit.qml +++ b/src/GUI/qml/DateTimeValueEdit.qml @@ -154,7 +154,7 @@ FocusScope { Rectangle { id: upDownArea - color: "white" + color: Style.backgroundColor anchors.left: input.right anchors.verticalCenter: input.verticalCenter height: upDownIcon.implicitHeight @@ -164,7 +164,7 @@ FocusScope { Image { id: upDownIcon // show up/down arrows - source: "qrc:///up-down-arrow" + source: "image://colored-icon/up-down?text" } MouseArea { diff --git a/src/GUI/qml/DoubleSpinbox.qml b/src/GUI/qml/DoubleSpinbox.qml index f54c6f65d..8750eb9be 100644 --- a/src/GUI/qml/DoubleSpinbox.qml +++ b/src/GUI/qml/DoubleSpinbox.qml @@ -183,7 +183,7 @@ FocusScope { Image { id: upDownIcon // show up/down arrows - source: "qrc:///up-down-arrow" + source: "image://colored-icon/up-down?text" } MouseArea { diff --git a/src/GUI/qml/DragToReorderButton.qml b/src/GUI/qml/DragToReorderButton.qml index 5842a292d..cc14e7d00 100644 --- a/src/GUI/qml/DragToReorderButton.qml +++ b/src/GUI/qml/DragToReorderButton.qml @@ -16,7 +16,8 @@ Item { id: icon x: 0 y: 0 - source: "qrc:///reorder-list-icon-small" + source: promptText.visible ? "image://colored-icon/reorder-small?active" + : "image://colored-icon/reorder-small?text" } @@ -44,6 +45,7 @@ Item { } Text { + id: promptText anchors.verticalCenter: parent.verticalCenter anchors.right: parent.left anchors.rightMargin: Style.margin diff --git a/src/GUI/qml/FavouriteToggleButton.qml b/src/GUI/qml/FavouriteToggleButton.qml index 218457a5e..285995595 100644 --- a/src/GUI/qml/FavouriteToggleButton.qml +++ b/src/GUI/qml/FavouriteToggleButton.qml @@ -15,7 +15,7 @@ Item { id: icon source: { var b = mouse.containsMouse ? !root.checked : root.checked; - return b ? "qrc:///favourite-icon-filled" : "qrc:///favourite-icon-outline"; + return b ? "image://colored-icon/star-filled?theme" : "image://colored-icon/star-outline?text"; } anchors.centerIn: parent diff --git a/src/GUI/qml/GridToggleButton.qml b/src/GUI/qml/GridToggleButton.qml index 8c4e655c7..47e9c39a7 100644 --- a/src/GUI/qml/GridToggleButton.qml +++ b/src/GUI/qml/GridToggleButton.qml @@ -8,7 +8,7 @@ Rectangle { border.color: Style.themeColor width: height height: Style.baseFontPixelSize + Style.margin * 2 - color: mouse.containsMouse ? Style.minorFrameColor : "white" + color: mouse.containsMouse ? Style.minorFrameColor : Style.backgroundColor property bool gridMode: false diff --git a/src/GUI/qml/HistoryPopup.qml b/src/GUI/qml/HistoryPopup.qml index 35d1e2490..23d4eae2b 100644 --- a/src/GUI/qml/HistoryPopup.qml +++ b/src/GUI/qml/HistoryPopup.qml @@ -27,7 +27,7 @@ Item { Image { id: icon - source: "qrc:///history-icon" + source: "image://colored-icon/history?themeContrast" anchors.centerIn: parent } diff --git a/src/GUI/qml/IconButton.qml b/src/GUI/qml/IconButton.qml index 48854ad5d..039f6a5f5 100644 --- a/src/GUI/qml/IconButton.qml +++ b/src/GUI/qml/IconButton.qml @@ -8,7 +8,7 @@ Rectangle { border.color: Style.themeColor width: height height: Style.baseFontPixelSize + Style.margin * 2 - color: mouse.containsMouse ? Style.minorFrameColor : "white" + color: mouse.containsMouse ? Style.minorFrameColor : Style.backgroundColor property alias icon: icon.source diff --git a/src/GUI/qml/IntegerSpinbox.qml b/src/GUI/qml/IntegerSpinbox.qml index c953dc791..967833aa5 100644 --- a/src/GUI/qml/IntegerSpinbox.qml +++ b/src/GUI/qml/IntegerSpinbox.qml @@ -181,7 +181,7 @@ FocusScope { Image { id: upDownIcon // show up/down arrows - source: "qrc:///up-down-arrow" + source: "image://colored-icon/up-down?text" } MouseArea { diff --git a/src/GUI/qml/Location.qml b/src/GUI/qml/Location.qml index 862626c72..f0723a43f 100644 --- a/src/GUI/qml/Location.qml +++ b/src/GUI/qml/Location.qml @@ -229,17 +229,10 @@ Item { anchors.top: headerText.bottom anchors.right: parent.right anchors.margins: Style.margin - icon: "qrc:///svg/icon-carrier" + icon: root.showCarriers ? "image://colored-icon/carrier2?text" + : "image://colored-icon/airport?text" - onClicked: { - root.showCarriers = ! root.showCarriers; - - if (root.showCarriers) { - this.icon = "qrc:///svg/icon-airport" - } else { - this.icon = "qrc:///svg/icon-carrier" - } - } + onClicked: root.showCarriers = ! root.showCarriers; GettingStartedTip { tipId: "locationCarriersList" diff --git a/src/GUI/qml/NumericalEdit.qml b/src/GUI/qml/NumericalEdit.qml index 139adb860..fadce9fd2 100644 --- a/src/GUI/qml/NumericalEdit.qml +++ b/src/GUI/qml/NumericalEdit.qml @@ -276,7 +276,7 @@ FocusScope { Image { id: upDownIcon // show up/down arrows - source: "qrc:///up-down-arrow" + source: "image://colored-icon/up-down?text" } MouseArea { diff --git a/src/GUI/qml/PopupChoice.qml b/src/GUI/qml/PopupChoice.qml index 142e60cdb..98fa1564d 100644 --- a/src/GUI/qml/PopupChoice.qml +++ b/src/GUI/qml/PopupChoice.qml @@ -87,7 +87,7 @@ Item { Image { id: upDownIcon visible: root.enabled - source: "qrc:///up-down-arrow" + source: mouseArea.containsMouse ? "image://colored-icon/up-down?theme" : "image://colored-icon/up-down?text" anchors.right: parent.right anchors.rightMargin: Style.margin anchors.verticalCenter: parent.verticalCenter diff --git a/src/GUI/qml/SearchButton.qml b/src/GUI/qml/SearchButton.qml index 6aad5a74a..014808a51 100644 --- a/src/GUI/qml/SearchButton.qml +++ b/src/GUI/qml/SearchButton.qml @@ -86,7 +86,11 @@ FocusScope Image { id: searchIcon - source: root.canClear ? "qrc:///clear-text-icon" :"qrc:///search-icon-small" + + // give hover feedback when showing the clear icon + source: clearButtonMouse.containsMouse ? "image://colored-icon/clear?destructive" + : root.canClear ? "image://colored-icon/clear?text" : "image://colored-icon/search?text" + anchors.right: parent.right anchors.rightMargin: Style.margin anchors.verticalCenter: parent.verticalCenter diff --git a/src/GUI/qml/Section.qml b/src/GUI/qml/Section.qml index e6ccd7173..300a2d6f7 100644 --- a/src/GUI/qml/Section.qml +++ b/src/GUI/qml/Section.qml @@ -74,7 +74,7 @@ Item { Text { id: headerTitle - color: "white" + color: Style.themeContrastTextColor anchors.verticalCenter: parent.verticalCenter font.bold: true font.pixelSize: Style.subHeadingFontPixelSize diff --git a/src/GUI/qml/Sidebar.qml b/src/GUI/qml/Sidebar.qml index f1e7616bc..dbc530ad6 100644 --- a/src/GUI/qml/Sidebar.qml +++ b/src/GUI/qml/Sidebar.qml @@ -43,7 +43,7 @@ Rectangle { Image { id: menuIconImage anchors.centerIn: parent - source: "qrc:///ellipsis-icon" + source: "image://colored-icon/ellipsis?themeContrast" } MouseArea { diff --git a/src/GUI/qml/Style.qml b/src/GUI/qml/Style.qml index 1d97c03a7..0f279b585 100644 --- a/src/GUI/qml/Style.qml +++ b/src/GUI/qml/Style.qml @@ -12,6 +12,7 @@ QtObject readonly property string frameColor: "#68A6E1" readonly property string minorFrameColor: "#9f9f9f" + readonly property string backgroundColor: "#ffffff" readonly property string themeColor: "#1b7ad3" readonly property string destructiveActionColor: "#c62703" diff --git a/src/GUI/resources.qrc b/src/GUI/resources.qrc index cc5f6cf0e..5076ca5e8 100644 --- a/src/GUI/resources.qrc +++ b/src/GUI/resources.qrc @@ -172,4 +172,31 @@ assets/icons8-airport-50.png assets/aircraft-carrier-icon.svg + + assets/mask-scroll-down.png + assets/mask-history.png + assets/mask-settings-gear.png + assets/mask-search.png + assets/mask-aircraft-carrier.png + assets/mask-carrier2.png + assets/mask-airplane.png + assets/mask-airport.png + assets/mask-arrow-left.png + assets/mask-arrow-right.png + assets/mask-clear.png + assets/mask-cross.png + assets/mask-hide.png + assets/mask-preview.png + assets/mask-up-down.png + assets/mask-star-filled.png + assets/mask-star-outline.png + assets/mask-back.png + assets/mask-cancel-small.png + assets/mask-reorder-list.png + assets/mask-reorder-small.png + assets/mask-cancel.png + assets/mask-add.png + assets/mask-toolbox-help.png + assets/mask-ellipsis.png +