Dekko
Loading...
Searching...
No Matches
NavMenuPage.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 Lomiri.Components 1.3
20import Dekko.Mail 1.0
21import Dekko.Mail.API 1.0
22import Dekko.Mail.Accounts 1.0
23import Dekko.Mail.Settings 1.0
24import Dekko.Lomiri.Components 1.0 as Comps
25import "./models"
26
27Comps.DekkoPage {
28 id: menuPage
29
30 pageHeader.title: qsTr("Mail")
31 pageHeader.composeButtonEnabled: tabBar.currentIndex === 0 && dekko.isLargeFF
32 extendHeader: true
33
34 Comps.PageContent {
35
36 ListView {
37 id: navDrawer
38 clip: true
39 anchors {
40 left: parent.left
41 top: parent.top
42 right: parent.right
43 bottom: tabBar.top
44 }
45 model: NavMenuModel{
46 panelIsParent: false
47 }
48 interactive: false
49 orientation: ListView.Horizontal
50 snapMode: ListView.SnapOneItem
51 currentIndex: tabBar.currentIndex
52 highlightMoveDuration: 275 // seems about right :-D
53 }
54
55 Comps.TabBar {
56 id: tabBar
57 width: parent.width
58 anchors.bottom: parent.bottom
59 iconNameModel: ["email", "contact-group", "settings", "like"]
60 currentIndex: 0
61 onCurrentIndexChanged: {
62 switch(currentIndex) {
63 case 0:
64 menuPage.pageHeader.title = qsTr("Mail")
65 break
66 case 1:
67 menuPage.pageHeader.title = qsTr("Contacts")
68 break
69 case 2:
70 menuPage.pageHeader.title = qsTr("Settings")
71 break
72 case 3:
73 menuPage.pageHeader.title = qsTr("About")
74 break
75 }
76 }
77 }
78 }
79}
80