summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2016-03-23 03:12:28 +0100
committertg(x) <*@tg-x.net>2016-03-23 03:12:28 +0100
commit5936b06d6c5e1515770258ff1a944a709a336f7f (patch)
tree76e82b8c97708cdd5d71af34c4e00cfe4234ec61
parentab3825d4b0d7f69d2029caf64a6cce641a8ec57b (diff)
downloadsecushare-5936b06d6c5e1515770258ff1a944a709a336f7f.tar.gz
secushare-5936b06d6c5e1515770258ff1a944a709a336f7f.zip
qml: nav
-rw-r--r--qml/PlaceThread.qml7
-rw-r--r--qml/Prefs.qml2
-rw-r--r--qml/SidePlaceList.qml8
-rw-r--r--qml/SideThreadList.qml42
-rw-r--r--qml/ThreadList.qml32
-rw-r--r--qml/main.qml146
6 files changed, 182 insertions, 55 deletions
diff --git a/qml/PlaceThread.qml b/qml/PlaceThread.qml
index 2ec63fd..9e2df18 100644
--- a/qml/PlaceThread.qml
+++ b/qml/PlaceThread.qml
@@ -26,15 +26,14 @@ Rectangle {
26 } 26 }
27 27
28 Rectangle { 28 Rectangle {
29 id: forumTitleRectangle 29 id: forumTitle
30 color: "black" 30 color: "black"
31 height: 50 31 height: 50
32 width: 500 32 width: 500
33 opacity: 0.9 33 opacity: 0.9
34 anchors.top: parent.top 34 anchors.top: parent.top
35 anchors.topMargin: 20 35
36 Text { 36 Text {
37 id: forumTitleText
38 anchors.verticalCenter: parent.verticalCenter 37 anchors.verticalCenter: parent.verticalCenter
39 anchors.left: parent.left 38 anchors.left: parent.left
40 anchors.leftMargin: 20 39 anchors.leftMargin: 20
@@ -88,7 +87,7 @@ Rectangle {
88 87
89 ListView { 88 ListView {
90 id: messageList 89 id: messageList
91 anchors.top: forumTitleRectangle.bottom 90 anchors.top: forumTitle.bottom
92 anchors.topMargin: 30 91 anchors.topMargin: 30
93 anchors.bottom: parent.bottom 92 anchors.bottom: parent.bottom
94 anchors.right: parent.right 93 anchors.right: parent.right
diff --git a/qml/Prefs.qml b/qml/Prefs.qml
index f5f0e48..c7fa322 100644
--- a/qml/Prefs.qml
+++ b/qml/Prefs.qml
@@ -19,7 +19,7 @@ Rectangle {
19 19
20 Image { 20 Image {
21 id: imageBanner 21 id: imageBanner
22 source: "images/settings_dark.png" 22 source: "images/settings-black.png"
23 anchors.top: parent.top 23 anchors.top: parent.top
24 anchors.left: parent.left 24 anchors.left: parent.left
25 anchors.margins: 5 25 anchors.margins: 5
diff --git a/qml/SidePlaceList.qml b/qml/SidePlaceList.qml
index 358504a..2a24f2d 100644
--- a/qml/SidePlaceList.qml
+++ b/qml/SidePlaceList.qml
@@ -12,15 +12,17 @@ Rectangle {
12 property int noTab: -1 12 property int noTab: -1
13 property int enterPlaceTab: 1 13 property int enterPlaceTab: 1
14 property int createHomeTab: 2 14 property int createHomeTab: 2
15 property int threadTab: 4
15 property int profileTab: 5 16 property int profileTab: 5
16 17
18 property int mainIndex: -1
17 property int currentIndex: -1 19 property int currentIndex: -1
18 20
19 property var selectedPlace: null 21 property var selectedPlace: null
20 22
21 onCurrentIndexChanged: { 23 onMainIndexChanged: {
22 console.log ("place list index changed:", currentIndex) 24 console.log ("place list: main index changed:", mainIndex)
23 if (profileTab != currentIndex) 25 if (profileTab != mainIndex && threadTab != mainIndex)
24 { 26 {
25 setPlaceIndex(-1) 27 setPlaceIndex(-1)
26 } 28 }
diff --git a/qml/SideThreadList.qml b/qml/SideThreadList.qml
index 9f4efbd..ba0fe5a 100644
--- a/qml/SideThreadList.qml
+++ b/qml/SideThreadList.qml
@@ -12,24 +12,50 @@ Rectangle {
12 property int noTab: -1 12 property int noTab: -1
13 property int threadTab: 4 13 property int threadTab: 4
14 14
15 property int currentIndex: threadTab 15 property int mainIndex: -1
16 property int currentIndex: -1
16 17
17 property var selectedThread: null 18 property var selectedThread: null
19 property var selectedPlace: null
18 20
19 onCurrentIndexChanged: { 21 onMainIndexChanged: {
20 console.log ("thread list index changed:", currentIndex) 22 console.log ("thread list: main index changed:", mainIndex)
21 if (threadTab != currentIndex) 23 if (threadTab != mainIndex)
22 { 24 {
23 threadList.currentIndex = -1 25 threadList.currentIndex = -1
24 } 26 }
25 } 27 }
26 28
27 Rectangle { height: 10 }
28 29
29 ColumnLayout { 30 ColumnLayout {
30 width: parent.width 31 width: parent.width
31 height: parent.height 32 height: parent.height
32 33
34 Rectangle { height: 5 }
35
36 Rectangle {
37 id: newThreadButton
38 anchors.right: parent.right
39 width: parent.width - 8
40 height: 30
41 color: "black"
42
43 Image {
44 height: parent.height - 4
45 anchors.centerIn: parent
46 fillMode: Image.PreserveAspectFit
47 source: "images/add.png"
48 }
49
50 MouseArea {
51 anchors.fill: parent
52 onClicked: {
53 selectedThread = null
54 currentIndex = threadTab
55 }
56 }
57 }
58
33 ListModel { 59 ListModel {
34 id: threadListModel 60 id: threadListModel
35 61
@@ -65,12 +91,12 @@ Rectangle {
65 clip: true 91 clip: true
66 92
67 //model: threadListModel 93 //model: threadListModel
68 model: App.models.places // FIXME 94 model: selectedPlace.threadListModel
69 delegate: threadListDelegate 95 delegate: threadListDelegate
70 focus: true 96 focus: true
71 97
72 onCurrentIndexChanged: { 98 onCurrentIndexChanged: {
73 selectedThread = model.get(currentIndex) 99 selectedThread = model.thread(currentIndex)
74 if (selectedThread) 100 if (selectedThread)
75 { 101 {
76 root.currentIndex = threadTab 102 root.currentIndex = threadTab
@@ -129,9 +155,9 @@ Rectangle {
129 onClicked: threadList.currentIndex = index 155 onClicked: threadList.currentIndex = index
130 } 156 }
131 } 157 }
158
132 Rectangle { 159 Rectangle {
133 id: indicator 160 id: indicator
134
135 radius: 35 161 radius: 35
136 color: "#EFC208" 162 color: "#EFC208"
137 anchors.left: threadItemInside.left 163 anchors.left: threadItemInside.left
diff --git a/qml/ThreadList.qml b/qml/ThreadList.qml
index 83986d2..826e4a9 100644
--- a/qml/ThreadList.qml
+++ b/qml/ThreadList.qml
@@ -17,14 +17,6 @@ Rectangle {
17 17
18 property var selectedThread: null 18 property var selectedThread: null
19 19
20 onCurrentIndexChanged: {
21 console.log ("thread list index changed:", currentIndex)
22 if (threadTab != currentIndex)
23 {
24 threadList.currentIndex = -1
25 }
26 }
27
28 function setThreadIndex (idx) { 20 function setThreadIndex (idx) {
29 threadList.currentIndex = idx 21 threadList.currentIndex = idx
30 selectedThread = threadList.model.get(idx) 22 selectedThread = threadList.model.get(idx)
@@ -43,12 +35,32 @@ Rectangle {
43 source: "images/demo/ubuntu-wallpaper.jpg" 35 source: "images/demo/ubuntu-wallpaper.jpg"
44 } 36 }
45 37
46 Rectangle { height: 10 }
47
48 ColumnLayout { 38 ColumnLayout {
49 width: parent.width 39 width: parent.width
50 height: parent.height 40 height: parent.height
51 41
42 Rectangle {
43 id: title
44 color: "black"
45 height: 50
46 width: 500
47 opacity: 0.9
48
49 Text {
50 anchors.verticalCenter: parent.verticalCenter
51 anchors.left: parent.left
52 anchors.leftMargin: 20
53
54 text: qsTr("Active topics")
55 wrapMode : Text.Wrap
56 elide : Text.ElideRight
57 color: "white"
58 //font.bold: true
59 font.pointSize: 22
60 font.family: bebasFont.name
61 }
62 }
63
52 ListModel { 64 ListModel {
53 id: threadListModel 65 id: threadListModel
54 66
diff --git a/qml/main.qml b/qml/main.qml
index 66a4da5..3d576ef 100644
--- a/qml/main.qml
+++ b/qml/main.qml
@@ -30,11 +30,11 @@ ApplicationWindow {
30 property int profileTab: 5 30 property int profileTab: 5
31 property int prefsTab: 6 31 property int prefsTab: 6
32 32
33 property int placesTab: 0 33 property int leftPlacesTab: 0
34 34
35 property int rightTabIndex: noTab 35 property int rightThreadsTab: 0
36 property int nymsTab: 0 36 property int rightNymsTab: 1
37 property int egosTab: 1 37 property int rightEgosTab: 2
38 38
39 property var selectedPlace: null 39 property var selectedPlace: null
40 property var selectedThread: null 40 property var selectedThread: null
@@ -68,6 +68,7 @@ ApplicationWindow {
68 spacing: 0 68 spacing: 0
69 69
70 Rectangle { 70 Rectangle {
71 id: logoButton
71 width: parent.width 72 width: parent.width
72 height: 60 73 height: 60
73 color: threadListTab == main.currentIndex ? "white" : "transparent" 74 color: threadListTab == main.currentIndex ? "white" : "transparent"
@@ -89,8 +90,6 @@ ApplicationWindow {
89 anchors.fill: parent 90 anchors.fill: parent
90 onClicked: { 91 onClicked: {
91 main.currentIndex = threadListTab 92 main.currentIndex = threadListTab
92 rightTabIndex = nymsTab
93 nymsList.model = nymsModel
94 } 93 }
95 } 94 }
96 } 95 }
@@ -114,15 +113,6 @@ ApplicationWindow {
114 font.pointSize: 22 113 font.pointSize: 22
115 font.family: bebasFont.name 114 font.family: bebasFont.name
116 } 115 }
117
118 MouseArea {
119 anchors.fill: parent
120 onClicked: {
121 left.currentIndex = placesTab
122 rightTabIndex = egosTab
123 nymsList.model = App.models.egos
124 }
125 }
126 } 116 }
127 } 117 }
128 118
@@ -135,14 +125,14 @@ ApplicationWindow {
135 tabsVisible: false 125 tabsVisible: false
136 frameVisible: false 126 frameVisible: false
137 127
138 currentIndex: placesTab 128 currentIndex: leftPlacesTab
139 129
140 onCurrentIndexChanged: { 130 onCurrentIndexChanged: {
141 console.log("left tabview index changed:", currentIndex) 131 console.log("left tabview index changed:", currentIndex)
142 132
143 switch (currentIndex) 133 switch (currentIndex)
144 { 134 {
145 case placesTab: 135 case leftPlacesTab:
146 if (0 <= placeListTab.currentIndex) 136 if (0 <= placeListTab.currentIndex)
147 { 137 {
148 main.currentIndex = placeListTab.currentIndex 138 main.currentIndex = placeListTab.currentIndex
@@ -160,6 +150,7 @@ ApplicationWindow {
160 id: placeList 150 id: placeList
161 anchors.fill: parent 151 anchors.fill: parent
162 width: 200 - 8 152 width: 200 - 8
153 mainIndex: main.currentIndex
163 154
164 onCurrentIndexChanged: 155 onCurrentIndexChanged:
165 { 156 {
@@ -227,15 +218,7 @@ ApplicationWindow {
227 if (profileTab != currentIndex 218 if (profileTab != currentIndex
228 && threadTab != currentIndex) 219 && threadTab != currentIndex)
229 { 220 {
230 placeListTab.currentIndex = noTab 221 placeListTab.currentIndex = noTab
231 }
232
233 if (profileTab != currentIndex
234 && enterPlaceTab != currentIndex
235 && createHomeTab != currentIndex
236 && createEgoTab != currentIndex)
237 {
238 rightTabIndex = noTab
239 } 222 }
240 } 223 }
241 224
@@ -255,7 +238,6 @@ ApplicationWindow {
255 if (selectedThread) 238 if (selectedThread)
256 { 239 {
257 main.currentIndex = threadTab 240 main.currentIndex = threadTab
258 rightTabIndex = nymsTab
259 } 241 }
260 } 242 }
261 } 243 }
@@ -305,6 +287,7 @@ ApplicationWindow {
305 width: 200 287 width: 200
306 Layout.fillHeight: true 288 Layout.fillHeight: true
307 color: Settings.rightSideColor 289 color: Settings.rightSideColor
290 visible: profileTab == main.currentIndex || threadTab == main.currentIndex
308 291
309 ColumnLayout { 292 ColumnLayout {
310 width: parent.width - 8 293 width: parent.width - 8
@@ -318,8 +301,113 @@ ApplicationWindow {
318 anchors.leftMargin: 0 301 anchors.leftMargin: 0
319 anchors.rightMargin: 8 302 anchors.rightMargin: 8
320 303
321 spacing: 10 304 spacing: 0
305
306 ColumnLayout {
307 anchors.right: parent.right
308 width: parent.width - 8
309 spacing: 0
310
311 Rectangle {
312 height: 30
313 width: parent.width
314 color: right.currentIndex == rightThreadsTab ? "white" : "black"
315
316 Text {
317 text: qsTr("THREADS")
318 color: right.currentIndex == rightThreadsTab ? "black" : "white"
319 anchors.centerIn: parent
320 font.pointSize: 22
321 font.family: bebasFont.name
322 }
323
324 MouseArea {
325 anchors.fill: parent
326 onClicked: {
327 right.currentIndex = rightThreadsTab
328 }
329 }
330 }
331
332 Rectangle {
333 height: 30
334 width: parent.width
335 color: right.currentIndex == rightNymsTab ? "white" : "black"
336
337 Text {
338 text: qsTr("PARTICIPANTS")
339 color: right.currentIndex == rightNymsTab ? "black" : "white"
340 anchors.centerIn: parent
341 font.pointSize: 22
342 font.family: bebasFont.name
343 }
344
345 MouseArea {
346 anchors.fill: parent
347 onClicked: {
348 right.currentIndex = rightNymsTab
349 }
350 }
351 }
352 }
353
354 TabView {
355 id: right
356 Layout.fillHeight: true
357 Layout.fillWidth: true
358
359 focus: true
360 tabsVisible: false
361 frameVisible: false
362
363 currentIndex: rightThreadsTab
364
365 onCurrentIndexChanged: {
366 console.log("right tabview index changed:", currentIndex)
367
368 switch (currentIndex)
369 {
370 case rightThreadsTab:
371 if (0 <= sideThreadsTab.currentIndex)
372 {
373 main.currentIndex = sideThreadsTab.currentIndex
374 }
375 break;
376 }
377 }
378
379 Tab {
380 id: sideThreadsTab
381 active: true
382 property int currentIndex: -1
383
384 SideThreadList {
385 id: sideThreads
386 anchors.fill: parent
387 width: 200 - 8
388
389 mainIndex: main.currentIndex
390 selectedPlace: selectedPlace
322 391
392 onCurrentIndexChanged:
393 {
394 sideThreadsTab.currentIndex = currentIndex
395 main.currentIndex = currentIndex
396 }
397
398 onSelectedThreadChanged:
399 {
400 console.log("selected thread changed:", selectedThread)
401 root.selectedThread = selectedThread
402 if (selectedThread)
403 {
404 main.currentIndex = threadTab
405 }
406 }
407 }
408 }
409 }
410/* FIXME
323 ColumnLayout { 411 ColumnLayout {
324 anchors.right: parent.right 412 anchors.right: parent.right
325 width: parent.width - parent.anchors.rightMargin 413 width: parent.width - parent.anchors.rightMargin
@@ -525,7 +613,7 @@ ApplicationWindow {
525 } 613 }
526 } 614 }
527 } 615 }
528 616*/
529 } 617 }
530 } 618 }
531 } 619 }