Dekko
Loading...
Searching...
No Matches
NoAccountsUI.qml
1/* Copyright (C) 2016 - 2017 Dan Chapman <dpniel@ubuntu.com>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18import QtQuick 2.4
19import QtQuick.Controls.Suru 2.2
20import QtGraphicalEffects 1.0
21import Lomiri.Components 1.3
22import Dekko.Components 1.0
23import Dekko.Lomiri.Components 1.0
24import Dekko.Mail.API 1.0
25import Dekko.Mail.Stores.Accounts 1.0
26import Dekko.Lomiri.Constants 1.0
28DekkoPage {
29 id: noAccounts
30 objectName: "noAccountsUI"
31 pageHeader.title: qsTr("Accounts")
32 signal createAccount()
33 signal quit()
34
36
37 ScrollView {
38 anchors.fill: parent
39
40 Flickable {
41 anchors.fill: parent
42 contentHeight: ibxContainer.height + b.height + l.height + units.gu(7)
43 clip: true
44
45 Item {
46 id:ibxContainer
47 width: parent.width
48 height: inbox.height + units.gu(5)
49
50
51 InnerShadow {
52 anchors.fill: inbox
53 radius: 8.0
54 samples: 16
55 horizontalOffset: -3
56 verticalOffset: 3
57 color: LomiriColors.ash
58 source: inbox
59 }
60
62 id: inbox
63 name: Icons.AccountIcon
64 height: units.gu(20)
65 width: height
66 anchors {
67 bottom: parent.bottom
68 horizontalCenter: parent.horizontalCenter
69 }
70
71 color: Suru.neutralColor
72 visible: false
73 }
74 }
75
76 Item {
77 id: l
78 anchors {
79 left: parent.left
80 right:parent.right
81 top: ibxContainer.bottom
82 topMargin:Style.defaultSpacing
83 }
84 height: t.height
85
86 Label {
87 id: t
88 anchors {
89 top: parent.top
90 horizontalCenter: parent.horizontalCenter
91 }
92 width: parent.width - units.gu(4)
93 text: qsTr("No email account is setup.")
94 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
95 fontSize: "large"
96 horizontalAlignment: Text.AlignHCenter
97 }
98 }
99
100 Button {
101 id: b
102 text: qsTr("Add now")
103 Suru.highlightType: Suru.PositiveHighlight
104 color: Suru.highlightColor
105 anchors {
106 top: l.bottom
107 topMargin: units.gu(3)
108 horizontalCenter: parent.horizontalCenter
109 }
110 onClicked: AccountSetup.createAccount()
111 }
112 }
113 }
114 }
115}