on xenial help sign in
Changed gradient colours.
3a80e1cNicolas d'Offay
tests/mocks/LightDM/demo/InfographicModelPrivate.cpp+19−26
@@ -27,27 +27,20 @@ void InfographicModelPrivate::generateFakeData()
27 std::normal_distribution<qreal> distribution(0.5, 0.2);
27 std::normal_distribution<qreal> distribution(0.5, 0.2);
28 auto rand = std::bind(distribution, generator);
28 auto rand = std::bind(distribution, generator);
29
29
30− QVector<QColor> colours;
30+ QColor orange = QColor::fromRgbF(0.9, 0.3, 0.1, 1.0);
31+ QColor yellow = QColor::fromRgbF(1.0, 0.6, 0.0, 1.0);
31− colours.push_back(QColor::fromRgbF(0.3, 0.27, 0.32));
32+ QColor red = QColor::fromRgbF(0.8, 0.0, 0.0, 1.0);
32− colours.push_back(QColor::fromRgbF(0.83, 0.49, 0.58));
33+ QColor darkPurple = QColor::fromRgbF(0.5, 0.2, 0.3, 1.0);
34+ QColor lightPurple = QColor::fromRgbF(0.8, 0.1, 0.8, 1.0);
33− colours.push_back(QColor::fromRgbF(0.63, 0.51, 0.59));
35+ QColor pink(QColor::fromRgbF(0.75, 0.13, 0.75));
34
36
35− colours.push_back(QColor::fromRgbF(0.28, 0.26, 0.4));
37+ InfographicColorTheme orangeTheme(yellow, orange, red);
36− colours.push_back(QColor::fromRgbF(0.47, 0.38, 0.56));
38+ InfographicColorTheme yellowTheme(orange, yellow, orange);
37− colours.push_back(QColor::fromRgbF(0.69, 0.65, 0.78));
39+ InfographicColorTheme redTheme(red, red, red);
38−
40+ InfographicColorTheme darkPurpleTheme(lightPurple, darkPurple, pink);
39− colours.push_back(QColor::fromRgbF(0.32, 0.21, 0.16));
41+ InfographicColorTheme lightPurpleTheme(lightPurple, lightPurple,
40− colours.push_back(QColor::fromRgbF(0.55, 0.45, 0.32));
42+ lightPurple);
41− colours.push_back(QColor::fromRgbF(0.85, 0.74, 0.53));
43+ InfographicColorTheme pinkTheme(lightPurple, pink, darkPurple);
42−
43− colours.push_back(QColor::fromRgbF(0.25, 0.31, 0.19));
44− colours.push_back(QColor::fromRgbF(0.63, 0.53, 0.3));
45− colours.push_back(QColor::fromRgbF(0.89, 0.56, 0.31));
46−
47− InfographicColorTheme first(colours[0], colours[1], colours[2]);
48− InfographicColorTheme second(colours[3], colours[4], colours[5]);
49− InfographicColorTheme eighth(colours[6], colours[7], colours[8]);
50− InfographicColorTheme ninth(colours[9], colours[10], colours[11]);
51
44
52 {
45 {
53 QVariantList firstMonth;
46 QVariantList firstMonth;
@@ -59,8 +52,8 @@ void InfographicModelPrivate::generateFakeData()
59 while (secondMonth.size() < 31)
52 while (secondMonth.size() < 31)
60 secondMonth.push_back(QVariant(rand()));
53 secondMonth.push_back(QVariant(rand()));
61 QSharedPointer<InfographicData> data(
54 QSharedPointer<InfographicData> data(
62− new InfographicData("<b>52km</b> travelled", first, firstMonth,
55+ new InfographicData("<b>52km</b> travelled", yellowTheme, firstMonth,
63− ninth, secondMonth, this));
56+ orangeTheme, secondMonth, this));
64 m_fakeData.insert("guest", data);
57 m_fakeData.insert("guest", data);
65 }
58 }
66
59
@@ -74,8 +67,8 @@ void InfographicModelPrivate::generateFakeData()
74 while (secondMonth.size() < 31)
67 while (secondMonth.size() < 31)
75 secondMonth.push_back(QVariant(rand()));
68 secondMonth.push_back(QVariant(rand()));
76 QSharedPointer<InfographicData> data(
69 QSharedPointer<InfographicData> data(
77− new InfographicData("<b>33</b> messages today", second,
70+ new InfographicData("<b>33</b> messages today", pinkTheme,
78− firstMonth, eighth, secondMonth, this));
71+ firstMonth, orangeTheme, secondMonth, this));
79 m_fakeData.insert("guest", data);
72 m_fakeData.insert("guest", data);
80 }
73 }
81
74
@@ -89,8 +82,8 @@ void InfographicModelPrivate::generateFakeData()
89 while (secondMonth.size() < 31)
82 while (secondMonth.size() < 31)
90 secondMonth.push_back(QVariant(rand()));
83 secondMonth.push_back(QVariant(rand()));
91 QSharedPointer<InfographicData> data(
84 QSharedPointer<InfographicData> data(
92− new InfographicData("<b>69</b> minutes talk time", eighth,
85+ new InfographicData("<b>69</b> minutes talk time", darkPurpleTheme,
93− firstMonth, second, secondMonth, this));
86+ firstMonth, redTheme, secondMonth, this));
94 m_fakeData.insert("guest", data);
87 m_fakeData.insert("guest", data);
95 }
88 }
96}
89}