From e0768a38b334a0da37ce67dd80153713e45cf5b6 Mon Sep 17 00:00:00 2001 From: Vasily Date: Sat, 2 Feb 2019 14:16:46 +0100 Subject: [PATCH] Move checkmark and back arrow into .qrc file The QRC file is a platform independant way of referring to resource files. It allows the program to access resources in an abstract way instead of the direct file path. This is the first step towards moving all files to the new system. --- advancedSettings.pro | 4 ++-- src/res/{qml => img}/common/backarrow.svg | 0 src/res/{qml => img}/common/check.svg | 0 src/res/qml/common/MyStackViewPage.qml | 2 +- src/res/qml/common/MyToggleButton.qml | 2 +- src/res/resources.qrc | 6 ++++++ 6 files changed, 10 insertions(+), 4 deletions(-) rename src/res/{qml => img}/common/backarrow.svg (100%) rename src/res/{qml => img}/common/check.svg (100%) create mode 100644 src/res/resources.qrc diff --git a/advancedSettings.pro b/advancedSettings.pro index 4a48a5a..e93c00d 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -126,8 +126,6 @@ DISTFILES += \ src/res/battery_4.png \ src/res/battery_5.png \ src/res/thumbicon.png \ - src/res/qml/backarrow.svg \ - src/res/qml/check.svg \ src/res/qml/mic_off.svg \ src/res/qml/mic_on.svg \ src/res/qml/ptt_notification.svg \ @@ -170,3 +168,5 @@ DISTFILES += \ src/res/qml/audio_page/push_to_talk/* \ src/res/qml/audio_page/profiles/* \ src/res/qml/common/* \ + +RESOURCES += src/res/resources.qrc diff --git a/src/res/qml/common/backarrow.svg b/src/res/img/common/backarrow.svg similarity index 100% rename from src/res/qml/common/backarrow.svg rename to src/res/img/common/backarrow.svg diff --git a/src/res/qml/common/check.svg b/src/res/img/common/check.svg similarity index 100% rename from src/res/qml/common/check.svg rename to src/res/img/common/check.svg diff --git a/src/res/qml/common/MyStackViewPage.qml b/src/res/qml/common/MyStackViewPage.qml index e2c8202..0690393 100644 --- a/src/res/qml/common/MyStackViewPage.qml +++ b/src/res/qml/common/MyStackViewPage.qml @@ -26,7 +26,7 @@ Rectangle { enabled: headerShowBackButton opacity: headerShowBackButton ? 1.0 : 0.0 contentItem: Image { - source: "backarrow.svg" + source: "qrc:/common/back-arrow" sourceSize.width: 50 sourceSize.height: 50 anchors.fill: parent diff --git a/src/res/qml/common/MyToggleButton.qml b/src/res/qml/common/MyToggleButton.qml index 15bc180..7c2e418 100644 --- a/src/res/qml/common/MyToggleButton.qml +++ b/src/res/qml/common/MyToggleButton.qml @@ -31,7 +31,7 @@ CheckBox { height: 28 x: (parent.width - width) / 2 y: (parent.height - height) / 2 - source: "check.svg" + source: "qrc:/common/box-checkmark" sourceSize.width: width sourceSize.height: height visible: parent.parent.checked diff --git a/src/res/resources.qrc b/src/res/resources.qrc new file mode 100644 index 0000000..b13f6f9 --- /dev/null +++ b/src/res/resources.qrc @@ -0,0 +1,6 @@ + + + img/common/backarrow.svg + img/common/check.svg + + \ No newline at end of file