Changeset View
Changeset View
Standalone View
Standalone View
src/data/contents/ui/MainPage.qml
Show All 16 Lines | |||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.1 | 20 | import QtQuick 2.1 | ||
21 | import QtQuick.Controls 2.0 as QQC2 | 21 | import QtQuick.Controls 2.0 as QQC2 | ||
22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import org.kde.kirigami 2.11 as Kirigami | 23 | import org.kde.kirigami 2.11 as Kirigami | ||
24 | import org.kde.kitemmodels 1.0 | 24 | import org.kde.kitemmodels 1.0 | ||
25 | import org.kde.kirigami2.gallery 1.0 | ||||
25 | 26 | | |||
26 | Kirigami.ScrollablePage { | 27 | Kirigami.ScrollablePage { | ||
27 | id: pageRoot | 28 | id: pageRoot | ||
28 | 29 | | |||
29 | implicitWidth: Kirigami.Units.gridUnit * 20 | 30 | implicitWidth: Kirigami.Units.gridUnit * 20 | ||
30 | background: Rectangle { | 31 | background: Rectangle { | ||
31 | color: Kirigami.Theme.backgroundColor | 32 | color: Kirigami.Theme.backgroundColor | ||
32 | } | 33 | } | ||
Show All 20 Lines | 52 | Kirigami.Action { | |||
53 | text:"Checkable" | 54 | text:"Checkable" | ||
54 | checkable: true | 55 | checkable: true | ||
55 | iconName: "dashboard-show" | 56 | iconName: "dashboard-show" | ||
56 | onCheckedChanged: showPassiveNotification("Checked: " + checked) | 57 | onCheckedChanged: showPassiveNotification("Checked: " + checked) | ||
57 | } | 58 | } | ||
58 | ] | 59 | ] | ||
59 | } | 60 | } | ||
60 | 61 | | |||
62 | Component.onCompleted: { | ||||
63 | root.pageStack.push(mainPagePool.loadPage(GalleryConfig.lastPage)) | ||||
64 | } | ||||
61 | Kirigami.PagePool { | 65 | Kirigami.PagePool { | ||
62 | id: mainPagePool | 66 | id: mainPagePool | ||
63 | } | 67 | } | ||
68 | | ||||
64 | ListModel { | 69 | ListModel { | ||
65 | id: galleryModel | 70 | id: galleryModel | ||
66 | ListElement { | 71 | ListElement { | ||
67 | title: "Buttons" | 72 | title: "Buttons" | ||
68 | targetPage: "gallery/ButtonGallery.qml" | 73 | targetPage: "gallery/ButtonGallery.qml" | ||
69 | img: "img/buttons.svg" | 74 | img: "img/buttons.svg" | ||
70 | } | 75 | } | ||
71 | ListElement { | 76 | ListElement { | ||
▲ Show 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 210 | delegate: Kirigami.Card { | |||
215 | implicitWidth: Kirigami.Units.gridUnit*30 | 220 | implicitWidth: Kirigami.Units.gridUnit*30 | ||
216 | implicitHeight: Kirigami.Units.gridUnit*10 | 221 | implicitHeight: Kirigami.Units.gridUnit*10 | ||
217 | Layout.maximumWidth: Kirigami.Units.gridUnit*30 | 222 | Layout.maximumWidth: Kirigami.Units.gridUnit*30 | ||
218 | Kirigami.PagePoolAction { | 223 | Kirigami.PagePoolAction { | ||
219 | id: action | 224 | id: action | ||
220 | pagePool: mainPagePool | 225 | pagePool: mainPagePool | ||
221 | basePage: pageRoot | 226 | basePage: pageRoot | ||
222 | page: targetPage | 227 | page: targetPage | ||
228 | onTriggered: { | ||||
229 | GalleryConfig.lastPage = targetPage | ||||
230 | } | ||||
223 | } | 231 | } | ||
224 | } | 232 | } | ||
225 | } | 233 | } | ||
226 | } | 234 | } | ||
227 | } | 235 | } | ||
228 | } | 236 | } | ||
229 | 237 | |