aboutsummaryrefslogtreecommitdiff
path: root/qml/SettingsPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/SettingsPage.qml')
-rw-r--r--qml/SettingsPage.qml14
1 files changed, 8 insertions, 6 deletions
diff --git a/qml/SettingsPage.qml b/qml/SettingsPage.qml
index d0f8065..9aebbeb 100644
--- a/qml/SettingsPage.qml
+++ b/qml/SettingsPage.qml
@@ -15,28 +15,30 @@ Kirigami.ScrollablePage {
Kirigami.FormLayout {
Image {
id: pfp
+
Kirigami.FormData.label: "Avatar: "
source: "file:" + root.context.getConfig("selfavatar")
}
- FileDialog{
+ FileDialog {
id: changePfpDialog
+
folder: shortcuts.pictures
- nameFilters: [ "Image files (*.jpg *.png *.gif)" ]
+ nameFilters: ["Image files (*.jpg *.png *.gif)"]
onAccepted: {
var url = changePfpDialog.fileUrl.toString();
if (url.startsWith("file://") && url.length > 0) {
var filename = url.substring(7);
- console.log("Set avatar to : " + filename)
- root.context.setConfig("selfavatar", filename)
- pfp.source = "file:" + root.context.getConfig("selfavatar")
+ console.log("Set avatar to : " + filename);
+ root.context.setConfig("selfavatar", filename);
+ pfp.source = "file:" + root.context.getConfig("selfavatar");
}
}
-
}
Button {
id: changePfpBtn
+
text: "Change avatar"
icon.name: "avatar-default"
hoverEnabled: true