From 12dac05d38dd523e4894a40c3196b2102bab0873 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 2 Jul 2018 23:10:52 +0100 Subject: [PATCH] Launcher: experimenting with SVG icons --- CMakeLists.txt | 2 +- src/GUI/CMakeLists.txt | 2 +- src/GUI/assets/icons8-aircraft.svg | 6 ++++++ src/GUI/assets/icons8-airplane-take-off.svg | 6 ++++++ src/GUI/assets/icons8-automation.svg | 6 ++++++ src/GUI/assets/icons8-home.svg | 4 ++++ src/GUI/assets/icons8-location.svg | 6 ++++++ src/GUI/assets/icons8-puzzle.svg | 6 ++++++ src/GUI/assets/icons8-windy-weather-filled.svg | 6 ++++++ src/GUI/qml/Launcher.qml | 10 +++++----- src/GUI/qml/Sidebar.qml | 2 +- src/GUI/resources.qrc | 9 +++++++++ 12 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 src/GUI/assets/icons8-aircraft.svg create mode 100644 src/GUI/assets/icons8-airplane-take-off.svg create mode 100644 src/GUI/assets/icons8-automation.svg create mode 100644 src/GUI/assets/icons8-home.svg create mode 100644 src/GUI/assets/icons8-location.svg create mode 100644 src/GUI/assets/icons8-puzzle.svg create mode 100644 src/GUI/assets/icons8-windy-weather-filled.svg diff --git a/CMakeLists.txt b/CMakeLists.txt index 8913aafbc..acbb835e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,7 +346,7 @@ endif (USE_DBUS) ## Qt5 setup setup if (ENABLE_QT) message(STATUS "Qt launcher enabled, checking for Qt 5.4 / qmake") - find_package(Qt5 5.4 COMPONENTS Widgets Network Qml Quick QuickWidgets) + find_package(Qt5 5.4 COMPONENTS Widgets Network Qml Quick Svg) if (Qt5Widgets_FOUND) message(STATUS "Will enable Qt launcher GUI") message(STATUS " Qt5Widgets version: ${Qt5Widgets_VERSION_STRING}") diff --git a/src/GUI/CMakeLists.txt b/src/GUI/CMakeLists.txt index 28ddd0da4..93bef581a 100644 --- a/src/GUI/CMakeLists.txt +++ b/src/GUI/CMakeLists.txt @@ -123,7 +123,7 @@ if (HAVE_QT) ${qml_sources}) set_property(TARGET fglauncher PROPERTY AUTOMOC ON) - target_link_libraries(fglauncher Qt5::Core Qt5::Widgets Qt5::Network Qt5::Qml Qt5::Quick Qt5::QuickWidgets SimGearCore) + target_link_libraries(fglauncher Qt5::Core Qt5::Widgets Qt5::Network Qt5::Qml Qt5::Quick Qt5::Svg SimGearCore) target_include_directories(fglauncher PRIVATE ${PROJECT_BINARY_DIR}/src/GUI) add_library(fgqmlui QQuickDrawable.cxx diff --git a/src/GUI/assets/icons8-aircraft.svg b/src/GUI/assets/icons8-aircraft.svg new file mode 100644 index 000000000..3e37bc386 --- /dev/null +++ b/src/GUI/assets/icons8-aircraft.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/GUI/assets/icons8-airplane-take-off.svg b/src/GUI/assets/icons8-airplane-take-off.svg new file mode 100644 index 000000000..7bf5222f4 --- /dev/null +++ b/src/GUI/assets/icons8-airplane-take-off.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/GUI/assets/icons8-automation.svg b/src/GUI/assets/icons8-automation.svg new file mode 100644 index 000000000..24c9d9e85 --- /dev/null +++ b/src/GUI/assets/icons8-automation.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/GUI/assets/icons8-home.svg b/src/GUI/assets/icons8-home.svg new file mode 100644 index 000000000..adec20839 --- /dev/null +++ b/src/GUI/assets/icons8-home.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/GUI/assets/icons8-location.svg b/src/GUI/assets/icons8-location.svg new file mode 100644 index 000000000..1cc3615cb --- /dev/null +++ b/src/GUI/assets/icons8-location.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/GUI/assets/icons8-puzzle.svg b/src/GUI/assets/icons8-puzzle.svg new file mode 100644 index 000000000..009c32cee --- /dev/null +++ b/src/GUI/assets/icons8-puzzle.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/GUI/assets/icons8-windy-weather-filled.svg b/src/GUI/assets/icons8-windy-weather-filled.svg new file mode 100644 index 000000000..aca49b628 --- /dev/null +++ b/src/GUI/assets/icons8-windy-weather-filled.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/GUI/qml/Launcher.qml b/src/GUI/qml/Launcher.qml index 4fbad999d..3a9f3a530 100644 --- a/src/GUI/qml/Launcher.qml +++ b/src/GUI/qml/Launcher.qml @@ -6,8 +6,8 @@ Item { // order of this model sets the order of buttons in the sidebar ListModel { id: pagesModel - ListElement { title: qsTr("Summary"); pageSource: "qrc:///qml/Summary.qml"; iconPath: "qrc:///toolbox-summary"; state:"loader" } - ListElement { title: qsTr("Aircraft"); pageSource: "qrc:///qml/AircraftList.qml"; iconPath: "qrc:///toolbox-aircraft"; state:"loader" } + ListElement { title: qsTr("Summary"); pageSource: "qrc:///qml/Summary.qml"; iconPath: "qrc:///svg/toolbox-summary"; state:"loader" } + ListElement { title: qsTr("Aircraft"); pageSource: "qrc:///qml/AircraftList.qml"; iconPath: "qrc:///svg/toolbox-aircraft"; state:"loader" } ListElement { title: qsTr("Location"); pageSource: "qrc:///qml/Location.qml"; @@ -20,10 +20,10 @@ Item { // permanently so that collecting args works. So we instantiate them down below, and toggle the visiblity // of them and the loader using a state. - ListElement { title: qsTr("Environment"); pageSource: ""; iconPath: "qrc:///toolbox-environment"; state:"environment" } - ListElement { title: qsTr("Settings"); pageSource: ""; iconPath: "qrc:///toolbox-settings"; state:"settings" } + ListElement { title: qsTr("Environment"); pageSource: ""; iconPath: "qrc:///svg/toolbox-environment"; state:"environment" } + ListElement { title: qsTr("Settings"); pageSource: ""; iconPath: "qrc:///svg/toolbox-settings"; state:"settings" } - ListElement { title: qsTr("Add-ons"); pageSource: "qrc:///qml/AddOns.qml"; iconPath: "qrc:///toolbox-addons"; state:"loader" } + ListElement { title: qsTr("Add-ons"); pageSource: "qrc:///qml/AddOns.qml"; iconPath: "qrc:///svg/toolbox-addons"; state:"loader" } } diff --git a/src/GUI/qml/Sidebar.qml b/src/GUI/qml/Sidebar.qml index e382f4280..572a82b4e 100644 --- a/src/GUI/qml/Sidebar.qml +++ b/src/GUI/qml/Sidebar.qml @@ -73,7 +73,7 @@ Rectangle { anchors.bottomMargin: Style.margin enabled: _launcher.canFly disabledText: qsTr("The selected aircraft is not installed") - icon: "qrc:///toolbox-fly" + icon: "qrc:///svg/toolbox-fly" onClicked: _launcher.fly(); } } diff --git a/src/GUI/resources.qrc b/src/GUI/resources.qrc index b6b6ab311..5fc0f8908 100644 --- a/src/GUI/resources.qrc +++ b/src/GUI/resources.qrc @@ -112,4 +112,13 @@ preview-left-arrow.png preview-right-arrow.png + + assets/icons8-airplane-take-off.svg + assets/icons8-windy-weather-filled.svg + assets/icons8-location.svg + assets/icons8-automation.svg + assets/icons8-puzzle.svg + assets/icons8-home.svg + assets/icons8-aircraft.svg +