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).
dd316acMichael Terry
qml/Greeter/GreeterContent.qml+1
@@ -121,6 +121,7 @@ Item {
121 objectName: "infographics"
121 objectName: "infographics"
122 height: narrowMode ? parent.height : 0.75 * parent.height
122 height: narrowMode ? parent.height : 0.75 * parent.height
123 model: greeterContentLoader.infographicModel
123 model: greeterContentLoader.infographicModel
124+ clip: true // clip large data bubbles
124
125
125 property string selectedUser
126 property string selectedUser
126 property string infographicUser: AccountsService.statsWelcomeScreen ? selectedUser : ""
127 property string infographicUser: AccountsService.statsWelcomeScreen ? selectedUser : ""
tests/mocks/libusermetrics/UserMetrics.cpp+8
@@ -289,6 +289,7 @@ void UserMetricsPrivate::generateFakeData()
289 new UserMetricsData("<b>52km</b> travelled", first, firstMonth,
289 new UserMetricsData("<b>52km</b> travelled", first, firstMonth,
290 ninth, secondMonth, this));
290 ninth, secondMonth, this));
291 m_fakeData.insert("single", data);
291 m_fakeData.insert("single", data);
292+ m_fakeData.insert("has-pin", data);
292 }
293 }
293
294
294 {
295 {
@@ -304,12 +305,14 @@ void UserMetricsPrivate::generateFakeData()
304 new UserMetricsData("<b>33</b> messages today", second,
305 new UserMetricsData("<b>33</b> messages today", second,
305 firstMonth, eighth, secondMonth, this));
306 firstMonth, eighth, secondMonth, this));
306 m_fakeData.insert("single", data);
307 m_fakeData.insert("single", data);
308+ m_fakeData.insert("has-pin", data);
307 }
309 }
308
310
309 {
311 {
310 QVariantList firstMonth;
312 QVariantList firstMonth;
311 while (firstMonth.size() < 17)
313 while (firstMonth.size() < 17)
312 firstMonth.push_back(QVariant(rand()));
314 firstMonth.push_back(QVariant(rand()));
315+ firstMonth[8] = QVariant(1.0); // oversized 9th day, to test clipping
313 while (firstMonth.size() < 31)
316 while (firstMonth.size() < 31)
314 firstMonth.push_back(QVariant());
317 firstMonth.push_back(QVariant());
315 QVariantList secondMonth;
318 QVariantList secondMonth;
@@ -319,6 +322,7 @@ void UserMetricsPrivate::generateFakeData()
319 new UserMetricsData("<b>19</b> minutes talk time", eighth,
322 new UserMetricsData("<b>19</b> minutes talk time", eighth,
320 firstMonth, second, secondMonth, this));
323 firstMonth, second, secondMonth, this));
321 m_fakeData.insert("single", data);
324 m_fakeData.insert("single", data);
325+ m_fakeData.insert("has-pin", data);
322 // Also use same data for some tablet users
326 // Also use same data for some tablet users
323 m_fakeData.insert("has-password", data);
327 m_fakeData.insert("has-password", data);
324 m_fakeData.insert("no-password", data);
328 m_fakeData.insert("no-password", data);
@@ -386,6 +390,10 @@ void UserMetricsPrivate::nextFakeData()
386 if (m_dataIndex == m_fakeData.constEnd() || m_dataIndex.key() != m_username)
390 if (m_dataIndex == m_fakeData.constEnd() || m_dataIndex.key() != m_username)
387 {
391 {
388 m_dataIndex = m_fakeData.constFind(m_username);
392 m_dataIndex = m_fakeData.constFind(m_username);
393+ if (m_dataIndex == m_fakeData.constEnd())
394+ {
395+ m_dataIndex = m_fakeData.constFind("");
396+ }
389 }
397 }
390
398
391 loadFakeData();
399 loadFakeData();