on xenial help sign in
Merge
commitaf2f0bb8ae04ad4ef50388f5c152d6699c81b50e authorAlbert Astals <albert.astals@canonical.com> dateFri 25 Jul 2014, 12:42 (12 years ago) parent5642d8c3d1d3f0
22 files changed+377−70
debian/changelog+36 plugins/Dash/ScopeStyle.qml+6 plugins/Dash/listviewwithpageheader.cpp−5 plugins/Unity/Launcher/launchermodel.cpp+3−2 po/gd.po+3−3 po/hu.po+11−9 po/sl.po+11−11 po/sv.po+19−18 qml/Components/Background.qml+77 qml/Components/PageHeader.qml+6−1 qml/Dash/CardVerticalJournal.qml+1 qml/Dash/DashRenderer.qml+1−1 qml/Dash/GenericScopeView.qml+19−1 src/main.cpp+1−1 tests/autopilot/unity8/shell/emulators/dash.py+10−7 tests/autopilot/unity8/shell/tests/test_emulators.py+10 tests/autopilot/unity8/shell/tests/test_upstart.py+13 tests/mocks/Unity/fake_scope.cpp+6−4 tests/plugins/Dash/tst_ScopeStyle.qml+27−2 tests/qmltests/CMakeLists.txt+1 tests/qmltests/Components/tst_Background.qml+90 tests/qmltests/Dash/tst_GenericScopeView.qml+26−5
debian/changelog+36
@@ -1,3 +1,39 @@
1+unity8 (7.90+14.10.20140724.1-0ubuntu1) utopic; urgency=low
2+
3+ [ Michael Zanetti ]
4+ * properly parent launcher items (LP: #1347902)
5+
6+ [ Michał Sawicz ]
7+ * Move the PyDev project files to the root, supporting .py scripts
8+ outside of tests/autopilot. Add Autopilot Run and List launch
9+ configurations to easily support debugging in Eclipse. Use
10+ add_unity8_mock macro in the Telephony plugin.
11+ * Drop FilterGrid and refactor height animations in GenericScopeView.
12+ Also implement forced category expansion. (LP: #1326470)
13+ * Move expansion button from section header to category footer. (LP:
14+ #1261300)
15+ * Fix expect-sigstop enviroment variable name. (LP: #1346819)
16+ * Make headerless categories easier Instead of having no header
17+ category (which is a bit confusing since the LVWPH code was designed
18+ so that when a category has no header it is because it shares the
19+ category with the previous one) what we have for headerless
20+ categories is a header of height 0, this way everything works as it
21+ should and results in cleaner code in the LVWPH and in
22+ GenericScopeView
23+ * Add support for header links.
24+ * Add dash PageHeader styling.
25+
26+ [ Albert Astals ]
27+ * Make headerless categories easier Instead of having no header
28+ category (which is a bit confusing since the LVWPH code was designed
29+ so that when a category has no header it is because it shares the
30+ category with the previous one) what we have for headerless
31+ categories is a header of height 0, this way everything works as it
32+ should and results in cleaner code in the LVWPH and in
33+ GenericScopeView
34+
35+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 24 Jul 2014 20:41:29 +0000
36+
137unity8 (7.90+14.10.20140723.4-0ubuntu1) utopic; urgency=low
238
339 [ thomas-voss ]
plugins/Dash/ScopeStyle.qml+6
@@ -70,6 +70,12 @@ QtObject {
7070 /// Source of the logo image for the header
7171 readonly property url headerLogo: "logo" in d.headerStyle ? d.headerStyle["logo"] : ""
7272
73+ /// Background style for the header
74+ readonly property url headerBackground: "background" in d.headerStyle ? d.headerStyle["background"] : ""
75+
76+ /// Foreground color for the header
77+ readonly property color headerForeground: "foreground-color" in d.headerStyle ? d.headerStyle["foreground-color"] : foreground
78+
7379 //! @cond
7480 property var d: QtObject {
7581 readonly property real foregroundLuminance: luminance(foreground)
plugins/Dash/listviewwithpageheader.cpp−5
@@ -141,8 +141,6 @@ void ListViewWithPageHeader::ListItem::setCulled(bool culled)
141141void ListViewWithPageHeader::ListItem::setSectionItem(QQuickItem *sectionItem)
142142{
143143 m_sectionItem = sectionItem;
144− QQmlContext *context = QQmlEngine::contextForObject(m_item)->parentContext();
145− context->setContextProperty(QLatin1String("hasSectionHeader"), QVariant::fromValue<bool>(sectionItem != nullptr));
146144}
147145
148146ListViewWithPageHeader::ListViewWithPageHeader()
@@ -685,8 +683,6 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, bool alreadyI
685683 return nullptr;
686684
687685 const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
688− if (section.isEmpty())
689− return nullptr;
690686
691687 if (modelIndex > 0) {
692688 const QString prevSection = m_delegateModel->stringValue(modelIndex - 1, m_sectionProperty);
@@ -877,7 +873,6 @@ void ListViewWithPageHeader::itemCreated(int modelIndex, QObject *object)
877873 QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
878874 context->setContextProperty(QLatin1String("ListViewWithPageHeader"), this);
879875 context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
880− context->setContextProperty(QLatin1String("hasSectionHeader"), QVariant::fromValue<bool>(false));
881876 if (modelIndex == m_asyncRequestedIndex) {
882877 createItem(modelIndex, false);
883878 refill();
plugins/Unity/Launcher/launchermodel.cpp+3−2
@@ -141,7 +141,8 @@ void LauncherModel::pin(const QString &appId, int index)
141141 beginInsertRows(QModelIndex(), index, index);
142142 LauncherItem *item = new LauncherItem(appId,
143143 m_backend->displayName(appId),
144− m_backend->icon(appId));
144+ m_backend->icon(appId),
145+ this);
145146 item->setPinned(true);
146147 m_list.insert(index, item);
147148 endInsertRows();
@@ -326,7 +327,7 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
326327 if (found) {
327328 // Shall we paint some running/recent app highlight? If yes, do it here.
328329 } else {
329− LauncherItem *item = new LauncherItem(app->appId(), app->name(), app->icon().toString());
330+ LauncherItem *item = new LauncherItem(app->appId(), app->name(), app->icon().toString(), this);
330331 item->setRecent(true);
331332 item->setFocused(app->focused());
332333
po/gd.po+3−3
@@ -8,13 +8,13 @@ msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-07-07 12:15+0100\n"
11−"PO-Revision-Date: 2014-07-16 14:48+0000\n"
11+"PO-Revision-Date: 2014-07-24 22:26+0000\n"
1212"Last-Translator: GunChleoc <Unknown>\n"
1313"Language-Team: Fòram na Gàidhlig http://www.foramnagaidhlig.net\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2014-07-17 06:38+0000\n"
17+"X-Launchpad-Export-Date: 2014-07-25 07:54+0000\n"
1818"X-Generator: Launchpad (build 17114)\n"
1919"Language: gd\n"
2020
@@ -87,7 +87,7 @@ msgstr "Gairm èiginn"
8787
8888#: qml/Components/Lockscreen.qml:231
8989msgid "OK"
90−msgstr "Ceart ma-hà"
90+msgstr "Ceart ma-thà"
9191
9292#: qml/Components/PageHeader.qml:366
9393msgid "Recent searches"
po/hu.po+11−9
@@ -8,23 +8,23 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-07-07 12:15+0100\n"
11−"PO-Revision-Date: 2014-07-23 10:07+0000\n"
12−"Last-Translator: Úr Balázs <urbalazs@gmail.com>\n"
11+"PO-Revision-Date: 2014-07-24 08:19+0000\n"
12+"Last-Translator: Gabor Kelemen <kelemeng@openscope.org>\n"
1313"Language-Team: Hungarian <hu@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2014-07-24 06:32+0000\n"
17+"X-Launchpad-Export-Date: 2014-07-25 07:54+0000\n"
1818"X-Generator: Launchpad (build 17114)\n"
1919
2020#: plugins/Unity/Launcher/launcheritem.cpp:43
2121#: plugins/Unity/Launcher/launcheritem.cpp:73
2222msgid "Pin shortcut"
23−msgstr ""
23+msgstr "Indító rögzítése"
2424
2525#: plugins/Unity/Launcher/launcheritem.cpp:73
2626msgid "Unpin shortcut"
27−msgstr ""
27+msgstr "Indító feloldása"
2828
2929#: qml/Components/EdgeDemoOverlay.qml:151
3030msgid "Skip intro"
@@ -73,6 +73,8 @@ msgid ""
7373"You have now mastered the edge gestures and can start using the "
7474"phone<br><br>Tap on the screen to start"
7575msgstr ""
76+"Elsajátította a gesztusokat, és megkezdheti a telefon "
77+"használatát.<br><br>Koppintson a képernyőre a kezdéshez."
7678
7779#: qml/Components/Lockscreen.qml:214
7880msgid "Emergency Call"
@@ -105,11 +107,11 @@ msgstr "KÉSZ"
105107
106108#: qml/Components/SeeMore.qml:35
107109msgid "See more"
108−msgstr ""
110+msgstr "Több"
109111
110112#: qml/Components/SeeMore.qml:58
111113msgid "See less"
112−msgstr ""
114+msgstr "Kevesebb"
113115
114116#: qml/Dash/DashApps.qml:37
115117msgid "Recent"
@@ -137,7 +139,7 @@ msgstr "Küldés"
137139
138140#: qml/Greeter/Greeter.qml:157
139141msgid "Swipe to unlock"
140−msgstr ""
142+msgstr "Csúsztasson a feloldáshoz"
141143
142144#: qml/Hud/HudParametrizedActionsPage.qml:132
143145msgid "Confirm"
@@ -169,7 +171,7 @@ msgstr "Adja meg a SIM PIN kódját"
169171
170172#: qml/Panel/Indicators/MenuItemFactory.qml:583
171173msgid "In queue…"
172−msgstr ""
174+msgstr "Sorban…"
173175
174176#: qml/Panel/Indicators/MenuItemFactory.qml:587
175177msgid "Downloading"
po/sl.po+11−11
@@ -8,23 +8,23 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-07-07 12:15+0100\n"
11−"PO-Revision-Date: 2014-06-23 09:29+0000\n"
11+"PO-Revision-Date: 2014-07-24 09:01+0000\n"
1212"Last-Translator: Damir Jerovšek <Unknown>\n"
1313"Language-Team: Slovenian <sl@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2014-07-09 06:37+0000\n"
18−"X-Generator: Launchpad (build 17100)\n"
17+"X-Launchpad-Export-Date: 2014-07-25 07:54+0000\n"
18+"X-Generator: Launchpad (build 17114)\n"
1919
2020#: plugins/Unity/Launcher/launcheritem.cpp:43
2121#: plugins/Unity/Launcher/launcheritem.cpp:73
2222msgid "Pin shortcut"
23−msgstr ""
23+msgstr "Pripni bližnjico"
2424
2525#: plugins/Unity/Launcher/launcheritem.cpp:73
2626msgid "Unpin shortcut"
27−msgstr ""
27+msgstr "Odpni bližnjico"
2828
2929#: qml/Components/EdgeDemoOverlay.qml:151
3030msgid "Skip intro"
@@ -171,27 +171,27 @@ msgstr "Vnesite PIN kartice SIM"
171171
172172#: qml/Panel/Indicators/MenuItemFactory.qml:583
173173msgid "In queue…"
174−msgstr ""
174+msgstr "V vrsti ..."
175175
176176#: qml/Panel/Indicators/MenuItemFactory.qml:587
177177msgid "Downloading"
178−msgstr ""
178+msgstr "Prejemanje"
179179
180180#: qml/Panel/Indicators/MenuItemFactory.qml:589
181181msgid "Paused, tap to resume"
182−msgstr ""
182+msgstr "Premor, tapnite za nadaljevanje"
183183
184184#: qml/Panel/Indicators/MenuItemFactory.qml:591
185185msgid "Canceled"
186−msgstr ""
186+msgstr "Preklicano"
187187
188188#: qml/Panel/Indicators/MenuItemFactory.qml:593
189189msgid "Finished"
190−msgstr ""
190+msgstr "Končano"
191191
192192#: qml/Panel/Indicators/MenuItemFactory.qml:595
193193msgid "Failed, tap to retry"
194−msgstr ""
194+msgstr "Spodletelo, tapnite za ponovni poskus"
195195
196196#: qml/Panel/SearchIndicator.qml:27
197197msgid "Search"
po/sv.po+19−18
@@ -1,21 +1,22 @@
11# Swedish translation for unity
2−# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
2+# Copyright © 2013-2014 Rosetta Contributors and Canonical Ltd 2013-2014
33# This file is distributed under the same license as the unity package.
4−# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
4+# Josef Andersson <josef.andersson@fripost.org>, 2014.
55#
66msgid ""
77msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-07-07 12:15+0100\n"
11−"PO-Revision-Date: 2014-07-20 19:14+0000\n"
12−"Last-Translator: Gunnar Hjalmarsson <Unknown>\n"
13−"Language-Team: Swedish <sv@li.org>\n"
11+"PO-Revision-Date: 2014-07-24 13:56+0000\n"
12+"Last-Translator: Josef Andersson <Unknown>\n"
13+"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2014-07-21 07:05+0000\n"
17+"X-Launchpad-Export-Date: 2014-07-25 07:54+0000\n"
1818"X-Generator: Launchpad (build 17114)\n"
19+"Language: sv\n"
1920
2021#: plugins/Unity/Launcher/launcheritem.cpp:43
2122#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -28,7 +29,7 @@ msgstr "Släpp genväg"
2829
2930#: qml/Components/EdgeDemoOverlay.qml:151
3031msgid "Skip intro"
31−msgstr "Skippa intro"
32+msgstr "Hoppa över introduktion"
3233
3334#: qml/Components/EdgeDemo.qml:113
3435msgid "Right edge"
@@ -36,7 +37,7 @@ msgstr "Högerkant"
3637
3738#: qml/Components/EdgeDemo.qml:114
3839msgid "Try swiping from the right edge to unlock the phone"
39−msgstr "Dra med fingret från höger för att låsa upp telefonen"
40+msgstr "Svep från höger för att låsa upp telefonen"
4041
4142#: qml/Components/EdgeDemo.qml:145
4243msgid "Top edge"
@@ -71,8 +72,8 @@ msgid ""
7172"You have now mastered the edge gestures and can start using the "
7273"phone<br><br>Tap on the screen to start"
7374msgstr ""
74−"Du har nu bemästrat kantgesterna och kan börja använda telefonen<br><br>Peka "
75−"på skärmen för att starta"
75+"Du har nu bemästrat kantgesterna och kan börja använda "
76+"telefonen<br><br>Tryck på skärmen för att starta"
7677
7778#: qml/Components/Lockscreen.qml:214
7879msgid "Emergency Call"
@@ -117,11 +118,11 @@ msgstr "Senaste"
117118
118119#: qml/Dash/Previews/PreviewActionCombo.qml:34
119120msgid "More..."
120−msgstr "Mer..."
121+msgstr "Mer…"
121122
122123#: qml/Dash/Previews/PreviewActionCombo.qml:34
123124msgid "Less..."
124−msgstr "Mindre..."
125+msgstr "Mindre…"
125126
126127#: qml/Dash/Previews/PreviewRatingInput.qml:82
127128msgid "Rate this"
@@ -149,15 +150,15 @@ msgstr "Skriv eller tala in ett kommando"
149150
150151#: qml/Hud/Hud.qml:84
151152msgid "Loading. Please Wait..."
152−msgstr "Laddar. Var god vänta..."
153+msgstr "Läser in. Var god vänta…"
153154
154155#: qml/Hud/Hud.qml:89
155156msgid "Speak Now..."
156−msgstr "Tala nu..."
157+msgstr "Tala nu…"
157158
158159#: qml/Hud/Hud.qml:94
159160msgid "Speaking..."
160−msgstr "Talar..."
161+msgstr "Talar…"
161162
162163#: qml/Notifications/NotificationMenuItemFactory.qml:91
163164msgid "Show password"
@@ -169,7 +170,7 @@ msgstr "Ange SIM PIN-kod"
169170
170171#: qml/Panel/Indicators/MenuItemFactory.qml:583
171172msgid "In queue…"
172−msgstr "I kö..."
173+msgstr "I kö…"
173174
174175#: qml/Panel/Indicators/MenuItemFactory.qml:587
175176msgid "Downloading"
@@ -177,7 +178,7 @@ msgstr "Hämtar"
177178
178179#: qml/Panel/Indicators/MenuItemFactory.qml:589
179180msgid "Paused, tap to resume"
180−msgstr "Pausad, peka för att fortsätta"
181+msgstr "Pausad, tryck för att fortsätta"
181182
182183#: qml/Panel/Indicators/MenuItemFactory.qml:591
183184msgid "Canceled"
@@ -189,7 +190,7 @@ msgstr "Klart"
189190
190191#: qml/Panel/Indicators/MenuItemFactory.qml:595
191192msgid "Failed, tap to retry"
192−msgstr "Misslyckades, peka för att försöka igen"
193+msgstr "Misslyckades, tryck för att försöka igen"
193194
194195#: qml/Panel/SearchIndicator.qml:27
195196msgid "Search"
qml/Components/Background.qmlnew file+77
@@ -0,0 +1,77 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+
19+Loader {
20+ id: root
21+ anchors.fill: parent
22+
23+ property url style
24+ readonly property var parsedStyle: String(style)
25+ .match(/^(color|gradient):\/\/\/(?:(#(?:[0-9a-f]{3,4}){1,2}|[a-z]{3,}))(?:\/(#(?:[0-9a-f]{3,4}){1,2}|[a-z]{3,}))?\/?$/i)
26+
27+ sourceComponent: {
28+ if (style == "") return null;
29+ if (!parsedStyle) return image;
30+ if (parsedStyle[1] === "color") return solid
31+ if (parsedStyle[1] === "gradient") return gradient
32+ }
33+
34+ onLoaded: if (item.hasOwnProperty("parsedStyle")) {
35+ item.parsedStyle = Qt.binding(function() { return root.parsedStyle } );
36+ }
37+
38+ Component {
39+ id: solid
40+
41+ Rectangle {
42+ objectName: "solid"
43+
44+ property var parsedStyle
45+
46+ color: parsedStyle ? parsedStyle[2] : "#ffffff"
47+ }
48+ }
49+
50+ Component {
51+ id: gradient
52+
53+ Rectangle {
54+ objectName: "gradient"
55+
56+ property var parsedStyle
57+
58+ gradient: Gradient {
59+ GradientStop { position: 0; color: parsedStyle ? parsedStyle[2] : "#000000" }
60+ GradientStop { position: 1; color: parsedStyle ? parsedStyle[3] : "#000000" }
61+ }
62+ }
63+ }
64+
65+ Component {
66+ id: image
67+
68+ Image {
69+ objectName: "image"
70+
71+ source: width > 0 && height > 0 && root.style
72+
73+ sourceSize.width: width
74+ sourceSize.height: height
75+ }
76+ }
77+}
qml/Components/PageHeader.qml+6−1
@@ -130,6 +130,11 @@ Item {
130130 property bool showSearch: false
131131 property var popover: null
132132
133+ Background {
134+ objectName: "headerBackground"
135+ style: scopeStyle.headerBackground
136+ }
137+
133138 Behavior on contentY {
134139 UbuntuNumberAnimation {
135140 id: openSearchAnimation
@@ -228,7 +233,7 @@ Item {
228233 height: headerContainer.height
229234 contentHeight: height
230235 separatorSource: ""
231− textColor: root.scopeStyle ? root.scopeStyle.foreground : "grey"
236+ textColor: root.scopeStyle ? root.scopeStyle.headerForeground : "grey"
232237 property var styledItem: header
233238 property string title: root.title
234239 property var config: PageHeadConfiguration {
qml/Dash/CardVerticalJournal.qml+1
@@ -25,6 +25,7 @@ DashRenderer {
2525
2626 expandedHeight: Math.max(cardVerticalJournal.implicitHeight, minHeight)
2727 collapsedHeight: Math.max(Math.min(collapseLimit, cardVerticalJournal.implicitHeight), minHeight)
28+ // TODO: implement collapsedItemCount
2829
2930 // This minHeight is used as bootstrapper for the height. Vertical Journal
3031 // is special by the fact that it doesn't know how to calculate its implicit height unless we give it
qml/Dash/DashRenderer.qml+1−1
@@ -21,7 +21,7 @@ Item {
2121
2222 property int expandedHeight
2323
24− property int collapsedItemCount: 0
24+ property int collapsedItemCount: -1
2525
2626 property int displayMarginBeginning: 0
2727
qml/Dash/GenericScopeView.qml+19−1
@@ -125,6 +125,7 @@ FocusScope {
125125
126126 model: scopeView.categories
127127 forceNoClip: previewListView.open
128+ pixelAligned: true
128129
129130 property string expandedCategoryId: ""
130131
@@ -177,7 +178,7 @@ FocusScope {
177178 top: parent.top
178179 left: parent.left
179180 right: parent.right
180− topMargin: hasSectionHeader ? 0 : units.gu(2)
181+ topMargin: name != "" ? 0 : units.gu(2)
181182 }
182183
183184 Behavior on height {
@@ -195,6 +196,21 @@ FocusScope {
195196 readonly property bool expanded: baseItem.expanded || !baseItem.expandable
196197 height: expanded ? item.expandedHeight : item.collapsedHeight
197198
199+ Behavior on height {
200+ id: heightBehaviour
201+ enabled: false
202+ animation: UbuntuNumberAnimation {
203+ onRunningChanged: {
204+ if (!running) {
205+ heightBehaviour.enabled = false
206+ }
207+ }
208+ }
209+ }
210+
211+ readonly property bool expanded: baseItem.expanded || !baseItem.expandable
212+ height: expanded ? item.expandedHeight : item.collapsedHeight
213+
198214 source: {
199215 switch (cardTool.categoryLayout) {
200216 case "carousel": return "CardCarousel.qml";
@@ -251,6 +267,7 @@ FocusScope {
251267 openPreview(index);
252268 }
253269 }
270+
254271 onPressAndHold: {
255272 if (scopeView.pressAndHoldOverride) {
256273 scopeView.pressAndHoldOverride(index);
@@ -396,6 +413,7 @@ FocusScope {
396413 objectName: "dashSectionHeader" + (delegate ? delegate.category : "")
397414 readonly property var delegate: categoryView.item(delegateIndex)
398415 width: categoryView.width
416+ height: section != "" ? units.gu(5) : 0
399417 text: section
400418 color: scopeStyle ? scopeStyle.foreground : "grey"
401419 iconName: delegate && delegate.headerLink ? "go-next" : ""
src/main.cpp+1−1
@@ -221,7 +221,7 @@ int main(int argc, const char *argv[])
221221
222222 return runWithClient(mirServer, startShell);
223223 } else {
224− if (qgetenv("UPSTART_JOB") == "unity8") {
224+ if (!qgetenv("UNITY_MIR_EMITS_SIGSTOP").isEmpty()) {
225225 // Emit SIGSTOP as expected by upstart, under Mir it's unity-mir that will raise it.
226226 // see http://upstart.ubuntu.com/cookbook/#expect-stop
227227 raise(SIGSTOP);
tests/autopilot/unity8/shell/emulators/dash.py+10−7
@@ -19,6 +19,7 @@
1919
2020import logging
2121import time
22+import ubuntuuitoolkit
2223
2324from unity8.shell import emulators
2425
@@ -137,9 +138,9 @@ class Dash(emulators.UnityEmulatorBase):
137138 def enter_search_query(self, query):
138139 current_header = self._get_current_page_header()
139140 self.pointing_device.move(current_header.globalRect.x +
140− current_header.width - current_header.height / 2,
141+ current_header.width - current_header.height / 4,
141142 current_header.globalRect.y +
142− current_header.height / 2)
143+ current_header.height / 4)
143144 self.pointing_device.click()
144145 headerContainer = current_header.select_single(objectName="headerContainer")
145146 headerContainer.contentY.wait_for(0)
@@ -160,6 +161,10 @@ class Dash(emulators.UnityEmulatorBase):
160161 return None
161162
162163
164+class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):
165+ pass
166+
167+
163168class GenericScopeView(emulators.UnityEmulatorBase):
164169 """Autopilot emulator for generic scopes."""
165170
@@ -205,17 +210,15 @@ class DashApps(GenericScopeView):
205210 category_element = self._get_category_element(category)
206211 application_cards = category_element.select_many('AbstractButton')
207212
208− # sort by y, x, filter those out of view
209− categoryBottom = category_element.globalRect.y \
210− + category_element.height
211213 application_cards = sorted(
212214 (card for card in application_cards
213− if card.globalRect.y < categoryBottom),
215+ if card.globalRect.y
216+ < category_element.globalRect.y + category_element.height),
214217 key=lambda card: (card.globalRect.y, card.globalRect.x))
215218
216219 result = []
217220 for card in application_cards:
218− if card.objectName != 'cardToolCard':
221+ if card.objectName not in ('cardToolCard', 'seeAll'):
219222 result.append(card.title)
220223 return result
221224
tests/autopilot/unity8/shell/tests/test_emulators.py+10
@@ -16,6 +16,7 @@
1616# You should have received a copy of the GNU General Public License
1717# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818#
19+from unity8.shell.emulators.dash import ListViewWithPageHeader
1920
2021"""Tests for the Dash autopilot emulators.
2122
@@ -182,9 +183,18 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
182183
183184 def test_get_applications_should_return_correct_applications(self):
184185 category = '2'
186+ category_element = self.applications_scope._get_category_element(
187+ category)
188+ list_view = self.dash.get_scope('clickscope')\
189+ .select_single(ListViewWithPageHeader)
185190 expected_apps_count = self._get_number_of_application_slots(category)
186191 expected_applications = self.available_applications[
187192 :expected_apps_count]
193+ x_center = list_view.globalRect.x + list_view.width / 2
194+ y_center = list_view.globalRect.y + list_view.height / 2
195+ y_diff = category_element.y - list_view.height + category_element.height
196+ list_view._slow_drag(x_center, x_center,
197+ y_center, y_center - y_diff)
188198 applications = self.applications_scope.get_applications(category)
189199 self.assertEqual(expected_applications, applications)
190200
tests/autopilot/unity8/shell/tests/test_upstart.py+13
@@ -20,6 +20,7 @@
2020"""Tests for upstart integration."""
2121
2222import os
23+import stat
2324import signal
2425import subprocess
2526import time
@@ -57,6 +58,18 @@ class UpstartIntegrationTests(UnityTestCase):
5758
5859 def _launch_unity(self):
5960 self.patch_environment("QT_LOAD_TESTABILITY", "1")
61+
62+ try:
63+ host_socket = os.getenv("MIR_SOCKET", "/run/mir_socket")
64+ if stat.S_ISSOCK(os.stat(host_socket).st_mode):
65+ self.patch_environment("MIR_SERVER_HOST_SOCKET",
66+ host_socket)
67+ socket = os.path.join(os.getenv("XDG_RUNTIME_DIR", "/tmp"),
68+ "mir_socket")
69+ self.patch_environment("MIR_SERVER_FILE", socket)
70+ except OSError:
71+ pass
72+
6073 self.process = subprocess.Popen(
6174 [get_binary_path()] + self.unity_geometry_args)
6275
tests/mocks/Unity/fake_scope.cpp+6−4
@@ -195,14 +195,16 @@ bool Scope::hasDepartments() const
195195
196196QVariantMap Scope::customizations() const
197197{
198− QVariantMap m;
198+ QVariantMap m, h;
199199 if (m_id == "clickscope") {
200+ h["foreground-color"] = "yellow";
200201 m["background-color"] = "red";
201202 m["foreground-color"] = "blue";
203+ m["page-header"] = h;
202204 } else if (m_id == "MockScope5") {
203− QVariantMap pageHeader;
204− pageHeader["logo"] = QUrl("../../../tests/qmltests/Components/tst_PageHeader/logo-ubuntu-orange.svg");
205− m["page-header"] = pageHeader;
205+ h["background"] = "gradient:///lightgrey/grey";
206+ h["logo"] = QUrl("../../../tests/qmltests/Components/tst_PageHeader/logo-ubuntu-orange.svg");
207+ m["page-header"] = h;
206208 }
207209 return m;
208210}
tests/plugins/Dash/tst_ScopeStyle.qml+27−2
@@ -36,8 +36,8 @@ Rectangle {
3636 property var styles: [
3737 {},
3838 { "foreground-color": "red", "background-color": "black", "page-header": { "logo": "/foo/bar" } },
39− { "foreground-color": "green", "background-color": "white" },
40− { "foreground-color": "blue", "background-color": "darkgrey" },
39+ { "foreground-color": "green", "background-color": "white", "page-header": { "foreground-color": "black" } },
40+ { "foreground-color": "blue", "background-color": "darkgrey", "page-header": { "background": "gradient:///white/blue" } },
4141 ]
4242
4343 function cleanup() {
@@ -147,5 +147,30 @@ Rectangle {
147147 tool.style = testCase.styles[data.index];
148148 compare(tool.headerLogo, data.headerLogo, "Header logo was incorrect.");
149149 }
150+
151+ function test_headerForeground_data() {
152+ return [
153+ { tag: "default", index: 0, headerForeground: "grey" },
154+ { tag: "black", index: 2, headerForeground: "black" },
155+ ];
156+ }
157+
158+ function test_headerForeground(data) {
159+ tool.style = testCase.styles[data.index];
160+ verify(Qt.colorEqual(tool.headerForeground, data.headerForeground),
161+ "Header foreground not equal: %1 != %2".arg(tool.headerForeground).arg(data.headerForeground));
162+ }
163+
164+ function test_headerBackground_data() {
165+ return [
166+ { tag: "default", index: 0, headerBackground: "" },
167+ { tag: "black", index: 3, headerBackground: "gradient:///white/blue" },
168+ ];
169+ }
170+
171+ function test_headerBackground(data) {
172+ tool.style = testCase.styles[data.index];
173+ compare(tool.headerBackground, data.headerBackground, "Header background was incorrect.");
174+ }
150175 }
151176}
tests/qmltests/CMakeLists.txt+1
@@ -21,6 +21,7 @@ set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LC_ALL=C")
2121
2222add_qml_test(. Shell ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
2323add_qml_test(. ShellWithPin ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single-pin")
24+add_qml_test(Components Background)
2425add_qml_test(Components Carousel)
2526add_qml_test(Components DraggingArea)
2627add_qml_test(Components EdgeDemoOverlay)
tests/qmltests/Components/tst_Background.qmlnew file+90
@@ -0,0 +1,90 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import QtTest 1.0
19+import Unity.Test 0.1
20+
21+import "../../../qml/Components"
22+
23+Rectangle {
24+ width: units.gu(40)
25+ height: units.gu(71)
26+
27+ Background {
28+ id: background
29+ }
30+
31+ UnityTestCase {
32+ id: testCase
33+ name: "Background"
34+ when: windowShown
35+
36+ SignalSpy {
37+ id: loadedSpy
38+ target: background
39+ signalName: "loaded"
40+ }
41+
42+ function cleanup() {
43+ background.style = "";
44+ loadedSpy.clear();
45+ }
46+
47+ function test_style_data() {
48+ return [
49+ { tag: "empty", style: "" },
50+ { tag: "solid", style: "color:///black" },
51+ { tag: "gradient", style: "gradient:///black/red" },
52+ { tag: "image", style: "/some/path" },
53+ ];
54+ }
55+
56+ function test_style(data) {
57+ background.style = data.style;
58+ expectFail("empty", "Empty style should not create a background.");
59+ loadedSpy.wait();
60+ compare(background.item.objectName, data.tag, "Background should be %1".arg(data.style));
61+ }
62+
63+ function test_solid() {
64+ background.style = "color:///black";
65+ loadedSpy.wait();
66+
67+ verify(Qt.colorEqual(background.item.color, "black"),
68+ "Solid color not equal: %1 != black".arg(background.item.color));
69+ }
70+
71+ function test_gradient() {
72+ background.style = "gradient:///black/red";
73+ loadedSpy.wait();
74+
75+ var stops = background.item.gradient.stops;
76+
77+ verify(Qt.colorEqual(stops[0].color, "black"),
78+ "Top gradient color not equal: %1 != black".arg(stops[0].color));
79+ verify(Qt.colorEqual(stops[1].color, "red"),
80+ "Bottom gradient color not equal: %1 != black".arg(stops[1].color));
81+ }
82+
83+ function test_image() {
84+ background.style = "/some/path";
85+ loadedSpy.wait();
86+
87+ compare(background.item.source, Qt.resolvedUrl("/some/path"), "Image path is incorrect.");
88+ }
89+ }
90+}
tests/qmltests/Dash/tst_GenericScopeView.qml+26−5
@@ -58,6 +58,7 @@ Item {
5858 when: scopes.loaded && windowShown
5959
6060 property Item previewListView: findChild(genericScopeView, "previewListView")
61+ property Item header: findChild(genericScopeView, "scopePageHeader")
6162
6263 function init() {
6364 genericScopeView.scope = scopes.getScope(1)
@@ -324,13 +325,33 @@ Item {
324325 closePreview();
325326 }
326327
327− function test_header_logo() {
328− genericScopeView.scope = scopes.getScope(3);
328+ function test_header_style_data() {
329+ return [
330+ { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" },
331+ { tag: "Foreground", index: 2, foreground: "yellow", background: "", logo: "" },
332+ { tag: "Logo+Background", index: 3, foreground: "grey", background: "gradient:///lightgrey/grey",
333+ logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") },
334+ ];
335+ }
329336
330− var image = findChild(genericScopeView, "titleImage");
331− verify(image, "Could not find the title image");
332− compare(image.source, Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg"), "Title image has the wrong source");
337+ function test_header_style(data) {
338+ genericScopeView.scope = scopes.getScope(data.index);
339+ waitForRendering(genericScopeView);
340+ verify(header, "Could not find the header.");
341+
342+ var innerHeader = findChild(header, "innerPageHeader");
343+ verify(innerHeader, "Could not find the inner header");
344+ verify(Qt.colorEqual(innerHeader.textColor, data.foreground),
345+ "Foreground color not equal: %1 != %2".arg(innerHeader.textColor).arg(data.foreground));
333346
347+ var background = findChild(header, "headerBackground");
348+ verify(background, "Could not find the background");
349+ compare(background.style, data.background);
350+
351+ var image = findChild(genericScopeView, "titleImage");
352+ if (data.logo == "") expectFail(data.tag, "Title image should not exist.");
353+ verify(image, "Could not find the title image.");
354+ compare(image.source, data.logo, "Title image has the wrong source");
334355 }
335356 }
336357 }