Merge lp:~aacid/unity8/tabbar_dash into lp:unity8
- tabbar_dash
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michał Sawicz |
Approved revision: | 536 |
Merged at revision: | 617 |
Proposed branch: | lp:~aacid/unity8/tabbar_dash |
Merge into: | lp:unity8 |
Diff against target: |
1835 lines (+651/-644) 22 files modified
plugins/Utils/qsortfilterproxymodelqml.cpp (+12/-0) plugins/Utils/qsortfilterproxymodelqml.h (+1/-0) qml/Components/PageHeader.qml (+13/-37) qml/Components/PageHeaderLabel.qml (+41/-0) qml/Dash/Dash.qml (+0/-18) qml/Dash/DashApps.qml (+0/-3) qml/Dash/DashBar.qml (+0/-128) qml/Dash/DashContent.qml (+134/-73) qml/Dash/DashContentOpenEffect.qml (+57/-0) qml/Dash/DashContentTabBarStyle.qml (+21/-0) qml/Dash/GenericScopeView.qml (+28/-228) qml/Dash/PreviewListView.qml (+212/-0) qml/Hud/HudParametrizedActionsPage.qml (+1/-1) tests/mocks/Unity/fake_scopes.cpp (+3/-0) tests/mocks/Unity/fake_scopes.h (+2/-1) tests/qmltests/CMakeLists.txt (+1/-2) tests/qmltests/Components/tst_PageHeaderLabel.qml (+2/-2) tests/qmltests/Dash/qml/FakeScopeView.qml (+1/-0) tests/qmltests/Dash/tst_Dash.qml (+6/-8) tests/qmltests/Dash/tst_DashBar.qml (+0/-111) tests/qmltests/Dash/tst_DashContent.qml (+67/-4) tests/qmltests/Dash/tst_GenericScopeView.qml (+49/-28) |
To merge this branch: | bzr merge lp:~aacid/unity8/tabbar_dash |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Michael Zanetti (community) | Approve | ||
Michał Sawicz | Needs Fixing | ||
Review via email: mp+192505@code.launchpad.net |
Commit message
Add TabBar to the Dash header navigation
Changes this comes with:
* DashBar at the bottom is gone
* PageHeader doesn't have a Label anymore, it has the childItem property where you add which thing it has to contain
* New: PageHeaderLabel mimics the old behaviour of PageHeader
* The header of the LVWPH of GenericScopeView is now fake and only used for positioning. There is a single global floating header in DashContent (which is a PageHeader with a TabBar as childItem)
* The GenericScopeView previewLoader and OpenEffect have been also moved to the DashContent so that the openEffect includes the floating header in the "animation"
Description of the change
Needs ubuntu-ui-toolkit and unity-scopes-shell from their respective master branches
Albert Astals Cid (aacid) wrote : | # |
Michał Sawicz (saviq) wrote : | # |
The search entry behaves wrong on wide screens - it should only take the *current* label into account when deciding whether to hide up or not.
Related to above - you should be able to scroll the tab bar by dragging / swiping without tapping first.
The tab bar should be limited to shell.width - textEntry.width so that they don't overlap.
The "fat horizontal divider" is always on screen for me.
After overshooting, the header does not come back to the original position, it stops some 1-2gu up from where it should be.
The header label travels behind the search entry.
When switching to the sides, the header label moves down some 1-2gu from where it should be.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:480
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:481
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
> The search entry behaves wrong on wide screens - it should only take the
> *current* label into account when deciding whether to hide up or not.
Fixed
> Related to above - you should be able to scroll the tab bar by dragging /
> swiping without tapping first.
That works here :-S
> The tab bar should be limited to shell.width - textEntry.width so that they
> don't overlap.
Fixed
> The "fat horizontal divider" is always on screen for me.
Fixed
> After overshooting, the header does not come back to the original position, it
> stops some 1-2gu up from where it should be.
Hmmmm, you sure this is a bug? I mean, isn't it just that the list is a bit taller than the viewport and so it doesn't come back simply because it doesn't have to? If not can you tell me exactly what you do to repro?
>
> The header label travels behind the search entry.
Not sure if i understand this
>
> When switching to the sides, the header label moves down some 1-2gu from where
> it should be.
Is this the same thing than in the other 1-2gu comment?
Michał Sawicz (saviq) wrote : | # |
On 28.10.2013 09:31, Albert Astals Cid wrote:
>> Related to above - you should be able to scroll the tab bar by dragging /
>> swiping without tapping first.
>
> That works here :-S
Yeah, must've gotten fixed.
>> After overshooting, the header does not come back to the original position, it
>> stops some 1-2gu up from where it should be.
>
> Hmmmm, you sure this is a bug? I mean, isn't it just that the list is a bit taller than the viewport and so it doesn't come back simply because it doesn't have to? If not can you tell me exactly what you do to repro?
I'm still getting that sometimes, but need to find steps to repro.
>> The header label travels behind the search entry.
>
> Not sure if i understand this
Fixed.
>> When switching to the sides, the header label moves down some 1-2gu from where
>> it should be.
>
> Is this the same thing than in the other 1-2gu comment?
Fixed.
--
Michał (Saviq) Sawicz <email address hidden>
Canonical Services Ltd.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:483
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
http://
Font color broken ^^
Michael Zanetti (mzanetti) wrote : | # |
> Set the raised style so we can see text when it's white on white
yep, better
Michael Zanetti (mzanetti) wrote : | # |
The progression arrow is still invisible with a white background
Michael Zanetti (mzanetti) wrote : | # |
> >> After overshooting, the header does not come back to the original position,
> it
> >> stops some 1-2gu up from where it should be.
> >
> > Hmmmm, you sure this is a bug? I mean, isn't it just that the list is a bit
> taller than the viewport and so it doesn't come back simply because it doesn't
> have to? If not can you tell me exactly what you do to repro?
>
> I'm still getting that sometimes, but need to find steps to repro.
Confirming this. Flicking the Home scope upwards makes it end up a bit off in most of the cases here. Starting to drag the next time makes the title jump into the correct position.
Michael Zanetti (mzanetti) wrote : | # |
Here's a screenshot showing the white arrow on white background: http://
Michael Zanetti (mzanetti) wrote : | # |
> Confirming this. Flicking the Home scope upwards makes it end up a bit off in
> most of the cases here. Starting to drag the next time makes the title jump
> into the correct position.
Same in trunk. So ignore this for this review
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:484
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
I really like this branch. Does a lot of good restructuring. Some things you might want to fix:
=====
20 + property alias childItem: itemContainer.
61 + property bool narrowMode: {
62 + if (root.childItem
63 + return false;
64 + if (root.childItem
65 + console.log("ERROR: PageHeader childItem must be a single item");
66 + return false;
67 + }
68 + var item = root.childItem[0];
69 + return parent.width < item.implicitWidth + units.gu(50)
70 + }
I think it would be more future proof and readable if the check for length == 1 is in the childItem assignment already instead of all the places where childItem is going to be used (admittedly its only one so far).
=====
445 + /* FIXME: workaround rendering issue due to use of ShaderEffectSource in
446 + UbuntuShape. While switching from the home scope to the People scope the
447 + rendering would block midway.
Maybe a chance to update this one. We don't have a people scope any more but I think this is still valid with all the scopes.
=====
858 \ No newline at end of file
=====
I think we could use a test that switches to another scope using the TabBar, given that those tests were dropped with the DashBar.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:485
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:486
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:487
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:488
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:513
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
ABORTED: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:513
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:514
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:515
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:515
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:516
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Francis Ginther (fginther) wrote : | # |
Otto trusty environment needed to be updated. A test run after the update passed, so re-building.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:516
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:516
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) wrote : | # |
Failing tests:
qmltestrunn
qmltestrunn
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:518
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:520
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:521
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:522
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:522
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:523
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:524
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:525
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:526
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Silly me, i thought the needed sdk stuff was in but it is not ^_^
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:527
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:528
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:528
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Yay, the SDK work has been finally merged and this can get some review. If someone needs work for Monday/Tuesday, this is available :-)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:529
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:530
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
1258 \ No newline at end of file
====
Isn't it a bit messy how the PageHeader is set to the GenericScopeView? It seems that you have a property pageHeader in GenericScopeView where you set the PageHeader in DashContent to. But then you do only half the stuff on that while still emitting signals to position and resize the header. Can't we set everything inside GenericScopeView?
====
are the console.log()s in the tests being left intentionally?
Albert Astals Cid (aacid) wrote : | # |
> 1258 \ No newline at end of file
Done
Albert Astals Cid (aacid) wrote : | # |
> are the console.log()s in the tests being left intentionally?
Nope
Albert Astals Cid (aacid) wrote : | # |
> Isn't it a bit messy how the PageHeader is set to the GenericScopeView? It
> seems that you have a property pageHeader in GenericScopeView where you set
> the PageHeader in DashContent to. But then you do only half the stuff on that
> while still emitting signals to position and resize the header. Can't we set
> everything inside GenericScopeView?
Nope, as explained in the commit message: "The header of the LVWPH of GenericScopeView is now fake and only used for positioning. There is a single global floating header in DashContent (which is a PageHeader with a TabBar as childItem)"
i.e. since there is now only one PageHeader (a single tabbar) it can't be done inside GenericScopeView since there's multiple of them.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:531
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:534
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:536
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'plugins/Utils/qsortfilterproxymodelqml.cpp' |
2 | --- plugins/Utils/qsortfilterproxymodelqml.cpp 2013-09-09 10:14:26 +0000 |
3 | +++ plugins/Utils/qsortfilterproxymodelqml.cpp 2014-01-07 17:09:31 +0000 |
4 | @@ -68,6 +68,18 @@ |
5 | } |
6 | } |
7 | |
8 | +QVariantMap |
9 | +QSortFilterProxyModelQML::get(int row) |
10 | +{ |
11 | + QVariantMap res; |
12 | + const QHash<int, QByteArray> roles = roleNames(); |
13 | + auto it = roles.begin(); |
14 | + for ( ; it != roles.end(); ++it) { |
15 | + res[*it] = data(row, it.key()); |
16 | + } |
17 | + return res; |
18 | +} |
19 | + |
20 | QVariant |
21 | QSortFilterProxyModelQML::data(int row, int role) |
22 | { |
23 | |
24 | === modified file 'plugins/Utils/qsortfilterproxymodelqml.h' |
25 | --- plugins/Utils/qsortfilterproxymodelqml.h 2013-09-09 10:14:26 +0000 |
26 | +++ plugins/Utils/qsortfilterproxymodelqml.h 2014-01-07 17:09:31 +0000 |
27 | @@ -31,6 +31,7 @@ |
28 | public: |
29 | explicit QSortFilterProxyModelQML(QObject *parent = 0); |
30 | |
31 | + Q_INVOKABLE QVariantMap get(int row); // Use with caution, it can be slow to query all the roles |
32 | Q_INVOKABLE QVariant data(int row, int role); |
33 | Q_INVOKABLE int count(); |
34 | Q_INVOKABLE int findFirst(int role, const QVariant& value) const; |
35 | |
36 | === modified file 'qml/Components/PageHeader.qml' |
37 | --- qml/Components/PageHeader.qml 2013-12-02 17:43:09 +0000 |
38 | +++ qml/Components/PageHeader.qml 2014-01-07 17:09:31 +0000 |
39 | @@ -21,17 +21,12 @@ |
40 | import Unity 0.1 |
41 | |
42 | Item { |
43 | - /*! |
44 | - \preliminary |
45 | - The text that is shown inside the Page Header |
46 | - \qmlproperty string text |
47 | - */ |
48 | - property alias text: label.text |
49 | - |
50 | + id: root |
51 | property bool searchEntryEnabled: false |
52 | property alias searchQuery: searchField.text |
53 | property ListModel searchHistory |
54 | property Scope scope |
55 | + property alias childItem: itemContainer.children |
56 | |
57 | height: units.gu(8.5) |
58 | implicitHeight: units.gu(8.5) |
59 | @@ -82,29 +77,10 @@ |
60 | height: childrenRect.height |
61 | |
62 | Item { |
63 | - id: textContainer |
64 | + id: itemContainer |
65 | |
66 | - width: header.width |
67 | + width: searchContainer.narrowMode ? header.width : header.width - searchContainer.width |
68 | height: header.height |
69 | - |
70 | - Label { |
71 | - id: label |
72 | - anchors { |
73 | - left: parent.left |
74 | - leftMargin: units.gu(2) |
75 | - right: parent.right |
76 | - verticalCenter: parent.verticalCenter |
77 | - } |
78 | - |
79 | - color: Theme.palette.selected.backgroundText |
80 | - opacity: 0.8 |
81 | - font.family: "Ubuntu" |
82 | - font.weight: Font.Light |
83 | - fontSize: "x-large" |
84 | - elide: Text.ElideRight |
85 | - style: Text.Raised |
86 | - styleColor: "black" |
87 | - } |
88 | } |
89 | |
90 | Item { |
91 | @@ -115,12 +91,12 @@ |
92 | property bool popoverShouldOpen: false |
93 | property bool popoverShouldClose: false |
94 | |
95 | - property bool narrowMode: parent.width < label.contentWidth + units.gu(50) |
96 | + property bool narrowMode: parent.width < units.gu(80) |
97 | |
98 | property bool active: searchField.text != "" || searchField.activeFocus |
99 | property var popover: null |
100 | |
101 | - anchors.right: textContainer.right |
102 | + anchors.right: headerContainer.right |
103 | height: header.height |
104 | |
105 | state: |
106 | @@ -255,13 +231,13 @@ |
107 | states: [ |
108 | State { |
109 | name: "wide" |
110 | - AnchorChanges { target: textContainer; anchors.top: headerContainer.top } |
111 | - AnchorChanges { target: searchContainer; anchors.left: undefined; anchors.top: textContainer.top } |
112 | + AnchorChanges { target: itemContainer; anchors.top: headerContainer.top } |
113 | + AnchorChanges { target: searchContainer; anchors.left: undefined; anchors.top: itemContainer.top } |
114 | }, |
115 | State { |
116 | name: "narrow" |
117 | PropertyChanges { target: searchField; highlighted: true } |
118 | - AnchorChanges { target: textContainer; anchors.top: searchContainer.bottom } |
119 | + AnchorChanges { target: itemContainer; anchors.top: searchContainer.bottom } |
120 | AnchorChanges { target: searchContainer; anchors.left: headerContainer.left; anchors.top: headerContainer.top } |
121 | }, |
122 | State { |
123 | @@ -299,7 +275,7 @@ |
124 | ParallelAnimation { |
125 | NumberAnimation { targets: [searchContainer, searchField]; property: "width"; duration: 200; easing.type: Easing.InOutQuad } |
126 | PropertyAction { target: primaryImage; property: "source" } |
127 | - AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad } |
128 | + AnchorAnimation { targets: [searchContainer, itemContainer]; duration: 200; easing.type: Easing.InOutQuad } |
129 | } |
130 | ScriptAction { script: if (searchContainer.popoverShouldOpen) { searchContainer.openPopover(); } } |
131 | } |
132 | @@ -308,14 +284,14 @@ |
133 | to: "inactive" |
134 | ScriptAction { script: if (searchContainer.popoverShouldClose) { searchContainer.closePopover(); } } |
135 | NumberAnimation { targets: [searchContainer, searchField] ; property: "width"; duration: 200; easing.type: Easing.InOutQuad } |
136 | - AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad } |
137 | + AnchorAnimation { targets: [searchContainer, itemContainer]; duration: 200; easing.type: Easing.InOutQuad } |
138 | }, |
139 | Transition { |
140 | to: "narrowActive" |
141 | SequentialAnimation { |
142 | ParallelAnimation { |
143 | NumberAnimation { targets: [searchContainer, searchField] ; property: "width"; duration: 200; easing.type: Easing.OutQuad } |
144 | - AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad } |
145 | + AnchorAnimation { targets: [searchContainer, itemContainer]; duration: 200; easing.type: Easing.InOutQuad } |
146 | } |
147 | ScriptAction { script: if (searchContainer.popoverShouldOpen) { searchContainer.openPopover(); } } |
148 | } |
149 | @@ -324,7 +300,7 @@ |
150 | to: "narrowInactive" |
151 | ScriptAction { script: if (searchContainer.popoverShouldClose) { searchContainer.closePopover(); } } |
152 | NumberAnimation { targets: [searchContainer, searchField] ; property: "width"; duration: 200; easing.type: Easing.OutQuad } |
153 | - AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad } |
154 | + AnchorAnimation { targets: [searchContainer, itemContainer]; duration: 200; easing.type: Easing.InOutQuad } |
155 | } |
156 | ] |
157 | |
158 | |
159 | === added file 'qml/Components/PageHeaderLabel.qml' |
160 | --- qml/Components/PageHeaderLabel.qml 1970-01-01 00:00:00 +0000 |
161 | +++ qml/Components/PageHeaderLabel.qml 2014-01-07 17:09:31 +0000 |
162 | @@ -0,0 +1,41 @@ |
163 | +/* |
164 | + * Copyright (C) 2013 Canonical, Ltd. |
165 | + * |
166 | + * This program is free software; you can redistribute it and/or modify |
167 | + * it under the terms of the GNU General Public License as published by |
168 | + * the Free Software Foundation; version 3. |
169 | + * |
170 | + * This program is distributed in the hope that it will be useful, |
171 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
172 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
173 | + * GNU General Public License for more details. |
174 | + * |
175 | + * You should have received a copy of the GNU General Public License |
176 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
177 | + */ |
178 | + |
179 | +import QtQuick 2.0 |
180 | +import Ubuntu.Components 0.1 |
181 | + |
182 | +PageHeader { |
183 | + property alias text: label.text |
184 | + |
185 | + childItem: Label { |
186 | + id: label |
187 | + anchors { |
188 | + left: parent.left |
189 | + leftMargin: units.gu(2) |
190 | + right: parent.right |
191 | + verticalCenter: parent.verticalCenter |
192 | + } |
193 | + |
194 | + color: Theme.palette.selected.backgroundText |
195 | + opacity: 0.8 |
196 | + font.family: "Ubuntu" |
197 | + font.weight: Font.Light |
198 | + fontSize: "x-large" |
199 | + elide: Text.ElideRight |
200 | + style: Text.Raised |
201 | + styleColor: "black" |
202 | + } |
203 | +} |
204 | |
205 | === modified file 'qml/Dash/Dash.qml' |
206 | --- qml/Dash/Dash.qml 2013-11-19 14:33:40 +0000 |
207 | +++ qml/Dash/Dash.qml 2014-01-07 17:09:31 +0000 |
208 | @@ -66,11 +66,6 @@ |
209 | model: filteredScopes |
210 | scopes: scopes |
211 | searchHistory: dash.searchHistory |
212 | - onMovementStarted: dashbar.startNavigation() |
213 | - onMovementEnded: dashbar.stopNavigation() |
214 | - onContentFlickStarted: dashbar.finishNavigation() |
215 | - onContentEndReached: dashbar.finishNavigation() |
216 | - onPreviewShown: dashbar.finishNavigation() |
217 | onScopeLoaded: { |
218 | if (scopeId == dash.showScopeOnLoaded) { |
219 | dash.setCurrentScope(scopeId, false, false) |
220 | @@ -80,17 +75,4 @@ |
221 | scale: dash.contentScale |
222 | clip: scale != 1.0 |
223 | } |
224 | - |
225 | - DashBar { |
226 | - id: dashbar |
227 | - objectName: "dashbar" |
228 | - anchors.bottom: parent.bottom |
229 | - anchors.left: parent.left |
230 | - anchors.right: parent.right |
231 | - model: filteredScopes |
232 | - currentIndex: dashContent.currentIndex |
233 | - onItemSelected: dashContent.setCurrentScopeAtIndex(index, true, false) |
234 | - opacity: dash.contentScale == 1.0 ? 1.0 : 0.0 |
235 | - Behavior on opacity { NumberAnimation { easing.type: Easing.OutQuad; duration: 150 } } |
236 | - } |
237 | } |
238 | |
239 | === modified file 'qml/Dash/DashApps.qml' |
240 | --- qml/Dash/DashApps.qml 2013-11-30 11:40:30 +0000 |
241 | +++ qml/Dash/DashApps.qml 2014-01-07 17:09:31 +0000 |
242 | @@ -29,9 +29,6 @@ |
243 | property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications |
244 | property var sideStageApplicationModel: shell.applicationManager.sideStageApplications |
245 | |
246 | - //FIXME an alias to itself shouldn't be required. More than likely a Qt bug. Try removing with newer Qt. |
247 | - property alias searchHistory: scopeView.searchHistory |
248 | - |
249 | ListModel { |
250 | id: dummyVisibilityModifier |
251 | |
252 | |
253 | === removed file 'qml/Dash/DashBar.qml' |
254 | --- qml/Dash/DashBar.qml 2013-10-21 14:53:26 +0000 |
255 | +++ qml/Dash/DashBar.qml 1970-01-01 00:00:00 +0000 |
256 | @@ -1,128 +0,0 @@ |
257 | -/* |
258 | - * Copyright (C) 2013 Canonical, Ltd. |
259 | - * |
260 | - * This program is free software; you can redistribute it and/or modify |
261 | - * it under the terms of the GNU General Public License as published by |
262 | - * the Free Software Foundation; version 3. |
263 | - * |
264 | - * This program is distributed in the hope that it will be useful, |
265 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
266 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
267 | - * GNU General Public License for more details. |
268 | - * |
269 | - * You should have received a copy of the GNU General Public License |
270 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
271 | - */ |
272 | - |
273 | -import QtQuick 2.0 |
274 | -import Ubuntu.Components 0.1 |
275 | -import Unity 0.1 |
276 | - |
277 | -Item { |
278 | - id: dashBar |
279 | - |
280 | - property var model |
281 | - property alias currentIndex: row.currentIndex |
282 | - |
283 | - property int lineHeight: units.dp(2) |
284 | - property int itemSize: units.gu(7) |
285 | - property int iconSize: units.gu(3.5) |
286 | - |
287 | - signal itemSelected(int index) |
288 | - |
289 | - width: units.gu(40) |
290 | - height: units.gu(6) |
291 | - |
292 | - function startNavigation() { |
293 | - timeout.stop() |
294 | - panel.open() |
295 | - } |
296 | - |
297 | - function stopNavigation() { |
298 | - timeout.restart() |
299 | - } |
300 | - |
301 | - function finishNavigation() { |
302 | - panel.close() |
303 | - } |
304 | - |
305 | - Timer { |
306 | - id: timeout |
307 | - interval: 1500 |
308 | - running: false |
309 | - repeat: false |
310 | - onTriggered: finishNavigation() |
311 | - } |
312 | - |
313 | - Panel { |
314 | - id: panel |
315 | - objectName: "panel" |
316 | - anchors.fill: parent |
317 | - |
318 | - locked: true // TODO: remove this when lp bug #1179569 will be fixed |
319 | - |
320 | - Rectangle { |
321 | - color: "black" |
322 | - anchors.fill: parent |
323 | - |
324 | - ListView { |
325 | - id: row |
326 | - objectName: "row" |
327 | - model: dashBar.model |
328 | - orientation: ListView.Horizontal |
329 | - width: Math.min(Math.max(dashBar.width/2, units.gu(40)), count * itemSize) |
330 | - height: parent.height |
331 | - anchors.horizontalCenter: parent.horizontalCenter |
332 | - onMovingChanged: if (moving) { timeout.stop() } else { timeout.restart() } |
333 | - interactive: visibleArea.widthRatio < 1 && panel.opened |
334 | - highlightFollowsCurrentItem: false |
335 | - |
336 | - onCurrentItemChanged: { |
337 | - highlightLine.width = currentItem.width |
338 | - highlightLine.x = x + currentItem.x |
339 | - } |
340 | - |
341 | - delegate: |
342 | - // FIXME: Use Panel's integrated trigger() once that works again. |
343 | - MouseArea { |
344 | - width: itemSize |
345 | - height: dashBar.height |
346 | - anchors.top: parent.top |
347 | - |
348 | - onClicked: { |
349 | - dashBar.itemSelected(index) |
350 | - timeout.restart() |
351 | - } |
352 | - |
353 | - Image { |
354 | - anchors.centerIn: parent |
355 | - source: scope.iconHint |
356 | - sourceSize { width: iconSize; height: iconSize } |
357 | - // opacity: index == currentIndex ? 1 : 1 // same opacity for now |
358 | - } |
359 | - } |
360 | - } |
361 | - } |
362 | - } |
363 | - |
364 | - Rectangle { |
365 | - anchors { |
366 | - left: parent.left |
367 | - right: parent.right |
368 | - bottom: parent.bottom |
369 | - } |
370 | - height: dashBar.lineHeight |
371 | - color: "black" |
372 | - |
373 | - Rectangle { |
374 | - id: highlightLine |
375 | - color: Theme.palette.selected.foreground |
376 | - height: parent.height |
377 | - anchors.bottom: parent.bottom |
378 | - z: 1 |
379 | - |
380 | - Behavior on x {NumberAnimation { duration: 150; easing.type: Easing.OutCubic}} |
381 | - Behavior on width {NumberAnimation { duration: 150; easing.type: Easing.OutCubic}} |
382 | - } |
383 | - } |
384 | -} |
385 | |
386 | === modified file 'qml/Dash/DashContent.qml' |
387 | --- qml/Dash/DashContent.qml 2013-11-28 10:53:18 +0000 |
388 | +++ qml/Dash/DashContent.qml 2014-01-07 17:09:31 +0000 |
389 | @@ -17,6 +17,7 @@ |
390 | import QtQuick 2.0 |
391 | import Ubuntu.Components 0.1 |
392 | import Unity 0.1 |
393 | +import "../Components" |
394 | |
395 | Item { |
396 | id: dashContent |
397 | @@ -33,7 +34,6 @@ |
398 | signal movementEnded() |
399 | signal contentFlickStarted() |
400 | signal contentEndReached() |
401 | - signal previewShown() |
402 | signal scopeLoaded(string scopeId) |
403 | signal positionedAtBeginning() |
404 | |
405 | @@ -80,77 +80,138 @@ |
406 | } |
407 | } |
408 | |
409 | - ListView { |
410 | - id: dashContentList |
411 | - objectName: "dashContentList" |
412 | - |
413 | - interactive: dashContent.scopes.loaded && !currentItem.previewShown && !currentItem.moving |
414 | - |
415 | - anchors.fill: parent |
416 | - model: dashContent.model |
417 | - orientation: ListView.Horizontal |
418 | - boundsBehavior: Flickable.DragAndOvershootBounds |
419 | - flickDeceleration: units.gu(625) |
420 | - maximumFlickVelocity: width * 5 |
421 | - snapMode: ListView.SnapOneItem |
422 | - highlightMoveDuration: 250 |
423 | - highlightRangeMode: ListView.StrictlyEnforceRange |
424 | - /* FIXME: workaround rendering issue due to use of ShaderEffectSource in |
425 | - UbuntuShape. While switching from the home scope to the People scope the |
426 | - rendering would block midway. |
427 | - */ |
428 | - cacheBuffer: 2147483647 |
429 | - onMovementStarted: dashContent.movementStarted() |
430 | - onMovementEnded: dashContent.movementEnded() |
431 | - |
432 | - // If the number of items is less than the current index, then need to reset to another item. |
433 | - onCountChanged: { |
434 | - if (count > 0) { |
435 | - if (currentIndex >= count) { |
436 | - dashContent.setCurrentScopeAtIndex(count-1, true, true) |
437 | - } else if (currentIndex < 0) { |
438 | - // setting currentIndex directly, cause we don't want to loose set_current_index |
439 | - dashContent.currentIndex = 0 |
440 | - } |
441 | - } |
442 | - } |
443 | - |
444 | - delegate: |
445 | - Loader { |
446 | - width: ListView.view.width |
447 | - height: ListView.view.height |
448 | - asynchronous: true |
449 | - source: scopeMapper.map(scope.id) |
450 | - objectName: scope.id + " loader" |
451 | - |
452 | - readonly property bool previewShown: item ? item.previewShown : false |
453 | - readonly property bool moving: item ? item.moving : false |
454 | - |
455 | - // these are needed for autopilot tests |
456 | - readonly property string scopeId: scope.id |
457 | - readonly property bool isCurrent: ListView.isCurrentItem |
458 | - readonly property bool isLoaded: status == Loader.Ready |
459 | - |
460 | - onLoaded: { |
461 | - item.scope = Qt.binding(function() { return scope }) |
462 | - item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem }) |
463 | - item.searchHistory = Qt.binding(function() { return dashContent.searchHistory }) |
464 | - dashContentList.movementStarted.connect(item.movementStarted) |
465 | - dashContent.positionedAtBeginning.connect(item.positionedAtBeginning) |
466 | - dashContent.scopeLoaded(item.scope.id) |
467 | - } |
468 | - Connections { |
469 | - target: item |
470 | - ignoreUnknownSignals: true |
471 | - onEndReached: contentEndReached() |
472 | - onPreviewShownChanged: { |
473 | - if (item.previewShown) { |
474 | - dashContent.previewShown() |
475 | - } |
476 | - } |
477 | - } |
478 | - |
479 | - Component.onDestruction: active = false |
480 | - } |
481 | + Item { |
482 | + id: dashContentListHolder |
483 | + anchors.fill: parent |
484 | + |
485 | + ListView { |
486 | + id: dashContentList |
487 | + objectName: "dashContentList" |
488 | + |
489 | + interactive: dashContent.scopes.loaded && !previewListView.onScreen && !currentItem.moving |
490 | + |
491 | + anchors.fill: parent |
492 | + model: dashContent.model |
493 | + orientation: ListView.Horizontal |
494 | + boundsBehavior: Flickable.DragAndOvershootBounds |
495 | + flickDeceleration: units.gu(625) |
496 | + maximumFlickVelocity: width * 5 |
497 | + snapMode: ListView.SnapOneItem |
498 | + highlightMoveDuration: 250 |
499 | + highlightRangeMode: ListView.StrictlyEnforceRange |
500 | + // TODO Investigate if we can switch to a smaller cache buffer when/if UbuntuShape gets more performant |
501 | + cacheBuffer: 1073741823 |
502 | + onMovementStarted: dashContent.movementStarted() |
503 | + onMovementEnded: dashContent.movementEnded() |
504 | + |
505 | + // If the number of items is less than the current index, then need to reset to another item. |
506 | + onCountChanged: { |
507 | + if (count > 0) { |
508 | + if (currentIndex >= count) { |
509 | + dashContent.setCurrentScopeAtIndex(count-1, true, true) |
510 | + } else if (currentIndex < 0) { |
511 | + // setting currentIndex directly, cause we don't want to loose set_current_index |
512 | + dashContent.currentIndex = 0 |
513 | + } |
514 | + } |
515 | + } |
516 | + |
517 | + delegate: |
518 | + Loader { |
519 | + width: ListView.view.width |
520 | + height: ListView.view.height |
521 | + asynchronous: true |
522 | + source: scopeMapper.map(scope.id) |
523 | + objectName: scope.id + " loader" |
524 | + |
525 | + readonly property bool moving: item ? item.moving : false |
526 | + readonly property var categoryView: item ? item.categoryView : null |
527 | + readonly property Scope theScope: scope |
528 | + |
529 | + // these are needed for autopilot tests |
530 | + readonly property string scopeId: scope.id |
531 | + readonly property bool isCurrent: ListView.isCurrentItem |
532 | + readonly property bool isLoaded: status == Loader.Ready |
533 | + |
534 | + onLoaded: { |
535 | + item.scope = Qt.binding(function() { return scope }) |
536 | + item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem }) |
537 | + item.tabBarHeight = pageHeader.implicitHeight; |
538 | + item.pageHeader = pageHeader; |
539 | + item.openEffect = openEffect; |
540 | + item.previewListView = previewListView; |
541 | + dashContentList.movementStarted.connect(item.movementStarted) |
542 | + dashContent.positionedAtBeginning.connect(item.positionedAtBeginning) |
543 | + dashContent.scopeLoaded(item.scope.id) |
544 | + } |
545 | + Connections { |
546 | + target: item |
547 | + ignoreUnknownSignals: true |
548 | + onEndReached: contentEndReached() |
549 | + } |
550 | + |
551 | + Component.onDestruction: active = false |
552 | + } |
553 | + } |
554 | + |
555 | + PageHeader { |
556 | + id: pageHeader |
557 | + width: parent.width |
558 | + searchEntryEnabled: true |
559 | + searchHistory: dashContent.searchHistory |
560 | + |
561 | + childItem: TabBar { |
562 | + id: tabBar |
563 | + objectName: "tabbar" |
564 | + height: units.gu(7) |
565 | + width: parent.width |
566 | + selectionMode: false |
567 | + style: DashContentTabBarStyle {} |
568 | + |
569 | + model: dashContentList.model |
570 | + |
571 | + onSelectedIndexChanged: { |
572 | + dashContentList.currentIndex = selectedIndex; |
573 | + } |
574 | + |
575 | + Connections { |
576 | + target: dashContentList |
577 | + onCurrentIndexChanged: { |
578 | + tabBar.selectedIndex = dashContentList.currentIndex |
579 | + } |
580 | + } |
581 | + |
582 | + Connections { |
583 | + target: model |
584 | + onCountChanged: { |
585 | + if (tabBar.selectedIndex < 0 && model.count > 0) |
586 | + tabBar.selectedIndex = 0; |
587 | + } |
588 | + } |
589 | + |
590 | + Component.onCompleted: { |
591 | + __styleInstance.headerTextStyle = Text.Raised |
592 | + __styleInstance.headerTextStyleColor = "black" |
593 | + } |
594 | + } |
595 | + } |
596 | + } |
597 | + |
598 | + DashContentOpenEffect { |
599 | + id: openEffect |
600 | + anchors { |
601 | + fill: parent |
602 | + bottomMargin: -bottomOverflow |
603 | + } |
604 | + sourceItem: dashContentListHolder |
605 | + previewListView: previewListView |
606 | + } |
607 | + |
608 | + PreviewListView { |
609 | + id: previewListView |
610 | + openEffect: openEffect |
611 | + categoryView: dashContentList.currentItem ? dashContentList.currentItem.categoryView : null |
612 | + scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null |
613 | + anchors.fill: parent |
614 | } |
615 | } |
616 | |
617 | === added file 'qml/Dash/DashContentOpenEffect.qml' |
618 | --- qml/Dash/DashContentOpenEffect.qml 1970-01-01 00:00:00 +0000 |
619 | +++ qml/Dash/DashContentOpenEffect.qml 2014-01-07 17:09:31 +0000 |
620 | @@ -0,0 +1,57 @@ |
621 | +/* |
622 | + * Copyright (C) 2013 Canonical, Ltd. |
623 | + * |
624 | + * This program is free software; you can redistribute it and/or modify |
625 | + * it under the terms of the GNU General Public License as published by |
626 | + * the Free Software Foundation; version 3. |
627 | + * |
628 | + * This program is distributed in the hope that it will be useful, |
629 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
630 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
631 | + * GNU General Public License for more details. |
632 | + * |
633 | + * You should have received a copy of the GNU General Public License |
634 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
635 | + */ |
636 | + |
637 | +import QtQuick 2.0 |
638 | +import Ubuntu.Components 0.1 |
639 | +import "../Components" |
640 | + |
641 | +OpenEffect { |
642 | + property PreviewListView previewListView: null |
643 | + |
644 | + objectName: "openEffect" |
645 | + anchors { |
646 | + fill: parent |
647 | + bottomMargin: -bottomOverflow |
648 | + } |
649 | + |
650 | + enabled: gap > 0.0 |
651 | + |
652 | + topGapPx: (1 - gap) * positionPx |
653 | + topOpacity: (1 - gap * 1.2) |
654 | + bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx) |
655 | + bottomOverflow: units.gu(20) |
656 | + live: !expansionAnimation.running |
657 | + |
658 | + property int targetBottomGapPx: height - units.gu(8) - bottomOverflow |
659 | + property real gap: previewListView.open ? 1.0 : 0.0 |
660 | + |
661 | + Behavior on gap { |
662 | + NumberAnimation { |
663 | + id: expansionAnimation |
664 | + duration: 200 |
665 | + easing.type: Easing.InOutQuad |
666 | + onRunningChanged: { |
667 | + if (!previewListView.open && !running) { |
668 | + previewListView.onScreen = false |
669 | + } |
670 | + } |
671 | + } |
672 | + } |
673 | + Behavior on positionPx { |
674 | + enabled: previewListView.open |
675 | + UbuntuNumberAnimation {} |
676 | + } |
677 | +} |
678 | |
679 | === added file 'qml/Dash/DashContentTabBarStyle.qml' |
680 | --- qml/Dash/DashContentTabBarStyle.qml 1970-01-01 00:00:00 +0000 |
681 | +++ qml/Dash/DashContentTabBarStyle.qml 2014-01-07 17:09:31 +0000 |
682 | @@ -0,0 +1,21 @@ |
683 | +/* |
684 | + * Copyright (C) 2013 Canonical, Ltd. |
685 | + * |
686 | + * This program is free software; you can redistribute it and/or modify |
687 | + * it under the terms of the GNU General Public License as published by |
688 | + * the Free Software Foundation; version 3. |
689 | + * |
690 | + * This program is distributed in the hope that it will be useful, |
691 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
692 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
693 | + * GNU General Public License for more details. |
694 | + * |
695 | + * You should have received a copy of the GNU General Public License |
696 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
697 | + */ |
698 | + |
699 | +import Ubuntu.Components.Themes.Ambiance 0.1 |
700 | + |
701 | +TabBarStyle { |
702 | + indicatorImageSource: "graphics/tabbarchevron.png" |
703 | +} |
704 | |
705 | === modified file 'qml/Dash/GenericScopeView.qml' |
706 | --- qml/Dash/GenericScopeView.qml 2013-12-05 10:45:25 +0000 |
707 | +++ qml/Dash/GenericScopeView.qml 2014-01-07 17:09:31 +0000 |
708 | @@ -27,15 +27,18 @@ |
709 | property Scope scope |
710 | property SortFilterProxyModel categories: categoryFilter |
711 | property bool isCurrent |
712 | - property ListModel searchHistory |
713 | property alias moving: categoryView.moving |
714 | + property int tabBarHeight: 0 |
715 | + property PageHeader pageHeader: null |
716 | + property OpenEffect openEffect: null |
717 | + property Item previewListView: null |
718 | |
719 | signal endReached |
720 | signal movementStarted |
721 | signal positionedAtBeginning |
722 | |
723 | - readonly property alias previewShown: previewListView.onScreen |
724 | property bool enableHeightBehaviorOnNextCreation: false |
725 | + property var categoryView: categoryView |
726 | |
727 | // FIXME delay the search so that daemons have time to settle, note that |
728 | // removing this will break ScopeView::test_changeScope |
729 | @@ -84,12 +87,14 @@ |
730 | target: scopeView.scope |
731 | property: "searchQuery" |
732 | value: pageHeader.searchQuery |
733 | + when: isCurrent |
734 | } |
735 | |
736 | Binding { |
737 | target: pageHeader |
738 | property: "searchQuery" |
739 | value: scopeView.scope.searchQuery |
740 | + when: isCurrent |
741 | } |
742 | |
743 | Connections { |
744 | @@ -119,6 +124,10 @@ |
745 | property string expandedCategoryId: "" |
746 | signal correctExpandedCategory(); |
747 | |
748 | + onContentYChanged: pageHeader.positionRealHeader(); |
749 | + onOriginYChanged: pageHeader.positionRealHeader(); |
750 | + onContentHeightChanged: pageHeader.positionRealHeader(); |
751 | + |
752 | Behavior on contentY { |
753 | enabled: previewListView.open |
754 | UbuntuNumberAnimation {} |
755 | @@ -176,7 +185,7 @@ |
756 | target: rendererLoader.item |
757 | onClicked: { |
758 | // Prepare the preview in case activate() triggers a preview only |
759 | - effect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight); |
760 | + openEffect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight); |
761 | previewListView.categoryId = categoryId |
762 | previewListView.categoryDelegate = rendererLoader.item |
763 | previewListView.model = target.model; |
764 | @@ -197,7 +206,7 @@ |
765 | } |
766 | } |
767 | onPressAndHold: { |
768 | - effect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight); |
769 | + openEffect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight); |
770 | previewListView.categoryId = categoryId |
771 | previewListView.categoryDelegate = rendererLoader.item |
772 | previewListView.model = target.model; |
773 | @@ -288,14 +297,20 @@ |
774 | categoryView.expandedCategoryId = ""; |
775 | } |
776 | } |
777 | - pageHeader: PageHeader { |
778 | - id: pageHeader |
779 | - objectName: "pageHeader" |
780 | - width: categoryView.width |
781 | - text: scopeView.scope.name |
782 | - searchEntryEnabled: true |
783 | - scope: scopeView.scope |
784 | - searchHistory: scopeView.searchHistory |
785 | + pageHeader: Item { |
786 | + implicitHeight: scopeView.tabBarHeight |
787 | + onHeightChanged: { |
788 | + if (scopeView.pageHeader) { |
789 | + scopeView.pageHeader.height = height; |
790 | + } |
791 | + } |
792 | + onYChanged: positionRealHeader(); |
793 | + |
794 | + function positionRealHeader() { |
795 | + if (scopeView.pageHeader) { |
796 | + scopeView.pageHeader.y = y + parent.y; |
797 | + } |
798 | + } |
799 | } |
800 | } |
801 | |
802 | @@ -346,44 +361,6 @@ |
803 | } |
804 | } |
805 | |
806 | - OpenEffect { |
807 | - id: effect |
808 | - objectName: "openEffect" |
809 | - anchors { |
810 | - fill: parent |
811 | - bottomMargin: -bottomOverflow |
812 | - } |
813 | - sourceItem: categoryView |
814 | - |
815 | - enabled: gap > 0.0 |
816 | - |
817 | - topGapPx: (1 - gap) * positionPx |
818 | - topOpacity: (1 - gap * 1.2) |
819 | - bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx) |
820 | - bottomOverflow: units.gu(20) |
821 | - live: !expansionAnimation.running |
822 | - |
823 | - property int targetBottomGapPx: height - units.gu(8) - bottomOverflow |
824 | - property real gap: previewListView.open ? 1.0 : 0.0 |
825 | - |
826 | - Behavior on gap { |
827 | - NumberAnimation { |
828 | - id: expansionAnimation |
829 | - duration: 200 |
830 | - easing.type: Easing.InOutQuad |
831 | - onRunningChanged: { |
832 | - if (!previewListView.open && !running) { |
833 | - previewListView.onScreen = false |
834 | - } |
835 | - } |
836 | - } |
837 | - } |
838 | - Behavior on positionPx { |
839 | - enabled: previewListView.open |
840 | - UbuntuNumberAnimation {} |
841 | - } |
842 | - } |
843 | - |
844 | Connections { |
845 | target: scopeView.scope |
846 | onPreviewReady: { |
847 | @@ -402,190 +379,13 @@ |
848 | } |
849 | } |
850 | |
851 | - PreviewDelegateMapper { |
852 | - id: previewDelegateMapper |
853 | - } |
854 | - |
855 | - ListView { |
856 | - id: previewListView |
857 | - objectName: "previewListView" |
858 | - height: effect.bottomGapPx - effect.topGapPx |
859 | - anchors { |
860 | - top: parent.top |
861 | - topMargin: effect.topGapPx |
862 | - left: parent.left |
863 | - right: parent.right |
864 | - } |
865 | - orientation: ListView.Horizontal |
866 | - highlightRangeMode: ListView.StrictlyEnforceRange |
867 | - snapMode: ListView.SnapOneItem |
868 | - boundsBehavior: Flickable.DragAndOvershootBounds |
869 | - highlightMoveDuration: 250 |
870 | - flickDeceleration: units.gu(625) |
871 | - maximumFlickVelocity: width * 5 |
872 | - cacheBuffer: 0 |
873 | - |
874 | - // To be set before opening the preview |
875 | - property string categoryId: "" |
876 | - property var categoryDelegate |
877 | - |
878 | - // because the ListView is built asynchronous, setting the |
879 | - // currentIndex directly won't work. We need to refresh it |
880 | - // when the first preview is ready to be displayed. |
881 | - property bool init: true |
882 | - |
883 | - onCurrentIndexChanged: { |
884 | - var row = Math.floor(currentIndex / categoryDelegate.columns); |
885 | - if (categoryDelegate.collapsedRowCount <= row) { |
886 | - categoryView.expandedCategoryId = categoryId |
887 | - } |
888 | - |
889 | - if (open) { |
890 | - categoryDelegate.highlightIndex = currentIndex |
891 | - } |
892 | - |
893 | - if (!init && model !== undefined) { |
894 | - var item = model.get(currentIndex) |
895 | - scopeView.scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata) |
896 | - } |
897 | - |
898 | - // Adjust contentY in case we need to change to it to show the next row |
899 | - if (categoryDelegate.rows > 1) { |
900 | - var itemY = categoryView.contentItem.mapFromItem(categoryDelegate.currentItem).y; |
901 | - |
902 | - // Find new contentY and effect.postionPx |
903 | - var newContentY = itemY - effect.positionPx - categoryDelegate.verticalSpacing; |
904 | - |
905 | - // Make sure the item is not covered by a header. Move the effect split down if necessary |
906 | - var headerHeight = pageHeader.height + categoryView.stickyHeaderHeight; |
907 | - var effectAdjust = Math.max(effect.positionPx, headerHeight); |
908 | - |
909 | - // Make sure we don't overscroll the listview. If yes, adjust effect position |
910 | - if (newContentY < 0) { |
911 | - effectAdjust += newContentY; |
912 | - newContentY = 0; |
913 | - } |
914 | - if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) { |
915 | - effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY |
916 | - newContentY = categoryView.contentHeight - categoryView.height; |
917 | - } |
918 | - |
919 | - effect.positionPx = effectAdjust; |
920 | - categoryView.contentY = newContentY; |
921 | - } |
922 | - } |
923 | - |
924 | - property bool open: false |
925 | - property bool onScreen: false |
926 | - |
927 | - onOpenChanged: { |
928 | - if (open) { |
929 | - onScreen = true; |
930 | - categoryDelegate.highlightIndex = currentIndex; |
931 | - pageHeader.unfocus(); |
932 | - } else { |
933 | - // Cancel any pending preview requests or actions |
934 | - if (previewListView.currentItem.previewData !== undefined) { |
935 | - previewListView.currentItem.previewData.cancelAction(); |
936 | - } |
937 | - scopeView.scope.cancelActivation(); |
938 | - model = undefined; |
939 | - categoryView.correctExpandedCategory(); |
940 | - categoryDelegate.highlightIndex = -1; |
941 | - } |
942 | - } |
943 | - |
944 | - Rectangle { |
945 | - anchors.fill: parent |
946 | - color: Qt.rgba(0, 0, 0, .3) |
947 | - z: -1 |
948 | - } |
949 | - |
950 | - delegate: Loader { |
951 | - id: previewLoader |
952 | - objectName: "previewLoader" + index |
953 | - height: previewListView.height |
954 | - width: previewListView.width |
955 | - asynchronous: true |
956 | - source: previewListView.onScreen ? |
957 | - (previewData !== undefined ? previewDelegateMapper.map(previewData.rendererName) : "DashPreviewPlaceholder.qml") : "" |
958 | - |
959 | - onPreviewDataChanged: { |
960 | - if (previewData !== undefined && source.toString().indexOf("DashPreviewPlaceholder.qml") != -1) { |
961 | - previewLoader.opacity = 0; |
962 | - } |
963 | - } |
964 | - |
965 | - onSourceChanged: { |
966 | - if (previewData !== undefined) { |
967 | - fadeIn.start() |
968 | - } |
969 | - } |
970 | - |
971 | - PropertyAnimation { |
972 | - id: fadeIn |
973 | - target: previewLoader |
974 | - property: "opacity" |
975 | - from: 0.0 |
976 | - to: 1.0 |
977 | - duration: UbuntuAnimation.BriskDuration |
978 | - } |
979 | - |
980 | - property var previewData |
981 | - property bool valid: item !== null |
982 | - |
983 | - onLoaded: { |
984 | - if (previewListView.onScreen && previewData !== undefined) { |
985 | - item.previewData = Qt.binding(function() { return previewData }) |
986 | - item.isCurrent = Qt.binding(function() { return ListView.isCurrentItem }) |
987 | - } |
988 | - } |
989 | - |
990 | - Connections { |
991 | - ignoreUnknownSignals: true |
992 | - target: item |
993 | - onClose: { |
994 | - previewListView.open = false |
995 | - } |
996 | - } |
997 | - |
998 | - function closePreviewSpinner() { |
999 | - if (item) { |
1000 | - item.showProcessingAction = false; |
1001 | - } |
1002 | - } |
1003 | - } |
1004 | - } |
1005 | - |
1006 | - Image { |
1007 | - objectName: "pointerArrow" |
1008 | - anchors { |
1009 | - top: previewListView.bottom |
1010 | - left: parent.left |
1011 | - leftMargin: previewListView.categoryDelegate !== undefined && previewListView.categoryDelegate.currentItem ? |
1012 | - previewListView.categoryDelegate.currentItem.center + (-width + margins) / 2 : 0 |
1013 | - |
1014 | - Behavior on leftMargin { |
1015 | - SmoothedAnimation { |
1016 | - duration: UbuntuAnimation.FastDuration |
1017 | - } |
1018 | - } |
1019 | - } |
1020 | - height: units.gu(1) |
1021 | - width: units.gu(2) |
1022 | - property int margins: previewListView.categoryDelegate ? previewListView.categoryDelegate.margins : 0 |
1023 | - opacity: previewListView.open ? .5 : 0 |
1024 | - |
1025 | - source: "graphics/tooltip_arrow.png" |
1026 | - } |
1027 | - |
1028 | // TODO: Move as InverseMouseArea to DashPreview |
1029 | MouseArea { |
1030 | objectName: "closePreviewMouseArea" |
1031 | enabled: previewListView.onScreen |
1032 | anchors { |
1033 | fill: parent |
1034 | - topMargin: effect.bottomGapPx |
1035 | + topMargin: openEffect.bottomGapPx |
1036 | } |
1037 | onClicked: { |
1038 | previewListView.open = false; |
1039 | |
1040 | === added file 'qml/Dash/PreviewListView.qml' |
1041 | --- qml/Dash/PreviewListView.qml 1970-01-01 00:00:00 +0000 |
1042 | +++ qml/Dash/PreviewListView.qml 2014-01-07 17:09:31 +0000 |
1043 | @@ -0,0 +1,212 @@ |
1044 | +/* |
1045 | + * Copyright (C) 2013 Canonical, Ltd. |
1046 | + * |
1047 | + * This program is free software; you can redistribute it and/or modify |
1048 | + * it under the terms of the GNU General Public License as published by |
1049 | + * the Free Software Foundation; version 3. |
1050 | + * |
1051 | + * This program is distributed in the hope that it will be useful, |
1052 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1053 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1054 | + * GNU General Public License for more details. |
1055 | + * |
1056 | + * You should have received a copy of the GNU General Public License |
1057 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1058 | + */ |
1059 | + |
1060 | +import QtQuick 2.0 |
1061 | +import Ubuntu.Components 0.1 |
1062 | +import Unity 0.1 |
1063 | +import "../Components" |
1064 | + |
1065 | +Item { |
1066 | + property OpenEffect openEffect: null |
1067 | + property ScopeListView categoryView: null |
1068 | + property Scope scope: null |
1069 | + |
1070 | + property alias open: previewListView.open |
1071 | + property alias onScreen: previewListView.onScreen |
1072 | + property alias categoryId: previewListView.categoryId |
1073 | + property alias categoryDelegate: previewListView.categoryDelegate |
1074 | + property alias init: previewListView.init |
1075 | + property alias model: previewListView.model |
1076 | + property alias currentIndex: previewListView.currentIndex |
1077 | + property alias currentItem: previewListView.currentItem |
1078 | + |
1079 | + Image { |
1080 | + objectName: "pointerArrow" |
1081 | + anchors { |
1082 | + top: previewListView.bottom |
1083 | + left: parent.left |
1084 | + leftMargin: previewListView.categoryDelegate !== undefined && previewListView.categoryDelegate.currentItem ? |
1085 | + previewListView.categoryDelegate.currentItem.center + (-width + margins) / 2 : 0 |
1086 | + |
1087 | + Behavior on leftMargin { |
1088 | + SmoothedAnimation { |
1089 | + duration: UbuntuAnimation.FastDuration |
1090 | + } |
1091 | + } |
1092 | + } |
1093 | + height: units.gu(1) |
1094 | + width: units.gu(2) |
1095 | + property int margins: previewListView.categoryDelegate ? previewListView.categoryDelegate.margins : 0 |
1096 | + opacity: previewListView.open ? .5 : 0 |
1097 | + |
1098 | + source: "graphics/tooltip_arrow.png" |
1099 | + } |
1100 | + |
1101 | + ListView { |
1102 | + id: previewListView |
1103 | + objectName: "previewListView" |
1104 | + height: openEffect.bottomGapPx - openEffect.topGapPx |
1105 | + anchors { |
1106 | + top: parent.top |
1107 | + topMargin: openEffect.topGapPx |
1108 | + left: parent.left |
1109 | + right: parent.right |
1110 | + } |
1111 | + orientation: ListView.Horizontal |
1112 | + highlightRangeMode: ListView.StrictlyEnforceRange |
1113 | + snapMode: ListView.SnapOneItem |
1114 | + boundsBehavior: Flickable.DragAndOvershootBounds |
1115 | + highlightMoveDuration: 250 |
1116 | + flickDeceleration: units.gu(625) |
1117 | + maximumFlickVelocity: width * 5 |
1118 | + cacheBuffer: 0 |
1119 | + |
1120 | + // To be set before opening the preview |
1121 | + property string categoryId: "" |
1122 | + property var categoryDelegate |
1123 | + |
1124 | + // because the ListView is built asynchronous, setting the |
1125 | + // currentIndex directly won't work. We need to refresh it |
1126 | + // when the first preview is ready to be displayed. |
1127 | + property bool init: true |
1128 | + |
1129 | + PreviewDelegateMapper { |
1130 | + id: previewDelegateMapper |
1131 | + } |
1132 | + |
1133 | + onCurrentIndexChanged: { |
1134 | + var row = Math.floor(currentIndex / categoryDelegate.columns); |
1135 | + if (categoryDelegate.collapsedRowCount <= row) { |
1136 | + categoryView.expandedCategoryId = categoryId |
1137 | + } |
1138 | + |
1139 | + if (open) { |
1140 | + categoryDelegate.highlightIndex = currentIndex |
1141 | + } |
1142 | + |
1143 | + if (!init && model !== undefined) { |
1144 | + var item = model.get(currentIndex) |
1145 | + scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata) |
1146 | + } |
1147 | + |
1148 | + // Adjust contentY in case we need to change to it to show the next row |
1149 | + if (categoryDelegate.rows > 1) { |
1150 | + var itemY = categoryView.contentItem.mapFromItem(categoryDelegate.currentItem).y; |
1151 | + |
1152 | + // Find new contentY and effect.postionPx |
1153 | + var newContentY = itemY - openEffect.positionPx - categoryDelegate.verticalSpacing; |
1154 | + |
1155 | + // Make sure the item is not covered by a header. Move the effect split down if necessary |
1156 | + var headerHeight = pageHeader.height + categoryView.stickyHeaderHeight; |
1157 | + var effectAdjust = Math.max(openEffect.positionPx, headerHeight); |
1158 | + |
1159 | + // Make sure we don't overscroll the listview. If yes, adjust effect position |
1160 | + if (newContentY < 0) { |
1161 | + effectAdjust += newContentY; |
1162 | + newContentY = 0; |
1163 | + } |
1164 | + if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) { |
1165 | + effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY |
1166 | + newContentY = categoryView.contentHeight - categoryView.height; |
1167 | + } |
1168 | + |
1169 | + openEffect.positionPx = effectAdjust; |
1170 | + categoryView.contentY = newContentY; |
1171 | + } |
1172 | + } |
1173 | + |
1174 | + property bool open: false |
1175 | + property bool onScreen: false |
1176 | + |
1177 | + onOpenChanged: { |
1178 | + if (open) { |
1179 | + onScreen = true; |
1180 | + categoryDelegate.highlightIndex = currentIndex; |
1181 | + pageHeader.unfocus(); |
1182 | + } else { |
1183 | + // Cancel any pending preview requests or actions |
1184 | + if (previewListView.currentItem.previewData !== undefined) { |
1185 | + previewListView.currentItem.previewData.cancelAction(); |
1186 | + } |
1187 | + scope.cancelActivation(); |
1188 | + model = undefined; |
1189 | + categoryView.correctExpandedCategory(); |
1190 | + categoryDelegate.highlightIndex = -1; |
1191 | + } |
1192 | + } |
1193 | + |
1194 | + Rectangle { |
1195 | + anchors.fill: parent |
1196 | + color: Qt.rgba(0, 0, 0, .3) |
1197 | + z: -1 |
1198 | + } |
1199 | + |
1200 | + delegate: Loader { |
1201 | + id: previewLoader |
1202 | + objectName: "previewLoader" + index |
1203 | + height: previewListView.height |
1204 | + width: previewListView.width |
1205 | + asynchronous: true |
1206 | + source: previewListView.onScreen ? |
1207 | + (previewData !== undefined ? previewDelegateMapper.map(previewData.rendererName) : "DashPreviewPlaceholder.qml") : "" |
1208 | + |
1209 | + onPreviewDataChanged: { |
1210 | + if (previewData !== undefined && source.toString().indexOf("DashPreviewPlaceholder.qml") != -1) { |
1211 | + previewLoader.opacity = 0; |
1212 | + } |
1213 | + } |
1214 | + |
1215 | + onSourceChanged: { |
1216 | + if (previewData !== undefined) { |
1217 | + fadeIn.start() |
1218 | + } |
1219 | + } |
1220 | + |
1221 | + PropertyAnimation { |
1222 | + id: fadeIn |
1223 | + target: previewLoader |
1224 | + property: "opacity" |
1225 | + from: 0.0 |
1226 | + to: 1.0 |
1227 | + duration: UbuntuAnimation.BriskDuration |
1228 | + } |
1229 | + |
1230 | + property var previewData |
1231 | + property bool valid: item !== null |
1232 | + |
1233 | + onLoaded: { |
1234 | + if (previewListView.onScreen && previewData !== undefined) { |
1235 | + item.previewData = Qt.binding(function() { return previewData }) |
1236 | + item.isCurrent = Qt.binding(function() { return ListView.isCurrentItem }) |
1237 | + } |
1238 | + } |
1239 | + |
1240 | + Connections { |
1241 | + ignoreUnknownSignals: true |
1242 | + target: item |
1243 | + onClose: { |
1244 | + previewListView.open = false |
1245 | + } |
1246 | + } |
1247 | + |
1248 | + function closePreviewSpinner() { |
1249 | + if (item) { |
1250 | + item.showProcessingAction = false; |
1251 | + } |
1252 | + } |
1253 | + } |
1254 | + } |
1255 | +} |
1256 | |
1257 | === added file 'qml/Dash/graphics/tabbarchevron@27.png' |
1258 | Binary files qml/Dash/graphics/tabbarchevron@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/tabbarchevron@27.png 2014-01-07 17:09:31 +0000 differ |
1259 | === modified file 'qml/Hud/HudParametrizedActionsPage.qml' |
1260 | --- qml/Hud/HudParametrizedActionsPage.qml 2013-06-05 22:03:08 +0000 |
1261 | +++ qml/Hud/HudParametrizedActionsPage.qml 2014-01-07 17:09:31 +0000 |
1262 | @@ -89,7 +89,7 @@ |
1263 | anchors.left: parent.left |
1264 | anchors.right: parent.right |
1265 | |
1266 | - PageHeader { |
1267 | + PageHeaderLabel { |
1268 | id: header |
1269 | anchors.top: parent.top |
1270 | anchors.left: parent.left |
1271 | |
1272 | === modified file 'tests/mocks/Unity/fake_scopes.cpp' |
1273 | --- tests/mocks/Unity/fake_scopes.cpp 2013-09-02 20:34:05 +0000 |
1274 | +++ tests/mocks/Unity/fake_scopes.cpp 2014-01-07 17:09:31 +0000 |
1275 | @@ -35,6 +35,7 @@ |
1276 | m_roles[Scopes::RoleScope] = "scope"; |
1277 | m_roles[Scopes::RoleId] = "id"; |
1278 | m_roles[Scopes::RoleVisible] = "visible"; |
1279 | + m_roles[Scopes::RoleTitle] = "title"; |
1280 | |
1281 | QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); |
1282 | QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); |
1283 | @@ -110,6 +111,8 @@ |
1284 | return QVariant::fromValue(scope->id()); |
1285 | } else if (role == Scopes::RoleVisible) { |
1286 | return QVariant::fromValue(scope->visible()); |
1287 | + } else if (role == Scopes::RoleTitle) { |
1288 | + return QVariant::fromValue(scope->name()); |
1289 | } else { |
1290 | return QVariant(); |
1291 | } |
1292 | |
1293 | === modified file 'tests/mocks/Unity/fake_scopes.h' |
1294 | --- tests/mocks/Unity/fake_scopes.h 2013-06-12 15:03:07 +0000 |
1295 | +++ tests/mocks/Unity/fake_scopes.h 2014-01-07 17:09:31 +0000 |
1296 | @@ -41,7 +41,8 @@ |
1297 | enum Roles { |
1298 | RoleScope, |
1299 | RoleId, |
1300 | - RoleVisible |
1301 | + RoleVisible, |
1302 | + RoleTitle |
1303 | }; |
1304 | |
1305 | Q_INVOKABLE int rowCount(const QModelIndex& parent = QModelIndex()) const; |
1306 | |
1307 | === modified file 'tests/qmltests/CMakeLists.txt' |
1308 | --- tests/qmltests/CMakeLists.txt 2013-11-30 11:40:30 +0000 |
1309 | +++ tests/qmltests/CMakeLists.txt 2014-01-07 17:09:31 +0000 |
1310 | @@ -37,9 +37,8 @@ |
1311 | ${CMAKE_BINARY_DIR}/tests/mocks |
1312 | ${CMAKE_BINARY_DIR}/plugins) |
1313 | add_qml_test(Components Tile) |
1314 | -add_qml_test(Components PageHeader) |
1315 | +add_qml_test(Components PageHeaderLabel) |
1316 | add_qml_test(Dash Dash IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
1317 | -add_qml_test(Dash DashBar IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_CURRENT_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
1318 | add_qml_test(Dash DashContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
1319 | add_qml_test(Dash DashPreview) |
1320 | add_qml_test(Dash GenericPreview) |
1321 | |
1322 | === renamed file 'tests/qmltests/Components/tst_PageHeader.qml' => 'tests/qmltests/Components/tst_PageHeaderLabel.qml' |
1323 | --- tests/qmltests/Components/tst_PageHeader.qml 2013-12-17 16:04:47 +0000 |
1324 | +++ tests/qmltests/Components/tst_PageHeaderLabel.qml 2014-01-07 17:09:31 +0000 |
1325 | @@ -31,7 +31,7 @@ |
1326 | } |
1327 | |
1328 | UT.UnityTestCase { |
1329 | - name: "PageHeaderTest" |
1330 | + name: "PageHeaderLabelTest" |
1331 | when: windowShown |
1332 | |
1333 | property alias searchEnabled : pageHeader.searchEntryEnabled |
1334 | @@ -204,7 +204,7 @@ |
1335 | anchors.fill: parent |
1336 | spacing: units.gu(1) |
1337 | |
1338 | - PageHeader { |
1339 | + PageHeaderLabel { |
1340 | id: pageHeader |
1341 | anchors { |
1342 | left: parent.left |
1343 | |
1344 | === modified file 'tests/qmltests/Dash/qml/FakeScopeView.qml' |
1345 | --- tests/qmltests/Dash/qml/FakeScopeView.qml 2013-12-17 16:04:47 +0000 |
1346 | +++ tests/qmltests/Dash/qml/FakeScopeView.qml 2014-01-07 17:09:31 +0000 |
1347 | @@ -23,6 +23,7 @@ |
1348 | id: fakeScopeView |
1349 | |
1350 | property alias backColor : back.color |
1351 | + property var categoryView: null |
1352 | |
1353 | onEndReached: { |
1354 | if (scope != undefined && shell != undefined && shell.scopeStatus != undefined) { |
1355 | |
1356 | === modified file 'tests/qmltests/Dash/tst_Dash.qml' |
1357 | --- tests/qmltests/Dash/tst_Dash.qml 2013-12-17 19:15:09 +0000 |
1358 | +++ tests/qmltests/Dash/tst_Dash.qml 2014-01-07 17:09:31 +0000 |
1359 | @@ -25,8 +25,6 @@ |
1360 | width: units.gu(40) |
1361 | height: units.gu(80) |
1362 | |
1363 | - property ListModel searchHistory : ListModel {} |
1364 | - |
1365 | Dash { |
1366 | id: dash |
1367 | anchors.fill: parent |
1368 | @@ -83,14 +81,14 @@ |
1369 | // wait for scopes to load |
1370 | tryCompare(scopes, "loaded", true); |
1371 | |
1372 | - var dashbar = findChild(dash, "dashbar"); |
1373 | - verify(dashbar != undefined) |
1374 | + var tabbar = findChild(dash, "tabbar"); |
1375 | + verify(tabbar != undefined) |
1376 | var dashContent = findChild(dash, "dashContent"); |
1377 | var current_index = dashContent.currentIndex; |
1378 | |
1379 | dash.setCurrentScope(data.tag, true /* animate */, false /* reset */); |
1380 | compare(dashContent.currentIndex, data.shouldBeVisible ? data.visualIndex : current_index); |
1381 | - compare(dashbar.currentIndex, data.shouldBeVisible ? data.visualIndex : current_index); |
1382 | + compare(tabbar.selectedIndex, data.shouldBeVisible ? data.visualIndex : current_index); |
1383 | } |
1384 | |
1385 | function test_show_scope_on_load_data() { |
1386 | @@ -127,12 +125,12 @@ |
1387 | // wait for scopes to load |
1388 | tryCompare(scopes, "loaded", true); |
1389 | |
1390 | - var dashbar = findChild(dash, "dashbar"); |
1391 | - verify(dashbar != undefined) |
1392 | + var tabbar = findChild(dash, "tabbar"); |
1393 | + verify(tabbar != undefined) |
1394 | var dashContent = findChild(dash, "dashContent"); |
1395 | var current_index = dashContent.currentIndex; |
1396 | |
1397 | - dashbar.itemSelected(data.visualIndex); |
1398 | + tabbar.selectedIndex = data.visualIndex; |
1399 | compare(dashContent.currentIndex, data.shouldBeVisible ? data.visualIndex : current_index); |
1400 | } |
1401 | } |
1402 | |
1403 | === removed file 'tests/qmltests/Dash/tst_DashBar.qml' |
1404 | --- tests/qmltests/Dash/tst_DashBar.qml 2013-12-17 16:04:47 +0000 |
1405 | +++ tests/qmltests/Dash/tst_DashBar.qml 1970-01-01 00:00:00 +0000 |
1406 | @@ -1,111 +0,0 @@ |
1407 | -/* |
1408 | - * Copyright 2013 Canonical Ltd. |
1409 | - * |
1410 | - * This program is free software; you can redistribute it and/or modify |
1411 | - * it under the terms of the GNU General Public License as published by |
1412 | - * the Free Software Foundation; version 3. |
1413 | - * |
1414 | - * This program is distributed in the hope that it will be useful, |
1415 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1416 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1417 | - * GNU General Public License for more details. |
1418 | - * |
1419 | - * You should have received a copy of the GNU General Public License |
1420 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1421 | - */ |
1422 | - |
1423 | -import QtQuick 2.0 |
1424 | -import QtTest 1.0 |
1425 | -import Unity 0.1 |
1426 | -import ".." |
1427 | -import "../../../qml/Dash" |
1428 | -import Ubuntu.Components 0.1 |
1429 | -import Unity.Test 0.1 as UT |
1430 | - |
1431 | -Item { |
1432 | - width: units.gu(40) |
1433 | - height: units.gu(71) |
1434 | - |
1435 | - DashBar { |
1436 | - id: dashBar |
1437 | - |
1438 | - anchors { |
1439 | - left: parent.left |
1440 | - right: parent.right |
1441 | - bottom: parent.bottom |
1442 | - } |
1443 | - model: scopes |
1444 | - onItemSelected: currentIndex = index |
1445 | - } |
1446 | - |
1447 | - Scopes { |
1448 | - id: scopes |
1449 | - } |
1450 | - |
1451 | - SignalSpy { |
1452 | - id: signalSpy |
1453 | - signalName: "itemSelected" |
1454 | - target: dashBar |
1455 | - } |
1456 | - |
1457 | - UT.UnityTestCase { |
1458 | - name: "DashBar" |
1459 | - when: scopes.loaded |
1460 | - |
1461 | - property alias model: dashBar.model |
1462 | - property alias currentIndex: dashBar.currentIndex |
1463 | - |
1464 | - readonly property alias lineHeight: dashBar.lineHeight |
1465 | - readonly property alias itemSize: dashBar.itemSize |
1466 | - readonly property alias iconSize: dashBar.iconSize |
1467 | - readonly property var panel: findChild(dashBar, "panel"); |
1468 | - |
1469 | - function initTestCase() { |
1470 | - currentIndex = 2 |
1471 | - } |
1472 | - |
1473 | - function waitForAnimationToEnd() { |
1474 | - compare(panel.animating, true) // check the animation started |
1475 | - tryCompare(panel, "animating", false) // wait till the animation ends |
1476 | - } |
1477 | - |
1478 | - function closePanel() { |
1479 | - dashBar.finishNavigation() |
1480 | - waitForAnimationToEnd() |
1481 | - tryCompare(panel, "opened", false) |
1482 | - } |
1483 | - |
1484 | - function openPanel() { |
1485 | - dashBar.startNavigation() |
1486 | - waitForAnimationToEnd() |
1487 | - tryCompare(panel, "opened", true) |
1488 | - } |
1489 | - |
1490 | - function test_navigationAndHide() { |
1491 | - openPanel() |
1492 | - closePanel() |
1493 | - } |
1494 | - |
1495 | - function test_itemSelected() { |
1496 | - openPanel() |
1497 | - |
1498 | - var row = findChild(dashBar, "row"); |
1499 | - tryCompareFunction(function(){return row.width > 0;}, true); |
1500 | - for (var i = 0; i < model.rowCount(); i++) { |
1501 | - // coordinate x in the middle of item with index 'i' |
1502 | - var x = row.x + (row.width / model.rowCount()) * i + itemSize / 2 |
1503 | - |
1504 | - // FIXME workaround for a bug in SignalSpy |
1505 | - signalSpy.clear() |
1506 | - |
1507 | - // (item, x, y, button, modifiers, delay) |
1508 | - mouseClick(panel, x, row.height / 2, Qt.LeftButton, Qt.NoModifier, 0) |
1509 | - compare(signalSpy.count > 0, true, "signal itemSelected not triggered") |
1510 | - compare(signalSpy.signalArguments[0][0], i, "signal itemSelected emitted unexpected index"); |
1511 | - tryCompare(dashBar, "currentIndex", i); |
1512 | - } |
1513 | - |
1514 | - closePanel() |
1515 | - } |
1516 | - } |
1517 | -} |
1518 | |
1519 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' |
1520 | --- tests/qmltests/Dash/tst_DashContent.qml 2013-12-17 19:15:09 +0000 |
1521 | +++ tests/qmltests/Dash/tst_DashContent.qml 2014-01-07 17:09:31 +0000 |
1522 | @@ -17,9 +17,11 @@ |
1523 | import QtQuick 2.0 |
1524 | import QtTest 1.0 |
1525 | import "../../../qml/Dash" |
1526 | +import "../../../qml/Components" |
1527 | import Ubuntu.Components 0.1 |
1528 | import Unity 0.1 |
1529 | import Unity.Test 0.1 as UT |
1530 | +import Utils 0.1 |
1531 | |
1532 | Item { |
1533 | id: shell |
1534 | @@ -54,11 +56,13 @@ |
1535 | id: dashContent |
1536 | anchors.fill: parent |
1537 | |
1538 | - model: scopesModel |
1539 | + model: SortFilterProxyModel { |
1540 | + model: scopesModel |
1541 | + } |
1542 | scopes : scopesModel |
1543 | |
1544 | scopeMapper : scopeDelegateMapper |
1545 | - searchHistory: ListModel {} |
1546 | + searchHistory: SearchHistoryModel {} |
1547 | } |
1548 | |
1549 | ScopeDelegateMapper { |
1550 | @@ -109,9 +113,10 @@ |
1551 | |
1552 | UT.UnityTestCase { |
1553 | name: "DashContent" |
1554 | - when: windowShown |
1555 | + when: scopesModel.loaded |
1556 | |
1557 | function init() { |
1558 | + scopesModel.clear(); |
1559 | scopesModel.load(); |
1560 | } |
1561 | |
1562 | @@ -268,6 +273,65 @@ |
1563 | tryCompare(scopesModel.get(2), "isActive", data.active2); |
1564 | } |
1565 | |
1566 | + function doFindMusicButton(parent) { |
1567 | + for (var i = 0; i < parent.children.length; i++) { |
1568 | + var c = parent.children[i]; |
1569 | + if (UT.Util.isInstanceOf(c, "AbstractButton") && parent.x >= 0) { |
1570 | + for (var ii = 0; ii < c.children.length; ii++) { |
1571 | + var cc = c.children[ii]; |
1572 | + if (UT.Util.isInstanceOf(cc, "Label") && cc.text == "Music") { |
1573 | + return c; |
1574 | + } |
1575 | + } |
1576 | + } |
1577 | + var r = doFindMusicButton(c); |
1578 | + if (r !== undefined) { |
1579 | + return r; |
1580 | + } |
1581 | + } |
1582 | + return undefined; |
1583 | + } |
1584 | + |
1585 | + function findMusicButton() { |
1586 | + // We need to find a AbstractButton that has a Label child |
1587 | + // with text Music and it's parent x is >= 0 |
1588 | + var tabbar = findChild(dashContent, "tabbar"); |
1589 | + return doFindMusicButton(tabbar); |
1590 | + } |
1591 | + |
1592 | + function test_tabBar_index_change() { |
1593 | + tryCompare(scopesModel, "loaded", true); |
1594 | + var tabbar = findChild(dashContent, "tabbar"); |
1595 | + |
1596 | + compare(dashContent.currentIndex, 0); |
1597 | + tryCompare(tabbar, "selectedIndex", 0); |
1598 | + tryCompare(tabbar, "selectionMode", false); |
1599 | + |
1600 | + mouseClick(tabbar, units.gu(5), units.gu(5)) |
1601 | + |
1602 | + tryCompare(tabbar, "selectionMode", true); |
1603 | + tryCompare(tabbar, "selectedIndex", 0); |
1604 | + tryCompare(dashContent, "currentIndex", 0); |
1605 | + |
1606 | + var button; |
1607 | + tryCompareFunction(function() { button = findMusicButton(); return button != undefined; }, true); |
1608 | + waitForRendering(button); |
1609 | + |
1610 | + mouseClick(button, button.width / 2, button.height / 2) |
1611 | + |
1612 | + tryCompare(tabbar, "selectionMode", false); |
1613 | + tryCompare(tabbar, "selectedIndex", 1); |
1614 | + tryCompare(dashContent, "currentIndex", 1); |
1615 | + } |
1616 | + |
1617 | + function test_tabBar_listens_to_index_change() { |
1618 | + var tabbar = findChild(dashContent, "tabbar"); |
1619 | + tryCompare(dashContent, "currentIndex", 0); |
1620 | + compare(tabbar.selectedIndex, 0); |
1621 | + dashContent.currentIndex = 1; |
1622 | + compare(tabbar.selectedIndex, 1); |
1623 | + } |
1624 | + |
1625 | function checkFlickMovingAndNotInteractive() |
1626 | { |
1627 | var dashContentList = findChild(dashContent, "dashContentList"); |
1628 | @@ -282,7 +346,6 @@ |
1629 | return dashContentList.currentItem.moving && !dashContentList.interactive; |
1630 | } |
1631 | |
1632 | - |
1633 | function test_hswipe_disabled_vswipe() { |
1634 | var dashContentList = findChild(dashContent, "dashContentList"); |
1635 | |
1636 | |
1637 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' |
1638 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-01-07 09:27:20 +0000 |
1639 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-01-07 17:09:31 +0000 |
1640 | @@ -41,54 +41,83 @@ |
1641 | signal mainStageFocusedApplicationChanged() |
1642 | } |
1643 | |
1644 | + PreviewListView { |
1645 | + id: previewListView |
1646 | + anchors.fill: parent |
1647 | + openEffect: openEffect |
1648 | + categoryView: genericScopeView.categoryView |
1649 | + scope: genericScopeView.scope |
1650 | + } |
1651 | + |
1652 | + DashContentOpenEffect { |
1653 | + id: openEffect |
1654 | + previewListView: previewListView |
1655 | + } |
1656 | + |
1657 | + PageHeaderLabel { |
1658 | + id: pageHeader |
1659 | + searchHistory: SearchHistoryModel {} |
1660 | + } |
1661 | + |
1662 | GenericScopeView { |
1663 | id: genericScopeView |
1664 | anchors.fill: parent |
1665 | - searchHistory: SearchHistoryModel {} |
1666 | + previewListView: previewListView |
1667 | + openEffect: openEffect |
1668 | + pageHeader: pageHeader |
1669 | + tabBarHeight: pageHeader.implicitHeight |
1670 | |
1671 | UT.UnityTestCase { |
1672 | name: "GenericScopeView" |
1673 | when: scopes.loaded |
1674 | |
1675 | - function test_isCurrent() { |
1676 | - var pageHeader = findChild(genericScopeView, "pageHeader"); |
1677 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1678 | + function test_isCurrent() { |
1679 | genericScopeView.isCurrent = true |
1680 | pageHeader.searchQuery = "test" |
1681 | previewListView.open = true |
1682 | genericScopeView.isCurrent = false |
1683 | tryCompare(pageHeader, "searchQuery", "") |
1684 | - tryCompare(genericScopeView, "previewShown", false); |
1685 | + tryCompare(previewListView, "open", false); |
1686 | } |
1687 | |
1688 | function test_showDash() { |
1689 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1690 | previewListView.open = true; |
1691 | + tryCompare(openEffect, "live", true); |
1692 | scopes.get(0).showDash(); |
1693 | - tryCompare(genericScopeView, "previewShown", false); |
1694 | + tryCompare(previewListView, "open", false); |
1695 | + tryCompare(openEffect, "live", true); |
1696 | } |
1697 | |
1698 | function test_hideDash() { |
1699 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1700 | previewListView.open = true; |
1701 | scopes.get(0).hideDash(); |
1702 | - tryCompare(genericScopeView, "previewShown", false); |
1703 | + tryCompare(previewListView, "open", false); |
1704 | } |
1705 | |
1706 | function openPreview() { |
1707 | var categoryListView = findChild(genericScopeView, "categoryListView"); |
1708 | categoryListView.positionAtBeginning(); |
1709 | |
1710 | + tryCompareFunction(function() { |
1711 | + var tile = findChild(findChild(genericScopeView, "0"), "delegate0"); |
1712 | + return tile != undefined; |
1713 | + }, |
1714 | + true); |
1715 | var tile = findChild(findChild(genericScopeView, "0"), "delegate0"); |
1716 | mouseClick(tile, tile.width / 2, tile.height / 2); |
1717 | - var openEffect = findChild(genericScopeView, "openEffect"); |
1718 | + tryCompare(previewListView, "open", true); |
1719 | tryCompare(openEffect, "gap", 1); |
1720 | } |
1721 | |
1722 | function checkArrowPosition(index) { |
1723 | + tryCompareFunction(function() { |
1724 | + var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index); |
1725 | + return tile != undefined; |
1726 | + }, |
1727 | + true); |
1728 | var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index); |
1729 | var tileCenter = tile.x + tile.width/2; |
1730 | - var pointerArrow = findChild(genericScopeView, "pointerArrow"); |
1731 | + var pointerArrow = findChild(previewListView, "pointerArrow"); |
1732 | var pointerArrowCenter = pointerArrow.x + pointerArrow.width/2; |
1733 | compare(pointerArrowCenter, tileCenter, "Pointer did not move to tile"); |
1734 | } |
1735 | @@ -97,9 +126,7 @@ |
1736 | var closePreviewMouseArea = findChild(genericScopeView, "closePreviewMouseArea"); |
1737 | mouseClick(closePreviewMouseArea, closePreviewMouseArea.width / 2, closePreviewMouseArea.height / 2); |
1738 | |
1739 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1740 | tryCompare(previewListView, "open", false); |
1741 | - var openEffect = findChild(genericScopeView, "openEffect"); |
1742 | tryCompare(openEffect, "gap", 0); |
1743 | |
1744 | var categoryListView = findChild(genericScopeView, "categoryListView"); |
1745 | @@ -108,13 +135,12 @@ |
1746 | } |
1747 | |
1748 | function test_previewOpenClose() { |
1749 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1750 | tryCompare(previewListView, "open", false); |
1751 | |
1752 | openPreview(); |
1753 | |
1754 | // check for it opening successfully |
1755 | - var currentPreviewItem = findChild(genericScopeView, "previewLoader0"); |
1756 | + var currentPreviewItem = findChild(previewListView, "previewLoader0"); |
1757 | tryCompareFunction(function() { |
1758 | var parts = currentPreviewItem.source.toString().split("/"); |
1759 | var name = parts[parts.length - 1]; |
1760 | @@ -138,26 +164,23 @@ |
1761 | var categoryListView = findChild(genericScopeView, "categoryListView"); |
1762 | categoryListView.positionAtBeginning(); |
1763 | waitForRendering(categoryListView); |
1764 | - categoryListView.flick(0, -units.gu(80)); |
1765 | + categoryListView.flick(0, -units.gu(60)); |
1766 | tryCompare(categoryListView.flicking, false); |
1767 | |
1768 | var tile = findChild(findChild(genericScopeView, "0"), "delegate0"); |
1769 | mouseClick(tile, tile.width / 2, tile.height - 1); |
1770 | - var openEffect = findChild(genericScopeView, "openEffect"); |
1771 | tryCompare(openEffect, "gap", 1); |
1772 | |
1773 | - var pageHeader = findChild(genericScopeView, "pageHeader"); |
1774 | verify(openEffect.positionPx >= pageHeader.height + categoryListView.stickyHeaderHeight); |
1775 | } |
1776 | |
1777 | function test_previewCycle() { |
1778 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1779 | tryCompare(previewListView, "open", false); |
1780 | |
1781 | openPreview(); |
1782 | |
1783 | // wait for it to be loaded |
1784 | - var currentPreviewItem = findChild(genericScopeView, "previewLoader0"); |
1785 | + var currentPreviewItem = findChild(previewListView, "previewLoader0"); |
1786 | tryCompareFunction(function() { |
1787 | var parts = currentPreviewItem.source.toString().split("/"); |
1788 | var name = parts[parts.length - 1]; |
1789 | @@ -179,7 +202,7 @@ |
1790 | previewListView.height / 2); |
1791 | |
1792 | // wait for it to be loaded |
1793 | - var nextPreviewItem = findChild(genericScopeView, "previewLoader" + i); |
1794 | + var nextPreviewItem = findChild(previewListView, "previewLoader" + i); |
1795 | tryCompareFunction(function() { |
1796 | var parts = nextPreviewItem.source.toString().split("/"); |
1797 | var name = parts[parts.length - 1]; |
1798 | @@ -206,11 +229,12 @@ |
1799 | |
1800 | function test_show_spinner() { |
1801 | openPreview(); |
1802 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1803 | - var previewLoader = findChild(genericScopeView, "previewLoader0"); |
1804 | + var previewLoader = findChild(previewListView, "previewLoader0"); |
1805 | + tryCompare(previewLoader, "progress", 1.0); |
1806 | + tryCompareFunction(function() { return previewLoader.item != undefined; }, true); |
1807 | |
1808 | previewLoader.item.showProcessingAction = true; |
1809 | - var waitingForAction = findChild(genericScopeView, "waitingForActionMouseArea"); |
1810 | + var waitingForAction = findChild(previewListView, "waitingForActionMouseArea"); |
1811 | tryCompare(waitingForAction, "enabled", true); |
1812 | previewLoader.closePreviewSpinner(); |
1813 | tryCompare(waitingForAction, "enabled", false); |
1814 | @@ -252,12 +276,10 @@ |
1815 | tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true); |
1816 | var tile = findChild(genericScopeView, "carouselDelegate"); |
1817 | mouseClick(tile, tile.width / 2, tile.height / 2); |
1818 | - var openEffect = findChild(genericScopeView, "openEffect"); |
1819 | tryCompare(openEffect, "gap", 1); |
1820 | |
1821 | // check for it opening successfully |
1822 | - var previewListView = findChild(genericScopeView, "previewListView"); |
1823 | - var currentPreviewItem = findChild(genericScopeView, "previewLoader0"); |
1824 | + var currentPreviewItem = findChild(previewListView, "previewLoader0"); |
1825 | tryCompareFunction(function() { |
1826 | var parts = currentPreviewItem.source.toString().split("/"); |
1827 | var name = parts[parts.length - 1]; |
1828 | @@ -303,7 +325,6 @@ |
1829 | tryCompareFunction( |
1830 | function() { |
1831 | var header0 = findChild(genericScopeView, "dashSectionHeader0") |
1832 | - var pageHeader = findChild(genericScopeView, "pageHeader"); |
1833 | return header0.y == pageHeader.height; |
1834 | }, |
1835 | true); |
Part of the big change in Dash/DashConten t.qml is just indentation, you may want to review using a more space-friendly diff tool