Add settings page
This commit is contained in:
parent
bdd63771bc
commit
d17faaad90
3 changed files with 30 additions and 2 deletions
3
build.rs
3
build.rs
|
@ -31,7 +31,8 @@ fn main() {
|
||||||
"ui/ThreadPage.qml",
|
"ui/ThreadPage.qml",
|
||||||
"ui/WelcomePage.qml",
|
"ui/WelcomePage.qml",
|
||||||
"ui/LoginPage.qml",
|
"ui/LoginPage.qml",
|
||||||
"ui/Sidebar.qml"
|
"ui/Sidebar.qml",
|
||||||
|
"ui/SettingsPage.qml",
|
||||||
],
|
],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
|
|
|
@ -32,7 +32,7 @@ Kirigami.ApplicationWindow {
|
||||||
|
|
||||||
enabled: AccountManager.hasAccounts && AccountManager.isReady
|
enabled: AccountManager.hasAccounts && AccountManager.isReady
|
||||||
actions: [homeAction]
|
actions: [homeAction]
|
||||||
bottomActions: []
|
bottomActions: [settingsAction]
|
||||||
}
|
}
|
||||||
|
|
||||||
property Kirigami.Action homeAction: Kirigami.Action {
|
property Kirigami.Action homeAction: Kirigami.Action {
|
||||||
|
@ -46,6 +46,13 @@ Kirigami.ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property Kirigami.Action settingsAction: Kirigami.Action {
|
||||||
|
icon.name: "configure-symbolic"
|
||||||
|
text: i18nc("@action:button", "Settings")
|
||||||
|
checkable: true
|
||||||
|
onTriggered: Qt.createComponent("qrc:/qt/qml/com/redstrate/sukai/ui/SettingsPage.qml").createObject(root).open();
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (AccountManager.isReady) {
|
if (AccountManager.isReady) {
|
||||||
startupAccountCheck();
|
startupAccountCheck();
|
||||||
|
|
20
ui/SettingsPage.qml
Normal file
20
ui/SettingsPage.qml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
import org.kde.kirigamiaddons.settings as KirigamiSettings
|
||||||
|
|
||||||
|
KirigamiSettings.ConfigurationView {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
KirigamiSettings.ConfigurationModule {
|
||||||
|
moduleId: "about"
|
||||||
|
text: i18n("About Sukai")
|
||||||
|
icon.name: "help-about-symbolic"
|
||||||
|
page: () => Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutPage")
|
||||||
|
category: i18nc("@title:group", "About")
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Reference in a new issue