Removed
Link Here
|
1 |
From c840bbab8ca823f4cca0b70f6e692a38933449d8 Mon Sep 17 00:00:00 2001 |
2 |
From: Ronan Abhamon <ronan.abhamon@belledonne-communications.com> |
3 |
Date: Fri, 15 Jun 2018 11:55:59 +0200 |
4 |
Subject: [PATCH] fix(Timeline.qml): do not anchors rectangle in ColumnLayout |
5 |
(Qt5.11) |
6 |
|
7 |
--- |
8 |
ui/modules/Linphone/Timeline/Timeline.qml | 168 +++++++++++----------- |
9 |
1 file changed, 83 insertions(+), 85 deletions(-) |
10 |
|
11 |
diff --git a/ui/modules/Linphone/Timeline/Timeline.qml b/ui/modules/Linphone/Timeline/Timeline.qml |
12 |
index d260bd7b..95205458 100644 |
13 |
--- ui/modules/Linphone/Timeline/Timeline.qml |
14 |
+++ ui/modules/Linphone/Timeline/Timeline.qml |
15 |
@@ -9,7 +9,7 @@ import 'Timeline.js' as Logic |
16 |
|
17 |
// ============================================================================= |
18 |
|
19 |
-ColumnLayout { |
20 |
+Rectangle { |
21 |
id: timeline |
22 |
|
23 |
// --------------------------------------------------------------------------- |
24 |
@@ -35,110 +35,108 @@ ColumnLayout { |
25 |
|
26 |
// --------------------------------------------------------------------------- |
27 |
|
28 |
- spacing: 0 |
29 |
+ color: TimelineStyle.color |
30 |
|
31 |
- // --------------------------------------------------------------------------- |
32 |
+ ColumnLayout { |
33 |
+ anchors.fill: parent |
34 |
+ spacing: 0 |
35 |
|
36 |
- Connections { |
37 |
- target: model |
38 |
+ // ------------------------------------------------------------------------- |
39 |
|
40 |
- onDataChanged: Logic.handleDataChanged(topLeft, bottomRight, roles) |
41 |
- onRowsAboutToBeRemoved: Logic.handleRowsAboutToBeRemoved (parent, first, last) |
42 |
- } |
43 |
+ Connections { |
44 |
+ target: model |
45 |
|
46 |
- // --------------------------------------------------------------------------- |
47 |
- |
48 |
- Rectangle { |
49 |
- anchors.fill: parent |
50 |
- color: TimelineStyle.color |
51 |
- } |
52 |
+ onDataChanged: Logic.handleDataChanged(topLeft, bottomRight, roles) |
53 |
+ onRowsAboutToBeRemoved: Logic.handleRowsAboutToBeRemoved(parent, first, last) |
54 |
+ } |
55 |
|
56 |
- // --------------------------------------------------------------------------- |
57 |
- // Legend. |
58 |
- // --------------------------------------------------------------------------- |
59 |
+ // ------------------------------------------------------------------------- |
60 |
+ // Legend. |
61 |
+ // ------------------------------------------------------------------------- |
62 |
|
63 |
- Rectangle { |
64 |
- Layout.fillWidth: true |
65 |
- Layout.preferredHeight: TimelineStyle.legend.height |
66 |
- color: TimelineStyle.legend.backgroundColor |
67 |
+ Rectangle { |
68 |
+ Layout.fillWidth: true |
69 |
+ Layout.preferredHeight: TimelineStyle.legend.height |
70 |
+ color: TimelineStyle.legend.backgroundColor |
71 |
|
72 |
- Row { |
73 |
- anchors { |
74 |
- fill: parent |
75 |
- leftMargin: TimelineStyle.legend.leftMargin |
76 |
- rightMargin: TimelineStyle.legend.rightMargin |
77 |
- } |
78 |
- spacing: TimelineStyle.legend.spacing |
79 |
+ Row { |
80 |
+ anchors { |
81 |
+ fill: parent |
82 |
+ leftMargin: TimelineStyle.legend.leftMargin |
83 |
+ rightMargin: TimelineStyle.legend.rightMargin |
84 |
+ } |
85 |
+ spacing: TimelineStyle.legend.spacing |
86 |
|
87 |
- Icon { |
88 |
- anchors.verticalCenter: parent.verticalCenter |
89 |
- icon: 'history' |
90 |
- iconSize: TimelineStyle.legend.iconSize |
91 |
- } |
92 |
+ Icon { |
93 |
+ anchors.verticalCenter: parent.verticalCenter |
94 |
+ icon: 'history' |
95 |
+ iconSize: TimelineStyle.legend.iconSize |
96 |
+ } |
97 |
|
98 |
- Text { |
99 |
- color: TimelineStyle.legend.color |
100 |
- font.pointSize: TimelineStyle.legend.pointSize |
101 |
- height: parent.height |
102 |
- text: qsTr('timelineTitle') |
103 |
- verticalAlignment: Text.AlignVCenter |
104 |
+ Text { |
105 |
+ color: TimelineStyle.legend.color |
106 |
+ font.pointSize: TimelineStyle.legend.pointSize |
107 |
+ height: parent.height |
108 |
+ text: qsTr('timelineTitle') |
109 |
+ verticalAlignment: Text.AlignVCenter |
110 |
+ } |
111 |
} |
112 |
} |
113 |
- } |
114 |
|
115 |
- // --------------------------------------------------------------------------- |
116 |
- // History. |
117 |
- // --------------------------------------------------------------------------- |
118 |
+ // ------------------------------------------------------------------------- |
119 |
+ // History. |
120 |
+ // ------------------------------------------------------------------------- |
121 |
+ |
122 |
+ ScrollableListView { |
123 |
+ id: view |
124 |
+ |
125 |
+ Layout.fillHeight: true |
126 |
+ Layout.fillWidth: true |
127 |
+ currentIndex: -1 |
128 |
|
129 |
- ScrollableListView { |
130 |
- id: view |
131 |
- |
132 |
- Layout.fillHeight: true |
133 |
- Layout.fillWidth: true |
134 |
- currentIndex: -1 |
135 |
- |
136 |
- delegate: Item { |
137 |
- height: TimelineStyle.contact.height |
138 |
- width: parent ? parent.width : 0 |
139 |
- |
140 |
- Contact { |
141 |
- anchors.fill: parent |
142 |
- color: view.currentIndex === index |
143 |
- ? TimelineStyle.contact.backgroundColor.selected |
144 |
- : ( |
145 |
- index % 2 == 0 |
146 |
- ? TimelineStyle.contact.backgroundColor.a |
147 |
- : TimelineStyle.contact.backgroundColor.b |
148 |
- ) |
149 |
- displayUnreadMessagesCount: view.currentIndex !== index |
150 |
- entry: $timelineEntry |
151 |
- sipAddressColor: view.currentIndex === index |
152 |
- ? TimelineStyle.contact.sipAddress.color.selected |
153 |
- : TimelineStyle.contact.sipAddress.color.normal |
154 |
- usernameColor: view.currentIndex === index |
155 |
- ? TimelineStyle.contact.username.color.selected |
156 |
- : TimelineStyle.contact.username.color.normal |
157 |
- |
158 |
- Loader { |
159 |
+ delegate: Item { |
160 |
+ height: TimelineStyle.contact.height |
161 |
+ width: parent ? parent.width : 0 |
162 |
+ |
163 |
+ Contact { |
164 |
anchors.fill: parent |
165 |
- sourceComponent: TooltipArea { |
166 |
- text: $timelineEntry.timestamp.toLocaleString( |
167 |
- Qt.locale(App.locale), |
168 |
- Locale.ShortFormat |
169 |
+ color: view.currentIndex === index |
170 |
+ ? TimelineStyle.contact.backgroundColor.selected |
171 |
+ : ( |
172 |
+ index % 2 == 0 |
173 |
+ ? TimelineStyle.contact.backgroundColor.a |
174 |
+ : TimelineStyle.contact.backgroundColor.b |
175 |
) |
176 |
+ displayUnreadMessagesCount: view.currentIndex !== index |
177 |
+ entry: $timelineEntry |
178 |
+ sipAddressColor: view.currentIndex === index |
179 |
+ ? TimelineStyle.contact.sipAddress.color.selected |
180 |
+ : TimelineStyle.contact.sipAddress.color.normal |
181 |
+ usernameColor: view.currentIndex === index |
182 |
+ ? TimelineStyle.contact.username.color.selected |
183 |
+ : TimelineStyle.contact.username.color.normal |
184 |
+ |
185 |
+ Loader { |
186 |
+ anchors.fill: parent |
187 |
+ sourceComponent: TooltipArea { |
188 |
+ text: $timelineEntry.timestamp.toLocaleString( |
189 |
+ Qt.locale(App.locale), |
190 |
+ Locale.ShortFormat |
191 |
+ ) |
192 |
+ } |
193 |
} |
194 |
} |
195 |
- } |
196 |
|
197 |
- MouseArea { |
198 |
- anchors.fill: parent |
199 |
- onClicked: { |
200 |
- view.currentIndex = index |
201 |
- timeline.entrySelected($timelineEntry.sipAddress) |
202 |
+ MouseArea { |
203 |
+ anchors.fill: parent |
204 |
+ onClicked: { |
205 |
+ view.currentIndex = index |
206 |
+ timeline.entrySelected($timelineEntry.sipAddress) |
207 |
+ } |
208 |
} |
209 |
} |
210 |
- } |
211 |
|
212 |
- onCountChanged: Logic.handleCountChanged(count) |
213 |
+ onCountChanged: Logic.handleCountChanged(count) |
214 |
+ } |
215 |
} |
216 |
} |