blob: ccadf0f3c0779f550b705e2c7918b2b802ece922 [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001
2/*
3 * Copyright (C) 2020 by Savoir-faire Linux
4 * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19import QtQuick 2.14
20import QtQuick.Controls 2.14
21import QtQuick.Layouts 1.14
22import net.jami.Models 1.0
23
ababi69f5dfc2020-08-25 15:07:57 +020024
Sébastien Blin1f915762020-08-03 13:27:42 -040025Dialog {
26 id: userQrImageDialog
27
ababi69f5dfc2020-08-25 15:07:57 +020028 property string accountIdStr: ClientWrapper.utilsAdaptor.getCurrAccId()
Sébastien Blin1f915762020-08-03 13:27:42 -040029
ababi69f5dfc2020-08-25 15:07:57 +020030 function updateQrDialog() {
31 accountIdStr = ClientWrapper.utilsAdaptor.getCurrAccId()
32 }
Sébastien Blin1f915762020-08-03 13:27:42 -040033
ababi69f5dfc2020-08-25 15:07:57 +020034 // When dialog is opened, trigger mainViewWindow overlay which is defined in overlay.model.
35 // (model : true is necessary)
Sébastien Blin1f915762020-08-03 13:27:42 -040036 modal: true
37
ababi69f5dfc2020-08-25 15:07:57 +020038 //Content height + margin.
Sébastien Blin1f915762020-08-03 13:27:42 -040039 contentHeight: userQrImage.height + 30
40
41 Image {
42 id: userQrImage
43
44 anchors.centerIn: parent
45
46 width: 250
47 height: 250
48
49 fillMode: Image.PreserveAspectFit
ababi69f5dfc2020-08-25 15:07:57 +020050 source: "image://qrImage/account_" + accountIdStr
Sébastien Blin1f915762020-08-03 13:27:42 -040051 sourceSize.width: 260
52 sourceSize.height: 260
53 mipmap: true
54 }
55
56 background: Rectangle {
57 border.width: 0
58 radius: 10
59 }
60}