on xenial help sign in
Clip the infographic to its bounding box, instead of letting it bleed past the welcome page (visible when dragging the welcome page to the side).

I've also done a bit of cleanup for the mock infographic data: - I've forced a very large data bubble on the right side of the screen so that this bug/fix can specifically be seen. - I've added data for the has-pin user (so that tryShellWithPin shows infographic data). - I've fixed a crasher in our mock libusermetrics when a user has no data but the user double-clicked on the infographic. Fixes: #1420336 Approved by: Gerry Boland, PS Jenkins bot

commitdd316acd47e336da7cd2022ddd7c518570cad2fd authorMichael Terry <michael.terry@canonical.com> dateWed 11 Feb 2015, 17:13 (12 years ago) parent7754b784892fa4
2 files changed+9
qml/Greeter/GreeterContent.qml+1 tests/mocks/libusermetrics/UserMetrics.cpp+8
qml/Greeter/GreeterContent.qml+1
@@ -121,6 +121,7 @@ Item {
121121 objectName: "infographics"
122122 height: narrowMode ? parent.height : 0.75 * parent.height
123123 model: greeterContentLoader.infographicModel
124+ clip: true // clip large data bubbles
124125
125126 property string selectedUser
126127 property string infographicUser: AccountsService.statsWelcomeScreen ? selectedUser : ""
tests/mocks/libusermetrics/UserMetrics.cpp+8
@@ -289,6 +289,7 @@ void UserMetricsPrivate::generateFakeData()
289289 new UserMetricsData("<b>52km</b> travelled", first, firstMonth,
290290 ninth, secondMonth, this));
291291 m_fakeData.insert("single", data);
292+ m_fakeData.insert("has-pin", data);
292293 }
293294
294295 {
@@ -304,12 +305,14 @@ void UserMetricsPrivate::generateFakeData()
304305 new UserMetricsData("<b>33</b> messages today", second,
305306 firstMonth, eighth, secondMonth, this));
306307 m_fakeData.insert("single", data);
308+ m_fakeData.insert("has-pin", data);
307309 }
308310
309311 {
310312 QVariantList firstMonth;
311313 while (firstMonth.size() < 17)
312314 firstMonth.push_back(QVariant(rand()));
315+ firstMonth[8] = QVariant(1.0); // oversized 9th day, to test clipping
313316 while (firstMonth.size() < 31)
314317 firstMonth.push_back(QVariant());
315318 QVariantList secondMonth;
@@ -319,6 +322,7 @@ void UserMetricsPrivate::generateFakeData()
319322 new UserMetricsData("<b>19</b> minutes talk time", eighth,
320323 firstMonth, second, secondMonth, this));
321324 m_fakeData.insert("single", data);
325+ m_fakeData.insert("has-pin", data);
322326 // Also use same data for some tablet users
323327 m_fakeData.insert("has-password", data);
324328 m_fakeData.insert("no-password", data);
@@ -386,6 +390,10 @@ void UserMetricsPrivate::nextFakeData()
386390 if (m_dataIndex == m_fakeData.constEnd() || m_dataIndex.key() != m_username)
387391 {
388392 m_dataIndex = m_fakeData.constFind(m_username);
393+ if (m_dataIndex == m_fakeData.constEnd())
394+ {
395+ m_dataIndex = m_fakeData.constFind("");
396+ }
389397 }
390398
391399 loadFakeData();