-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathActivities.qml
117 lines (112 loc) · 3.32 KB
/
Activities.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtGraphicalEffects 1.0
Item {
id: activities_frame
property real commonMargin: 0.1*width
Avatar {
id: current_user_avatar
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: activities_frame.commonMargin
anchors.topMargin: activities_frame.commonMargin
width: 0.25*parent.width
avatarImage: "img/CharlesDarwin.jpg"
active: true
}
Text {
id: current_user_name
anchors.left: current_user_avatar.right
anchors.leftMargin: 0.05*parent.width
anchors.right:parent.right
anchors.bottom: current_user_avatar.verticalCenter
text: "Charles Darwin"
color: "white"
font.pixelSize: 0.05*parent.width
elide: Text.ElideRight
}
Text {
id: current_user_status
anchors.left: current_user_name.left
anchors.right: current_user_name.right
anchors.top: current_user_avatar.verticalCenter
text: "Finches, yo!"
color: "white"
font.pixelSize: 0.035*parent.width
font.italic: true
elide: Text.ElideRight
}
Component {
id: tabViewStyle
TabViewStyle {
tabsAlignment: Qt.AlignLeft
tabOverlap: 0
tabsMovable: false
tab: Rectangle {
implicitWidth: control.width/control.count
implicitHeight: 0.1*activities_frame.height
color: "black"
Image {
id: tab_image
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
width: parent.width/4
height: width
smooth: true
source: "img/TabIcon"+styleData.index+".svg"
}
Text {
function tabText(index) {
if (0 === index) {
return qsTr("Task")
} else if (1 === index) {
return qsTr("Share")
} else {
return qsTr("Settings")
}
}
anchors.left: tab_image.right
anchors.leftMargin: 0.1*parent.width
anchors.right: parent.right
anchors.bottom: tab_image.verticalCenter
text: tabText(styleData.index)
color: styleData.selected?"white":main_window.lightBlue
font.pixelSize:0.15*parent.width
}
ColorOverlay {
anchors.fill: tab_image
source: tab_image
color: styleData.selected?"#FFFFFF":"#5eb9e5"
}
}
frame: Rectangle {
color: "transparent"
}
}
}
TabView {
anchors.top: current_user_avatar.bottom
anchors.topMargin: activities_frame.commonMargin
anchors.left: parent.left
anchors.leftMargin: activities_frame.commonMargin/2
anchors.right: parent.right
anchors.rightMargin: activities_frame.commonMargin/2
height: 0.7*parent.height
style: tabViewStyle
opacity: 1
Tab {
TalkTab {
}
}
Tab {
ShareTab {
}
}
Tab {
SettingsTab {
}
}
}
}