diff options
author | link2xt <link2xt@testrun.org> | 2021-10-27 09:16:23 +0300 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2021-10-27 09:16:28 +0300 |
commit | e1201cdcce4311061643d90cc0132745023a82d2 (patch) | |
tree | 3c34dfe1a7558cd68586475f999fc2ef19035f64 /qml/SettingsPage.qml | |
parent | c16edbc50f119c9705ca4339e07b3efab3a61ac7 (diff) | |
download | kdeltachat-e1201cdcce4311061643d90cc0132745023a82d2.tar.gz kdeltachat-e1201cdcce4311061643d90cc0132745023a82d2.zip |
Diffstat (limited to 'qml/SettingsPage.qml')
-rw-r--r-- | qml/SettingsPage.qml | 14 |
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 |