diff --git a/src/qml/AboutPage.qml b/src/qml/AboutPage.qml new file mode 100644 index 00000000..af76877e --- /dev/null +++ b/src/qml/AboutPage.qml @@ -0,0 +1,18 @@ +/** + * SPDX-FileCopyrightText: 2021 Bart De Vries + * + * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + */ + +import QtQuick 2.14 +import QtQuick.Controls 2.14 as Controls +import QtQuick.Layouts 1.14 + +import org.kde.kirigami 2.12 as Kirigami + +import org.kde.alligator 1.0 + +Kirigami.AboutPage { + title: i18n("About") + aboutData: _aboutData +} diff --git a/src/qml/main.qml b/src/qml/main.qml index d5507840..52ceca43 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -20,49 +20,62 @@ Kirigami.ApplicationWindow { title: "Alligator" - pageStack.initialPage: SettingsManager.lastOpenedPage === "FeedListPage" ? feedList - : SettingsManager.lastOpenedPage === "QueuePage" ? queueList - : feedList + //pageStack.initialPage: SettingsManager.lastOpenedPage === "FeedListPage" ? feedList + // : SettingsManager.lastOpenedPage === "QueuePage" ? queueList + // : feedList + Kirigami.PagePool { + id: mainPagePool + cachePages: true + } + + pageStack.initialPage: mainPagePool.loadPage(SettingsManager.lastOpenedPage === "FeedListPage" ? "qrc:/FeedListPage.qml" + : SettingsManager.lastOpenedPage === "QueuePage" ? "qrc:/QueuePage.qml" + : "qrc:/FeedListPage.qml") globalDrawer: Kirigami.GlobalDrawer { - isMenu: true + isMenu: false actions: [ - Kirigami.Action { + Kirigami.PagePoolAction { text: i18n("Queue") iconName: "source-playlist" + pagePool: mainPagePool + page: "qrc:/QueuePage.qml" onTriggered: { SettingsManager.lastOpenedPage = "QueuePage" // for persistency - pageStack.clear() - pageStack.push(queueList) } }, - Kirigami.Action { + Kirigami.PagePoolAction { text: i18n("Subscriptions") iconName: "rss" + pagePool: mainPagePool + page: "qrc:/FeedListPage.qml" onTriggered: { SettingsManager.lastOpenedPage = "FeedListPage" // for persistency - pageStack.clear() - pageStack.push(feedList) } }, - Kirigami.Action { + Kirigami.PagePoolAction { text: i18n("Settings") iconName: "settings-configure" - onTriggered: pageStack.layers.push("qrc:/SettingsPage.qml") - enabled: pageStack.layers.currentItem.title !== i18n("Settings") + pagePool: mainPagePool + page: "qrc:/SettingsPage.qml" + useLayers: true }, - Kirigami.Action { + Kirigami.PagePoolAction { text: i18n("About") iconName: "help-about-symbolic" - onTriggered: pageStack.layers.push(aboutPage) - enabled: pageStack.layers.currentItem.title !== i18n("About") + pagePool: mainPagePool + page: "qrc:/AboutPage.qml" + useLayers: true + //enabled: pageStack.layers.currentItem.title !== i18n("About") } ] } Component { id: aboutPage + Kirigami.AboutPage { + title: i18n("About") aboutData: _aboutData } } @@ -71,13 +84,13 @@ Kirigami.ApplicationWindow { id: contextDrawer } - FeedListPage { + /*FeedListPage { id: feedList } QueuePage { id: queueList - } + }*/ AudioManager { id: audio diff --git a/src/resources.qrc b/src/resources.qrc index 0281b82c..3c4a10cc 100755 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -5,6 +5,7 @@ qml/FeedListPage.qml qml/EntryPage.qml qml/SettingsPage.qml + qml/AboutPage.qml qml/FeedDetailsPage.qml qml/EntryListDelegate.qml qml/AddFeedSheet.qml