This repository has been archived by the owner on Mar 28, 2019. It is now read-only.
forked from Aseman-Land/Cutegram
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Telegram.qml
63 lines (53 loc) · 1.61 KB
/
Telegram.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import QtQuick 2.3
import Ubuntu.Components 1.3
import TelegramQml 2.0 as Telegram
import "globals"
import "account" as Account
MainView {
id: mainView
objectName: "appMainView"
width: units.gu(38)
height: units.gu(50)
focus: true
applicationName: "com.ubuntu.telegram"
anchorToKeyboard: true
automaticOrientation: true
property string appId: "com.ubuntu.telegram_telegram" // no-i18n
property string applicationVersion: CutegramGlobals.applicationVersion
/*Notification {
id: notification
}*/
Telegram.ProfileManagerModel {
id: profilesModel
source: CutegramGlobals.profilePath + "/profiles.sqlite"
engineDelegate: Account.CutegramAccountEngine {
//notificationManager: notification
}
readonly property int unreadCount: {
var res = 0
for(var i=0; i<count; i++)
if (get(i, Telegram.ProfileManagerModel.DataEngine))
res += get(i, Telegram.ProfileManagerModel.DataEngine).unreadCount
return res
}
Component.onCompleted: if(count == 0) addNew()
}
ListView {
id: listView
anchors.fill: parent
width: parent.width
clip: true
interactive: false
orientation: ListView.Horizontal
highlightRangeMode: ListView.StrictlyEnforceRange
model: profilesModel
delegate: Account.AccountMain {
width: listView.width
height: listView.height
engine: model.engine
}
}
FontLoader {
source: "awesome/fontawesome-webfont.ttf"
}
}