Merge lp:~unity-team/unity8/new-scopes into lp:unity8

Proposed by Michał Sawicz
Status: Rejected
Rejected by: Michał Sawicz
Proposed branch: lp:~unity-team/unity8/new-scopes
Merge into: lp:unity8
Diff against target: 2757 lines (+912/-577)
53 files modified
data/unity8.conf (+5/-0)
debian/control (+4/-1)
debian/unity8.install (+1/-0)
plugins/DashViews/listviewwithpageheader.cpp (+7/-0)
po/ug.po (+2/-1)
qml/Components/ApplicationManagerWrapper.qml (+8/-0)
qml/Components/ApplicationScreenshot.qml (+1/-2)
qml/Components/ListItems/Header.qml (+2/-14)
qml/Components/PageHeader.qml (+26/-2)
qml/Components/ResponsiveGridView.qml (+0/-1)
qml/Components/SeeMore.qml (+4/-2)
qml/Components/Showable.qml (+8/-0)
qml/Components/Stage.qml (+13/-8)
qml/Dash/Apps/RunningApplicationTile.qml (+2/-3)
qml/Dash/Card.qml (+18/-2)
qml/Dash/CardCarousel.qml (+78/-0)
qml/Dash/CardFilterGrid.qml (+59/-0)
qml/Dash/CardHeader.qml (+36/-19)
qml/Dash/CardTool.qml (+7/-2)
qml/Dash/Dash.qml (+49/-4)
qml/Dash/DashApps.qml (+4/-19)
qml/Dash/DashContent.qml (+48/-32)
qml/Dash/DashContentOpenEffect.qml (+0/-57)
qml/Dash/DashContentTabBarStyle.qml (+3/-0)
qml/Dash/DashFilterGrid.qml (+4/-2)
qml/Dash/DashPreviewPlaceholder.qml (+1/-1)
qml/Dash/DashRenderer.qml (+6/-0)
qml/Dash/GenericScopeView.qml (+64/-114)
qml/Dash/PreviewListView.qml (+59/-138)
qml/Dash/Previews/Preview.qml (+20/-15)
qml/Dash/Previews/PreviewActions.qml (+1/-1)
qml/Dash/Previews/PreviewAudioPlayback.qml (+3/-3)
qml/Dash/Previews/PreviewHeader.qml (+3/-1)
qml/Dash/Previews/PreviewImageGallery.qml (+10/-0)
qml/Dash/Previews/PreviewTextSummary.qml (+6/-3)
qml/Dash/Previews/PreviewWidgetFactory.qml (+1/-1)
qml/Dash/ScopeDelegateMapper.qml (+1/-1)
qml/Dash/ScopeItem.qml (+94/-0)
qml/Dash/SearchableResultModel.qml (+1/-1)
qml/Launcher/Launcher.qml (+0/-1)
qml/Launcher/LauncherPanel.qml (+0/-1)
qml/Panel/MenuContent.qml (+1/-0)
qml/ScopeTool.qml (+9/-1)
qml/Shell.qml (+156/-108)
qml/ShellOrientator.qml (+43/-0)
src/main.cpp (+11/-1)
tests/mocks/Unity/fake_unity_plugin.cpp (+8/-1)
tests/plugins/DashViews/organicgridtest.cpp (+2/-1)
tests/plugins/DashViews/verticaljournaltest.cpp (+2/-1)
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp (+8/-0)
tests/qmltests/Dash/Previews/tst_Preview.qml (+1/-1)
tests/qmltests/Dash/tst_GenericScopeView.qml (+11/-11)
tools/registry-tracker.cpp (+1/-0)
To merge this branch: bzr merge lp:~unity-team/unity8/new-scopes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+198359@code.launchpad.net
To post a comment you must log in.
lp:~unity-team/unity8/new-scopes updated
563. By Michal Hruby

Merged trunk

564. By Michał Sawicz

merge trunk

565. By Michal Hruby

Merge trunk

566. By Michał Sawicz

Merge trunk.

567. By Michal Hruby

Merged trunk

568. By Michal Hruby

Bump module import version in scope tool

569. By Michał Sawicz

Get layout from category template.

570. By Michał Sawicz

Get components from the scope.

571. By Michał Sawicz

Initial Carousel integration.

572. By Michał Sawicz

Fix indentation, add name to the Card test suite.

573. By Michał Sawicz

Add copyright headers.

574. By Michał Sawicz

Merge trunk

575. By Michał Sawicz

Add name to tst_CardHeader.qml.

576. By Michał Karnicki

Horizontal Card layout.

577. By Michał Sawicz

Merge trunk.

578. By Michał Sawicz

Merge trunk.

579. By Michał Sawicz

Merge trunk.

580. By Michal Hruby

Update Unity plugin version req in PreviewListView.qml

581. By Michał Sawicz

Merge trunk.

582. By Michal Hruby

Merged trunk

583. By Michał Sawicz

Merge trunk.

584. By Michał Karnicki

Minimum number of items in the carousel is 5.

585. By Michał Sawicz

Merge trunk.

586. By Michal Hruby

Enable taps, pass correct params to preview and activate

587. By Michał Sawicz

Merge trunk.

588. By Michał Sawicz

Merge trunk.

589. By Michał Sawicz

Use CardTool in CardFilterGrid and CardCarousel.

590. By Michał Sawicz

Disable Card in CardCarousel to not eat any input.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:589
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~unity-team/unity8/new-scopes/+merge/198359/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity8-ci/2228/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2889
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2633/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1099
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/750
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/752
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/752/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/750
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2535
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2891
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2891/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2634
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2634/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5059/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3615

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2228/rebuild

review: Needs Fixing (continuous-integration)
lp:~unity-team/unity8/new-scopes updated
591. By Michał Sawicz

lp:~saviq/unity8/fix-indicator-tests

592. By Michał Sawicz

lp:~saviq/unity8/card-tool

593. By Michał Sawicz

lp:~mterry/unity8/demo-users

594. By Michał Sawicz

lp:~unity-team/unity8/unity8.previews_audioPlayer

595. By Michał Sawicz

lp:~unity-team/unity8/unity8.previews_textSummary

596. By Michał Sawicz

lp:~aacid/unity8/image_gallery_preview_widget

597. By Michał Sawicz

lp:~ted/unity8/on-the-screen

598. By Michał Sawicz

lp:~unity-team/unity8/action_preview_widget

599. By Michał Sawicz

lp:~saviq/unity8/new-preview

600. By Michał Sawicz

lp:~unity-team/unity8/unity8-card-overlay

601. By Michał Sawicz

lp:~unity-team/unity8/header-alignment

602. By Michał Sawicz

lp:~unity-team/unity8/new-scopes-title-alignment

603. By Michał Sawicz

lp:~unity-team/unity8/newscopes-card-overlay

604. By Michał Sawicz

lp:~unity-team/unity8/newscopes-preview

605. By Albert Astals Cid

lp:~aacid/unity8/no_readonly_headerheight

606. By Albert Astals Cid

Merge lp:~unity-team/unity8/unity8-card-overlay again

607. By Michal Hruby

Display only top-level scopes when running on the device

608. By Michal Hruby

Pipe through stdout and stderr of the scopes

609. By Michał Karnicki

Merge newscopes-new-dash-look.

610. By Michal Hruby

Merge lp:~unity-team/unity8/unity8.preview_image

611. By Michal Hruby

Merge trunk

612. By Albert Astals Cid

Merge lp:~aacid/unity8/new-scopes-preview-fixes

613. By Michal Hruby

Merge trunk

614. By Michal Hruby

Re-merge lp:~unity-team/unity8/unity8.preview_image

615. By Michal Hruby

Merge lp:~aacid/unity8/apps-special-category

616. By Michal Hruby

Merge lp:~aacid/unity8/preview_header

617. By Michal Hruby

Merge lp:~unity-team/unity8/unity8.preview_video

618. By Michal Hruby

Re-merge lp:~unity-team/unity8/unity8.preview_video

619. By kevin gunn

merge in lp:~gerboland/unity8/sidestage-unlock-sidestage-appears

620. By kevin gunn

merge in lp:~gerboland/unity8/sidestage-unlock-sidestage-appears

621. By kevin gunn

merge in lp:~gerboland/unity8/sidestage-handle-input-area

622. By kevin gunn

whitespace update

623. By kevin gunn

update from trunk

624. By Albert Astals Cid

Merge lp:unity8

625. By Albert Astals Cid

Merge lp:~aacid/unity8/preview_progress

626. By Albert Astals Cid

Merge lp:~unity-team/unity8/new-scopes-fix-header-font

627. By Albert Astals Cid

Merge lp:~aacid/unity8/new-scopes-carousel-as-grid

628. By Albert Astals Cid

Merge lp:~aacid/unity8/fix-new-scopes-tab-name-missing

629. By Michal Hruby

Use PreviewStack and per-column widget models

630. By Albert Astals Cid

Merge lp:~aacid/unity8/new-scopes-header-fix

631. By Albert Astals Cid

Merge lp:~aacid/unity8/lvwph_resize_item_bug

632. By Albert Astals Cid

Merge lp:~aacid/unity8/new-scopes-preview-sometimes-disappears

633. By Michal Hruby

Remove blending rectangle, so previews aren't grey

634. By Michal Hruby

Merge lp:~unity-team/unity8/unity8-preview-summary-color

635. By Michal Hruby

Don't override scope list if already specified

636. By Michal Hruby

Fix the condition

637. By kevin gunn

merge in lp:~unity-team/unity8/rotate-n7 which is not to productized

638. By Michal Hruby

Merge lp:~aacid/unity8/misc_previewlist_fixes

639. By Michal Hruby

Re-merge lp:~unity-team/unity8/unity8-preview-summary-color

640. By Albert Astals Cid

Remerge lp:~unity-team/unity8/rotate-n7

641. By Albert Astals Cid

Merge lp:~aacid/unity8/new-scopes-dash-background-opacity

642. By Albert Astals Cid

Merge lp:~aacid/unity8/show_video_playback_screenshot_loading_indicator

643. By Michał Sawicz

Tweak recommended scopes.

644. By Albert Astals Cid

Merge lp:~unity-team/unity8/unity8-mascot-res-workaround

645. By Michał Sawicz

Make Click scope the default.

646. By Scott Sweeny

temporary fix for 'See more' and 'See less' text color in previews

647. By Michał Sawicz

Merge trunk.

648. By Michał Sawicz

Merge lp:~saviq/unity8/card-background

649. By Michał Sawicz

Fix running apps font.

650. By Michał Sawicz

Merge lp:~unity-team/unity8/new-scopes-scope-activation

651. By Michał Sawicz

Depend instead of Recommend the scopes, to make the image build work.

652. By Albert Astals Cid

Add back the workaround for not being able scroll the image gallery

Taken from AppPreview.qml

653. By Michał Karnicki

Update category label font color.

654. By Albert Astals Cid

Back button improvements

Move the back button to the header itself so it will be shown when the search is out too.
Make the back "button" bigger than the image

655. By Michał Karnicki

Change 'Running Apps' to 'Recent'.

656. By Michał Sawicz

Fix header colours and chevrons.

657. By Michał Sawicz

Directly activate scopes, too.

658. By Albert Astals Cid

Hotfix Dash header positioning

Make sure that after calling positionAtBeginning (what we do when swiping from an app back to the dash) the header is correctly in place
Also make sure the pageHeader position is not controlled by non curret scopes

659. By Michał Sawicz

Implement collapsed-rows support.

660. By Michał Sawicz

Clip dash when temporary visible.

661. By Michał Sawicz

Cache images in cards.

662. By Michał Sawicz

Resync.

663. By Michał Sawicz

Make sure SEARCH goes away when in previews.

664. By Michał Sawicz

Add preview columns support, fix spacing, clipping and cacheBuffer in previews.

665. By Albert Astals Cid

MouseArea -> AbstractButton to get haptics

666. By Jussi Pakkanen

Move downloads to their own threads so they don't muck about with the parent thread's event loop.

667. By Michał Sawicz

Merge trunk

668. By Michał Sawicz

Merge lp:~unity-team/unity8/themeing-font-and-mascot.

669. By Daniel d'Andrada

When focus is requested by the app manager, only call the correct stage.

Instead of activating both stages and letting the correct one work it out.

670. By Gerry Boland

[sidestage] hide side stage if all side stage apps are closed

671. By Michał Sawicz

Fix default background.

672. By Gerry Boland

[tablet] enable launcher in greeter when allowed

673. By Michał Sawicz

Add preview activity indicator and fix subsequent preview input.

674. By Michael Terry

Merge lp:~mterry/unity8/ensure-selected-greeter.

Ensure that the selected() signal is emitted by the greeter on startup, fixing the background on startup for the first user in tablet mode.

675. By Michał Sawicz

Make sure activity indicator is only on screen when preview available, and make image widget fit on screen.

676. By Michał Sawicz

Improve visuals and close preview on home button press.

677. By Michał Karnicki

Fix CardHeader title font weight.

678. By Michał Sawicz

Merge lp:~aacid/unity8/new-scopes-show-dash-app-running

679. By Gerry Boland

Prevent sidestage from popping out incorrectly when app launched indirectly

680. By Michał Sawicz

Update category chevrons.

681. By Michał Sawicz

Fix PageHeader centering.

682. By Albert Astals Cid

Merge lp:~aacid/unity8/new-scopes-dash-preview-fullscreen.

683. By Michał Sawicz

Merge lp:~mhr3/unity8/design-tweaks .

684. By Michał Karnicki

Add top/bottom gradients.

685. By Michał Sawicz

Merge trunk.

686. By Michał Karnicki

Don't show gradient in last category.

687. By Michał Sawicz

Revert r695, 'cause LazyImage gets confused with some images.

688. By Michał Sawicz

Fix whitespace.

689. By Michał Sawicz

Fix broken mereg.

690. By Michael Zanetti

Keep aspect ratio of app screenshots and crop them square.

691. By Michał Sawicz

Fix activity indicator.

692. By Michał Sawicz

Revert r690, 'cause it's racy.

693. By Michał Sawicz

Fix edge demos.

694. By Michał Sawicz

Merge fix in lp:~unity-team/unity8/unity8-category-gradients.

695. By Michał Sawicz

Add gradient to RunningApplicationsGrid, too, as it's not a DashRenderer...

696. By Michał Sawicz

Spurious logs...

697. By Michal Hruby

Merge trunk

698. By Michal Hruby

Fix missing line

699. By Michał Sawicz

Merge trunk.

700. By Michał Sawicz

Bring gradients back into DashRenderer, where they belong.

701. By Michał Sawicz

Merge lp:~aacid/unity8/new-scopes_do_not_request_previews_on_activate

702. By Albert Astals Cid

Merge lp:unity8

703. By Albert Astals Cid

Merge lp:~aacid/unity8/vjog_compiz_workaround

Revision history for this message
Michał Sawicz (saviq) wrote :

This is cleaned up to merge into trunk in: lp:~unity-team/unity8/new-scopes-clean-to-trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/unity8.conf'
--- data/unity8.conf 2014-02-27 21:56:42 +0000
+++ data/unity8.conf 2014-03-07 12:41:18 +0000
@@ -29,6 +29,11 @@
29 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"29 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"
30 fi30 fi
3131
32 if [ -z "$UNITY_SCOPES_LIST" ]; then
33 # FIXME: remove once we have this in dconf
34 initctl set-env UNITY_SCOPES_LIST="scopes;clickscope;musicaggregator;videoaggregator"
35 fi
36
32 # Remove the socket if still there37 # Remove the socket if still there
33 if [ -S "$MIR_SERVER_FILE" ]; then38 if [ -S "$MIR_SERVER_FILE" ]; then
34 rm "$MIR_SERVER_FILE"39 rm "$MIR_SERVER_FILE"
3540
=== modified file 'debian/control'
--- debian/control 2014-02-25 01:07:08 +0000
+++ debian/control 2014-03-07 12:41:18 +0000
@@ -96,7 +96,10 @@
96 libcap2-bin,96 libcap2-bin,
97 ${misc:Depends},97 ${misc:Depends},
98 ${shlibs:Depends},98 ${shlibs:Depends},
99Recommends: ${unity-default-masterscopes},99 unity-scope-scopes,
100 unity-scope-onlinemusic,
101 unity-scope-mediascanner2,
102 unity-scope-click,
100Breaks: indicator-network (<< 0.5.1)103Breaks: indicator-network (<< 0.5.1)
101Replaces: ubuntu-touch-session (<< 0.82~)104Replaces: ubuntu-touch-session (<< 0.82~)
102Description: Unity 8 shell105Description: Unity 8 shell
103106
=== modified file 'debian/unity8.install'
--- debian/unity8.install 2013-11-29 08:32:05 +0000
+++ debian/unity8.install 2014-03-07 12:41:18 +0000
@@ -10,6 +10,7 @@
10usr/share/unity8/Notifications10usr/share/unity8/Notifications
11usr/share/unity8/Panel11usr/share/unity8/Panel
12usr/share/unity8/Shell.qml12usr/share/unity8/Shell.qml
13usr/share/unity8/ShellOrientator.qml
13usr/share/unity8/SideStage14usr/share/unity8/SideStage
14usr/share/unity8/graphics15usr/share/unity8/graphics
15data/unity8.conf usr/share/upstart/sessions/16data/unity8.conf usr/share/upstart/sessions/
1617
=== modified file 'plugins/DashViews/listviewwithpageheader.cpp'
--- plugins/DashViews/listviewwithpageheader.cpp 2014-02-13 10:29:10 +0000
+++ plugins/DashViews/listviewwithpageheader.cpp 2014-03-07 12:41:18 +0000
@@ -366,6 +366,13 @@
366 m_previousContentY = m_visibleItems.first()->y() - headerHeight;366 m_previousContentY = m_visibleItems.first()->y() - headerHeight;
367 }367 }
368 setContentY(m_visibleItems.first()->y() + m_clipItem->y() - headerHeight);368 setContentY(m_visibleItems.first()->y() + m_clipItem->y() - headerHeight);
369 if (m_headerItem) {
370 // TODO This should not be needed and the code that adjust the m_headerItem position
371 // in viewportMoved() should be enough but in some cases we have not found a way to reproduce
372 // yet the code of viewportMoved() fails so here we make sure that at least if we are calling
373 // positionAtBeginning the header item will be correctly positioned
374 m_headerItem->setY(-m_minYExtent);
375 }
369}376}
370377
371void ListViewWithPageHeader::showHeader()378void ListViewWithPageHeader::showHeader()
372379
=== modified file 'po/ug.po'
--- po/ug.po 2014-02-19 05:44:29 +0000
+++ po/ug.po 2014-03-07 12:41:18 +0000
@@ -6,11 +6,12 @@
6msgid ""6msgid ""
7msgstr ""7msgstr ""
8"Project-Id-Version: unity\n"8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"9"Report-Msgid-Bugs-To: \n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11"PO-Revision-Date: 2014-02-15 12:09+0000\n"11"PO-Revision-Date: 2014-02-15 12:09+0000\n"
12"Last-Translator: Gheyret T.Kenji <Unknown>\n"12"Last-Translator: Gheyret T.Kenji <Unknown>\n"
13"Language-Team: Uyghur <ug@li.org>\n"13"Language-Team: Uyghur <ug@li.org>\n"
14"Language: \n"
14"MIME-Version: 1.0\n"15"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"16"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"17"Content-Transfer-Encoding: 8bit\n"
1718
=== modified file 'qml/Components/ApplicationManagerWrapper.qml'
--- qml/Components/ApplicationManagerWrapper.qml 2013-10-11 11:43:11 +0000
+++ qml/Components/ApplicationManagerWrapper.qml 2014-03-07 12:41:18 +0000
@@ -166,4 +166,12 @@
166 }166 }
167 return desktopFile.substring(left+1, right);167 return desktopFile.substring(left+1, right);
168 }168 }
169
170 function setMainStageAppRect(item) {
171 ApplicationManager.setMainStageAppRect(item);
172 }
173
174 function setSideStageAppRect(item) {
175 ApplicationManager.setSideStageAppRect(item);
176 }
169}177}
170178
=== modified file 'qml/Components/ApplicationScreenshot.qml'
--- qml/Components/ApplicationScreenshot.qml 2013-09-04 23:50:13 +0000
+++ qml/Components/ApplicationScreenshot.qml 2014-03-07 12:41:18 +0000
@@ -53,8 +53,7 @@
53 ApplicationImage {53 ApplicationImage {
54 id: applicationImage54 id: applicationImage
55 objectName: "screenshot image"55 objectName: "screenshot image"
56 width: applicationScreenshot.application ? parent.width : 056 anchors.fill: parent
57 height: applicationScreenshot.application ? parent.height : 0
58 visible: applicationScreenshot.application != null && ready57 visible: applicationScreenshot.application != null && ready
59 source: ApplicationManager.findApplication((application) ? application.appId : "")58 source: ApplicationManager.findApplication((application) ? application.appId : "")
60 }59 }
6160
=== modified file 'qml/Components/ListItems/Header.qml'
--- qml/Components/ListItems/Header.qml 2013-10-11 11:43:45 +0000
+++ qml/Components/ListItems/Header.qml 2014-03-07 12:41:18 +0000
@@ -36,7 +36,7 @@
36 right: parent.right36 right: parent.right
37 rightMargin: units.gu(0.5)37 rightMargin: units.gu(0.5)
38 top: parent.top38 top: parent.top
39 bottom: bottomBorder.top39 bottom: parent.bottom
40 }40 }
4141
42 Label {42 Label {
@@ -47,14 +47,11 @@
47 verticalCenter: parent.verticalCenter47 verticalCenter: parent.verticalCenter
48 }48 }
4949
50 color: Theme.palette.selected.backgroundText //at 60%50 color: "grey" // TODO karni: Update Ubuntu.Compoonents.Themes.Palette.
51 opacity: 0.6
52 font.family: "Ubuntu"51 font.family: "Ubuntu"
53 fontSize: "medium"52 fontSize: "medium"
54 elide: Text.ElideRight53 elide: Text.ElideRight
55 textFormat: Text.PlainText54 textFormat: Text.PlainText
56 style: Text.Raised
57 styleColor: "black"
58 width: parent.width - image.width - image.leftMargin - anchors.leftMargin55 width: parent.width - image.width - image.leftMargin - anchors.leftMargin
59 }56 }
6057
@@ -68,15 +65,6 @@
68 }65 }
69 }66 }
7067
71 ThinDivider {
72 id: bottomBorder
73 anchors {
74 left: parent.left
75 right: parent.right
76 bottom: parent.bottom
77 }
78 }
79
80 MouseArea {68 MouseArea {
81 anchors.fill: parent69 anchors.fill: parent
82 onClicked: parent.clicked(mouse)70 onClicked: parent.clicked(mouse)
8371
=== modified file 'qml/Components/PageHeader.qml'
--- qml/Components/PageHeader.qml 2014-01-27 18:12:05 +0000
+++ qml/Components/PageHeader.qml 2014-03-07 12:41:18 +0000
@@ -18,7 +18,7 @@
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Ubuntu.Components.Popups 0.119import Ubuntu.Components.Popups 0.1
20import Ubuntu.Components.ListItems 0.1 as ListItem20import Ubuntu.Components.ListItems 0.1 as ListItem
21import Unity 0.121import Unity 0.2
2222
23Item {23Item {
24 id: root24 id: root
@@ -27,6 +27,9 @@
27 property ListModel searchHistory27 property ListModel searchHistory
28 property Scope scope28 property Scope scope
29 property alias childItem: itemContainer.children29 property alias childItem: itemContainer.children
30 property alias showBackButton: backButton.visible
31
32 signal backClicked
3033
31 height: units.gu(8.5)34 height: units.gu(8.5)
32 implicitHeight: units.gu(8.5)35 implicitHeight: units.gu(8.5)
@@ -69,11 +72,32 @@
6972
70 Behavior on contentY { NumberAnimation { duration: 200; easing.type: Easing.OutQuad } }73 Behavior on contentY { NumberAnimation { duration: 200; easing.type: Easing.OutQuad } }
7174
75 AbstractButton {
76 id: backButton
77 visible: false
78 height: header.height
79 y: header.contentY
80 anchors {
81 left: parent.left
82 leftMargin: visible ? units.gu(2) : 0
83 }
84 width: visible ? image.width + units.gu(2) : 0
85 onClicked: root.backClicked();
86 Image {
87 id: image
88 anchors.centerIn: parent
89 source: "graphics/headerback.png"
90 }
91 }
92
72 // FIXME this could potentially be simplified to avoid all the containers93 // FIXME this could potentially be simplified to avoid all the containers
73 Item {94 Item {
74 id: headerContainer95 id: headerContainer
7596
76 width: parent.width97 anchors {
98 left: backButton.right
99 right: parent.right
100 }
77 height: childrenRect.height101 height: childrenRect.height
78102
79 Item {103 Item {
80104
=== modified file 'qml/Components/ResponsiveGridView.qml'
--- qml/Components/ResponsiveGridView.qml 2014-01-27 18:03:45 +0000
+++ qml/Components/ResponsiveGridView.qml 2014-03-07 12:41:18 +0000
@@ -56,7 +56,6 @@
56 fill: parent56 fill: parent
57 leftMargin: margin/257 leftMargin: margin/2
58 rightMargin: margin/258 rightMargin: margin/2
59 topMargin: verticalSpacing
60 }59 }
61 clip: parent.height != totalContentHeight60 clip: parent.height != totalContentHeight
6261
6362
=== modified file 'qml/Components/SeeMore.qml'
--- qml/Components/SeeMore.qml 2014-02-05 17:35:52 +0000
+++ qml/Components/SeeMore.qml 2014-03-07 12:41:18 +0000
@@ -34,7 +34,8 @@
34 objectName: "seeMoreLabel"34 objectName: "seeMoreLabel"
35 text: i18n.tr("See more")35 text: i18n.tr("See more")
36 opacity: !more ? 0.8 : 0.436 opacity: !more ? 0.8 : 0.4
37 color: Theme.palette.selected.backgroundText37 // TODO: Fix requiring Palette update
38 color: "grey" //Theme.palette.selected.backgroundText
38 font.weight: Font.Bold39 font.weight: Font.Bold
3940
40 MouseArea {41 MouseArea {
@@ -56,7 +57,8 @@
56 objectName: "seeLessLabel"57 objectName: "seeLessLabel"
57 text: i18n.tr("See less")58 text: i18n.tr("See less")
58 opacity: more ? 0.8 : 0.459 opacity: more ? 0.8 : 0.4
59 color: Theme.palette.selected.backgroundText60 // TODO: Fix requiring Palette update
61 color: "grey" //Theme.palette.selected.backgroundText
60 font.weight: Font.Bold62 font.weight: Font.Bold
6163
62 MouseArea {64 MouseArea {
6365
=== modified file 'qml/Components/Showable.qml'
--- qml/Components/Showable.qml 2013-10-01 18:18:52 +0000
+++ qml/Components/Showable.qml 2014-03-07 12:41:18 +0000
@@ -107,6 +107,9 @@
107 if (!hideAnimation.running) {107 if (!hideAnimation.running) {
108 hideAnimation.restart()108 hideAnimation.restart()
109 }109 }
110 if (__skipShowAnimation) {
111 hideAnimation.complete();
112 }
110 } else {113 } else {
111 visible = false114 visible = false
112 required = false115 required = false
@@ -115,6 +118,11 @@
115 shown = false118 shown = false
116 }119 }
117120
121 function hideNow() {
122 __skipShowAnimation = true;
123 hide();
124 }
125
118 Connections {126 Connections {
119 target: hideAnimation ? hideAnimation: null127 target: hideAnimation ? hideAnimation: null
120 onRunningChanged: {128 onRunningChanged: {
121129
=== modified file 'qml/Components/Stage.qml'
--- qml/Components/Stage.qml 2013-10-22 15:56:37 +0000
+++ qml/Components/Stage.qml 2014-03-07 12:41:18 +0000
@@ -65,7 +65,9 @@
6565
66 function activateApplication(desktopFile, addDelay) {66 function activateApplication(desktopFile, addDelay) {
67 var application = applicationManager.getApplicationFromDesktopFile(desktopFile, stage.type);67 var application = applicationManager.getApplicationFromDesktopFile(desktopFile, stage.type);
68 if (application != null && application == stage.focusedApplication) {68 if (application == null) {
69 return;
70 } else if (application == stage.focusedApplication) {
69 stage.show();71 stage.show();
70 return;72 return;
71 }73 }
@@ -84,11 +86,6 @@
84 }86 }
85 }87 }
8688
87 Connections {
88 target: applicationManager
89 onFocusRequested: activateApplication(appId)
90 }
91
92 /* Keep a reference to the focused application so that we can safely89 /* Keep a reference to the focused application so that we can safely
93 unfocus it when the stage is not fully shown and refocus it when the stage90 unfocus it when the stage is not fully shown and refocus it when the stage
94 is fully shown again.91 is fully shown again.
@@ -142,6 +139,14 @@
142 }139 }
143 }140 }
144141
142 Timer {
143 id: hideScreenshotsAfterBriefDelay
144 // Since Mir & Qt have independent event loops, Mir often applies a focus request a frame later than when Qt
145 // asks for it. To work around, delay removing the screenshots a touch so Mir has definitely shown the app.
146 interval: 10
147 onTriggered: stage.__hideScreenshots();
148 }
149
145 function __hideScreenshots() {150 function __hideScreenshots() {
146 newApplicationScreenshot.clearApplication();151 newApplicationScreenshot.clearApplication();
147 oldApplicationScreenshot.clearApplication();152 oldApplicationScreenshot.clearApplication();
@@ -177,7 +182,7 @@
177 applicationManager.focusApplication(application);182 applicationManager.focusApplication(application);
178 }183 }
179 if (!delayedHideScreenshots.running) {184 if (!delayedHideScreenshots.running) {
180 stage.__hideScreenshots();185 hideScreenshotsAfterBriefDelay.start();
181 }186 }
182 } else {187 } else {
183 /* FIXME: calling ApplicationManager::focusApplication does not focus188 /* FIXME: calling ApplicationManager::focusApplication does not focus
@@ -252,7 +257,7 @@
252 delayedHideScreenshots.start();257 delayedHideScreenshots.start();
253 } else {258 } else {
254 stage.focusedApplicationWhenUsingScreenshots = null;259 stage.focusedApplicationWhenUsingScreenshots = null;
255 stage.__hideScreenshots();260 hideScreenshotsAfterBriefDelay.start();
256 }261 }
257 }262 }
258 }263 }
259264
=== added file 'qml/Components/graphics/headerback@27.png'
260Binary files qml/Components/graphics/headerback@27.png 1970-01-01 00:00:00 +0000 and qml/Components/graphics/headerback@27.png 2014-03-07 12:41:18 +0000 differ265Binary files qml/Components/graphics/headerback@27.png 1970-01-01 00:00:00 +0000 and qml/Components/graphics/headerback@27.png 2014-03-07 12:41:18 +0000 differ
=== modified file 'qml/Dash/Apps/RunningApplicationTile.qml'
--- qml/Dash/Apps/RunningApplicationTile.qml 2013-10-28 14:12:24 +0000
+++ qml/Dash/Apps/RunningApplicationTile.qml 2014-03-07 12:41:18 +0000
@@ -108,10 +108,9 @@
108 }108 }
109 text: (application) ? application.name : ""109 text: (application) ? application.name : ""
110110
111 color: Theme.palette.selected.backgroundText111 // TODO karni (for each Label): Update Ubuntu.Components.Themes.Palette and use theme color instead
112 color: "grey"
112 opacity: 0.9113 opacity: 0.9
113 style: Text.Raised
114 styleColor: "black"
115 fontSize: "small"114 fontSize: "small"
116 elide: Text.ElideMiddle115 elide: Text.ElideMiddle
117 horizontalAlignment: Text.AlignHCenter116 horizontalAlignment: Text.AlignHCenter
118117
=== modified file 'qml/Dash/Card.qml'
--- qml/Dash/Card.qml 2014-02-28 10:45:19 +0000
+++ qml/Dash/Card.qml 2014-03-07 12:41:18 +0000
@@ -17,7 +17,7 @@
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
1919
20Item {20AbstractButton {
21 id: root21 id: root
22 property var template22 property var template
23 property var components23 property var components
@@ -25,7 +25,7 @@
2525
26 property alias fontScale: header.fontScale26 property alias fontScale: header.fontScale
27 property alias headerAlignment: header.headerAlignment27 property alias headerAlignment: header.headerAlignment
28 readonly property alias headerHeight: header.height28 property alias headerHeight: header.height
2929
30 property bool showHeader: true30 property bool showHeader: true
3131
@@ -87,6 +87,7 @@
87 height: template && template["card-layout"] === "horizontal" ? header.height : width / artShape.aspect87 height: template && template["card-layout"] === "horizontal" ? header.height : width / artShape.aspect
88 objectName: "artImage"88 objectName: "artImage"
89 source: cardData && cardData["art"] || ""89 source: cardData && cardData["art"] || ""
90 cache: true
90 // FIXME uncomment when having investigated / fixed the crash91 // FIXME uncomment when having investigated / fixed the crash
91 //sourceSize.width: width > height ? width : 092 //sourceSize.width: width > height ? width : 0
92 //sourceSize.height: height > width ? height : 093 //sourceSize.height: height > width ? height : 0
@@ -163,6 +164,9 @@
163 titleWeight: components && components["subtitle"] ? Font.DemiBold : Font.Normal164 titleWeight: components && components["subtitle"] ? Font.DemiBold : Font.Normal
164165
165 opacity: showHeader ? 1 : 0166 opacity: showHeader ? 1 : 0
167 inOverlay: root.template && root.template["overlay"] === true
168 fontColor: inOverlay ? "white" : summary.color
169 useMascotShape: !background.visible && !inOverlay
166170
167 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }171 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
168 }172 }
@@ -183,5 +187,17 @@
183 text: cardData && cardData["summary"] || ""187 text: cardData && cardData["summary"] || ""
184 height: text ? implicitHeight : 0188 height: text ? implicitHeight : 0
185 fontSize: "small"189 fontSize: "small"
190 color: getFontColor(background.color)
191
192 function getLuminance(color) {
193 return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b;
194 }
195
196 // TODO karni: Change "grey" to Ubuntu.Components.Palette color once updated.
197 function getFontColor(backgroundColor) {
198 if (backgroundColor === undefined) return "grey";
199 var luminance = getLuminance(backgroundColor);
200 return luminance < 0.7 ? "white" : "grey"
201 }
186 }202 }
187}203}
188204
=== added file 'qml/Dash/CardCarousel.qml'
--- qml/Dash/CardCarousel.qml 1970-01-01 00:00:00 +0000
+++ qml/Dash/CardCarousel.qml 2014-03-07 12:41:18 +0000
@@ -0,0 +1,78 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import "../Components"
20
21
22DashRenderer {
23 id: cardCarousel
24
25 property alias cacheBuffer: carousel.cacheBuffer
26 property alias itemComponent: carousel.itemComponent
27 property alias minimumTileWidth: carousel.minimumTileWidth
28 property alias selectedItemScaleFactor: carousel.selectedItemScaleFactor
29 property alias tileAspectRatio: carousel.tileAspectRatio
30
31 currentItem: carousel.currentItem
32 height: carousel.implicitHeight + units.gu(6)
33 verticalSpacing: units.gu(3)
34
35 CardTool {
36 id: cardTool
37
38 template: cardCarousel.template
39 components: cardCarousel.components
40 viewWidth: cardCarousel.width
41 }
42
43 Carousel {
44 id: carousel
45 anchors.fill: parent
46 tileAspectRatio: cardCarousel.components && cardCarousel.components["art"]["aspect-ratio"] || 1.0
47 // FIXME we need to "reverse" the carousel to make the selected item the size
48 // and push others back.
49 minimumTileWidth: cardTool.cardWidth / selectedItemScaleFactor
50 selectedItemScaleFactor: 1.38
51 cacheBuffer: 1404 // 18px * 13gu * 6
52 model: cardCarousel.model
53 highlightIndex: cardCarousel.highlightIndex
54
55 onClicked: cardCarousel.clicked(index, itemY)
56 onPressAndHold: cardCarousel.pressAndHold(index, itemY)
57
58 property real fontScale: 1 / selectedItemScaleFactor
59 property real headerHeight: cardTool.headerHeight / selectedItemScaleFactor
60
61 itemComponent: Card {
62 id: card
63 objectName: "delegate" + index
64 headerHeight: carousel.headerHeight
65 cardData: model
66 template: cardCarousel.template
67 components: cardCarousel.components
68
69 property bool explicitlyScaled
70 property var model
71
72 enabled: false
73 showHeader: explicitlyScaled
74
75 fontScale: carousel.fontScale
76 }
77 }
78}
079
=== added file 'qml/Dash/CardFilterGrid.qml'
--- qml/Dash/CardFilterGrid.qml 1970-01-01 00:00:00 +0000
+++ qml/Dash/CardFilterGrid.qml 2014-03-07 12:41:18 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20DashFilterGrid {
21 id: genericFilterGrid
22
23 minimumHorizontalSpacing: units.gu(1)
24 delegateWidth: cardTool.cardWidth
25 delegateHeight: cardTool.cardHeight
26 verticalSpacing: units.gu(1)
27 collapsedRowCount: Math.min(2, template && template["collapsed-rows"] || 2)
28
29 CardTool {
30 id: cardTool
31
32 template: genericFilterGrid.template
33 // We can't trust the template since it may happen it is carousel
34 // that is being should as a grid because of the lack of elements
35 categoryLayout: "grid"
36 components: genericFilterGrid.components
37 }
38
39 delegate: Item {
40 width: genericFilterGrid.cellWidth
41 height: genericFilterGrid.cellHeight
42 Card {
43 id: card
44 width: cardTool.cardWidth
45 height: cardTool.cardHeight
46 headerHeight: cardTool.headerHeight
47 anchors.horizontalCenter: parent.horizontalCenter
48 objectName: "delegate" + index
49 cardData: model
50 template: genericFilterGrid.template
51 components: genericFilterGrid.components
52
53 headerAlignment: cardTool.headerAlignment
54
55 onClicked: genericFilterGrid.clicked(index, card.y)
56 onPressAndHold: genericFilterGrid.pressAndHold(index, card.y)
57 }
58 }
59}
060
=== modified file 'qml/Dash/CardHeader.qml'
--- qml/Dash/CardHeader.qml 2014-02-21 10:50:36 +0000
+++ qml/Dash/CardHeader.qml 2014-03-07 12:41:18 +0000
@@ -27,12 +27,17 @@
27 property alias altPrice: altPriceLabel.text27 property alias altPrice: altPriceLabel.text
2828
29 property alias titleWeight: titleLabel.font.weight29 property alias titleWeight: titleLabel.font.weight
30 property alias titleSize: titleLabel.fontSize
3031
31 // FIXME: Saviq, used to scale fonts down in Carousel32 // FIXME: Saviq, used to scale fonts down in Carousel
32 property real fontScale: 1.033 property real fontScale: 1.0
3334
34 property alias headerAlignment: titleLabel.horizontalAlignment35 property alias headerAlignment: titleLabel.horizontalAlignment
3536
37 property bool inOverlay: false
38 property bool useMascotShape: true
39 property color fontColor: "grey"
40
36 visible: mascotImage.status === Image.Ready || title || price41 visible: mascotImage.status === Image.Ready || title || price
37 height: row.height > 0 ? row.height + row.margins * 2 : 042 height: row.height > 0 ? row.height + row.margins * 2 : 0
3843
@@ -42,13 +47,13 @@
4247
43 property real margins: units.gu(1)48 property real margins: units.gu(1)
4449
50 spacing: mascotShape.visible || mascotImage.visible || inOverlay ? margins : 0
45 anchors {51 anchors {
46 top: parent.top; left: parent.left; right: parent.right52 top: parent.top; left: parent.left; right: parent.right
47 margins: margins53 margins: margins
48 leftMargin: spacing54 leftMargin: spacing
49 rightMargin: spacing55 rightMargin: spacing
50 }56 }
51 spacing: mascotShape.visible || (template && template["overlay"]) ? margins : 0
5257
53 UbuntuShape {58 UbuntuShape {
54 id: mascotShape59 id: mascotShape
@@ -57,35 +62,44 @@
57 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.62 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
58 width: units.gu(6)63 width: units.gu(6)
59 height: units.gu(5.625)64 height: units.gu(5.625)
60 visible: image.status === Image.Ready65 anchors.verticalCenter: parent.verticalCenter
61 readonly property int maxSize: Math.max(width, height)66 visible: useMascotShape && image && image.status === Image.Ready
6267 readonly property int maxSize: Math.max(width, height) * 4
63 image: Image {68
64 id: mascotImage69 image: useMascotShape ? mascotImage : null
6570 }
66 sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }71
67 fillMode: Image.PreserveAspectCrop72 Image {
68 horizontalAlignment: Image.AlignHCenter73 id: mascotImage
69 verticalAlignment: Image.AlignVCenter74
70 }75 width: source ? mascotShape.width : 0
76 height: mascotShape.height
77 anchors.verticalCenter: parent.verticalCenter
78 visible: !useMascotShape && status === Image.Ready
79
80 sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
81 fillMode: Image.PreserveAspectCrop
82 horizontalAlignment: Image.AlignHCenter
83 verticalAlignment: Image.AlignVCenter
71 }84 }
7285
73 Column {86 Column {
74 objectName: "column"87 objectName: "column"
75 width: parent.width - x88 width: parent.width - x
76 spacing: units.gu(0.5)89 spacing: units.gu(0.25)
90 anchors.verticalCenter: parent.verticalCenter
7791
78 Label {92 Label {
79 id: titleLabel93 id: titleLabel
80 objectName: "titleLabel"94 objectName: "titleLabel"
81 anchors { left: parent.left; right: parent.right }95 anchors { left: parent.left; right: parent.right }
82 elide: Text.ElideRight96 elide: Text.ElideRight
83 font.weight: Font.DemiBold97 font.weight: Font.Normal
98 fontSize: "small"
84 wrapMode: Text.Wrap99 wrapMode: Text.Wrap
85 maximumLineCount: 2100 maximumLineCount: 2
86 fontSize: "small"
87 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)101 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
88 color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText102 color: fontColor
89 }103 }
90104
91 Label {105 Label {
@@ -93,11 +107,11 @@
93 objectName: "subtitleLabel"107 objectName: "subtitleLabel"
94 anchors { left: parent.left; right: parent.right }108 anchors { left: parent.left; right: parent.right }
95 elide: Text.ElideRight109 elide: Text.ElideRight
110 fontSize: "small"
96 font.weight: Font.Light111 font.weight: Font.Light
97 visible: titleLabel.text && text112 visible: titleLabel.text && text
98 fontSize: "x-small"
99 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)113 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
100 color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText114 color: fontColor
101 }115 }
102116
103 Row {117 Row {
@@ -118,7 +132,7 @@
118 width: parent.labelWidth132 width: parent.labelWidth
119 elide: Text.ElideRight133 elide: Text.ElideRight
120 font.weight: Font.DemiBold134 font.weight: Font.DemiBold
121 color: Theme.palette.selected.foreground135 color: "#ff990000"
122 visible: text136 visible: text
123 }137 }
124138
@@ -128,6 +142,8 @@
128 width: parent.labelWidth142 width: parent.labelWidth
129 elide: Text.ElideRight143 elide: Text.ElideRight
130 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight144 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
145 font.strikeout: true
146 color: "black"
131 visible: text147 visible: text
132 }148 }
133149
@@ -136,6 +152,7 @@
136 width: parent.labelWidth152 width: parent.labelWidth
137 elide: Text.ElideRight153 elide: Text.ElideRight
138 horizontalAlignment: Text.AlignRight154 horizontalAlignment: Text.AlignRight
155 color: fontColor
139 visible: text156 visible: text
140 }157 }
141 }158 }
142159
=== modified file 'qml/Dash/CardTool.qml'
--- qml/Dash/CardTool.qml 2014-02-07 14:45:19 +0000
+++ qml/Dash/CardTool.qml 2014-03-07 12:41:18 +0000
@@ -43,6 +43,11 @@
43 */43 */
44 property var viewWidth44 property var viewWidth
4545
46 /*!
47 \brief The category layout for this card tool
48 */
49 property string categoryLayout: template ? template["category-layout"] : ""
50
46 // FIXME: Saviq51 // FIXME: Saviq
47 // Only way for the card below to actually be laid out completely.52 // Only way for the card below to actually be laid out completely.
48 // If invisible or in "data" array, some components are not taken into account.53 // If invisible or in "data" array, some components are not taken into account.
@@ -56,7 +61,7 @@
56 If undefined, should use implicit width of the actual card.61 If undefined, should use implicit width of the actual card.
57 */62 */
58 readonly property var cardWidth: {63 readonly property var cardWidth: {
59 switch (template !== undefined && template["category-layout"]) {64 switch (categoryLayout) {
60 case "grid":65 case "grid":
61 case "vertical-journal":66 case "vertical-journal":
62 if (template["card-layout"] === "horizontal") return units.gu(38);67 if (template["card-layout"] === "horizontal") return units.gu(38);
@@ -84,7 +89,7 @@
84 If undefined, should use implicit height of the actual card.89 If undefined, should use implicit height of the actual card.
85 */90 */
86 readonly property var cardHeight: {91 readonly property var cardHeight: {
87 switch (template !== undefined && template["category-layout"]) {92 switch (categoryLayout) {
88 case "journal":93 case "journal":
89 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);94 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);
90 return units.gu(18.5);95 return units.gu(18.5);
9196
=== modified file 'qml/Dash/Dash.qml'
--- qml/Dash/Dash.qml 2014-02-18 11:54:25 +0000
+++ qml/Dash/Dash.qml 2014-03-07 12:41:18 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013, 2014 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Unity 0.119import Unity 0.2
20import Utils 0.120import Utils 0.1
21import "../Components"21import "../Components"
2222
@@ -27,8 +27,9 @@
27 visible: shown27 visible: shown
2828
29 property ListModel searchHistory: SearchHistoryModel {}29 property ListModel searchHistory: SearchHistoryModel {}
30 property bool searchable: !dashContent.previewOpen && !scopeItem.previewOpen
3031
31 property string showScopeOnLoaded: "home.scope"32 property string showScopeOnLoaded: "clickscope"
32 property real contentScale: 1.033 property real contentScale: 1.0
3334
34 function setCurrentScope(scopeId, animate, reset) {35 function setCurrentScope(scopeId, animate, reset) {
@@ -39,6 +40,8 @@
39 return40 return
40 }41 }
4142
43 dashContent.closePreview();
44
42 if (scopeIndex == dashContent.currentIndex && !reset) {45 if (scopeIndex == dashContent.currentIndex && !reset) {
43 // the scope is already the current one46 // the scope is already the current one
44 return47 return
@@ -61,10 +64,19 @@
61 DashContent {64 DashContent {
62 id: dashContent65 id: dashContent
63 objectName: "dashContent"66 objectName: "dashContent"
64 anchors.fill: parent67 width: parent.width
68 height: parent.height
65 model: filteredScopes69 model: filteredScopes
66 scopes: scopes70 scopes: scopes
67 searchHistory: dash.searchHistory71 searchHistory: dash.searchHistory
72 visible: x != -width
73 onGotoScope: {
74 dash.setCurrentScope(scopeId, true, false);
75 }
76 onOpenScope: {
77 scopeItem.scope = scope;
78 x = -width;
79 }
68 onScopeLoaded: {80 onScopeLoaded: {
69 if (scopeId == dash.showScopeOnLoaded) {81 if (scopeId == dash.showScopeOnLoaded) {
70 dash.setCurrentScope(scopeId, false, false)82 dash.setCurrentScope(scopeId, false, false)
@@ -72,6 +84,39 @@
72 }84 }
73 }85 }
74 scale: dash.contentScale86 scale: dash.contentScale
87 clip: scale != 1.0 || scopeItem.visible
88 Behavior on x {
89 UbuntuNumberAnimation {
90 onRunningChanged: {
91 if (!running && dashContent.x == 0) {
92 dashContent.closeScope(scopeItem.scope);
93 scopeItem.scope = null;
94 }
95 }
96 }
97 }
98 }
99
100 ScopeItem {
101 id: scopeItem
102 anchors.left: dashContent.right
103 width: parent.width
104 height: parent.height
105 searchHistory: dash.searchHistory
106 scale: dash.contentScale
75 clip: scale != 1.0107 clip: scale != 1.0
108 visible: scope != null
109 onBack: {
110 dashContent.x = 0;
111 }
112 onGotoScope: {
113 // TODO
114 console.log("gotoScope from an openScope scope is not implemented");
115 }
116 onOpenScope: {
117 // TODO
118 console.log("openScope from an openScope scope is not implemented");
119 }
120
76 }121 }
77}122}
78123
=== modified file 'qml/Dash/DashApps.qml'
--- qml/Dash/DashApps.qml 2013-12-02 13:23:28 +0000
+++ qml/Dash/DashApps.qml 2014-03-07 12:41:18 +0000
@@ -29,28 +29,13 @@
29 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications29 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
30 property var sideStageApplicationModel: shell.applicationManager.sideStageApplications30 property var sideStageApplicationModel: shell.applicationManager.sideStageApplications
3131
32 ListModel {32 QtObject {
33 id: dummyVisibilityModifier33 id: countObject
3434 property int count: scopeView.scope.searchQuery.length == 0 ? (mainStageApplicationsModel.count + sideStageApplicationModel.count) : 0
35 ListElement { name: "running-apps" }
36 }
37
38 SortFilterProxyModel {
39 id: runningApplicationsModel
40
41 property var firstModel: mainStageApplicationsModel
42 property var secondModel: sideStageApplicationModel
43 property bool canEnableTerminationMode: scopeView.isCurrent
44
45 model: dummyVisibilityModifier
46 filterRole: 0
47 filterRegExp: invertMatch ? ((mainStageApplicationsModel.count === 0 &&
48 sideStageApplicationModel.count === 0) ? RegExp("running-apps") : RegExp("")) : RegExp("disabled")
49 invertMatch: scopeView.scope.searchQuery.length == 0
50 }35 }
5136
52 onScopeChanged: {37 onScopeChanged: {
53 scopeView.scope.categories.overrideResults("recent", runningApplicationsModel);38 scopeView.scope.categories.addSpecialCategory("running.apps.category", "Recent", "", "{ \"template\": { \"category-layout\": \"running-apps\" } }", countObject);
54 enableHeightBehaviorOnNextCreation = (mainStageApplicationsModel.count + sideStageApplicationModel.count == 0)39 enableHeightBehaviorOnNextCreation = (mainStageApplicationsModel.count + sideStageApplicationModel.count == 0)
55 }40 }
56}41}
5742
=== modified file 'qml/Dash/DashContent.qml'
--- qml/Dash/DashContent.qml 2014-02-18 11:54:25 +0000
+++ qml/Dash/DashContent.qml 2014-03-07 12:41:18 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013, 2014 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Unity 0.119import Unity 0.2
20import "../Components"20import "../Components"
2121
22Item {22Item {
@@ -25,6 +25,7 @@
25 property var model: null25 property var model: null
26 property var scopes: null26 property var scopes: null
27 property alias currentIndex: dashContentList.currentIndex27 property alias currentIndex: dashContentList.currentIndex
28 property alias previewOpen: previewListView.open
2829
29 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}30 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}
30 property ListModel searchHistory31 property ListModel searchHistory
@@ -33,6 +34,8 @@
33 signal movementEnded()34 signal movementEnded()
34 signal scopeLoaded(string scopeId)35 signal scopeLoaded(string scopeId)
35 signal positionedAtBeginning()36 signal positionedAtBeginning()
37 signal gotoScope(string scopeId)
38 signal openScope(var scope)
3639
37 // If we set the current scope index before the scopes have been added,40 // If we set the current scope index before the scopes have been added,
38 // then we need to wait until the loaded signals gets emitted from the scopes41 // then we need to wait until the loaded signals gets emitted from the scopes
@@ -77,15 +80,27 @@
77 }80 }
78 }81 }
7982
83 function closeScope(scope) {
84 dashContentList.currentItem.theScope.closeScope(scope)
85 }
86
87 function closePreview() {
88 previewListView.open = false;
89 }
90
80 Item {91 Item {
81 id: dashContentListHolder92 id: dashContentListHolder
82 anchors.fill: parent93
94 x: previewListView.open ? -width : 0
95 Behavior on x { UbuntuNumberAnimation { } }
96 width: parent.width
97 height: parent.height
8398
84 ListView {99 ListView {
85 id: dashContentList100 id: dashContentList
86 objectName: "dashContentList"101 objectName: "dashContentList"
87102
88 interactive: dashContent.scopes.loaded && !previewListView.onScreen && !currentItem.moving103 interactive: dashContent.scopes.loaded && !previewListView.open && !currentItem.moving
89104
90 anchors.fill: parent105 anchors.fill: parent
91 model: dashContent.model106 model: dashContent.model
@@ -100,6 +115,7 @@
100 cacheBuffer: 1073741823115 cacheBuffer: 1073741823
101 onMovementStarted: dashContent.movementStarted()116 onMovementStarted: dashContent.movementStarted()
102 onMovementEnded: dashContent.movementEnded()117 onMovementEnded: dashContent.movementEnded()
118 clip: parent.x != 0
103119
104 // If the number of items is less than the current index, then need to reset to another item.120 // If the number of items is less than the current index, then need to reset to another item.
105 onCountChanged: {121 onCountChanged: {
@@ -133,21 +149,30 @@
133 onLoaded: {149 onLoaded: {
134 item.scope = Qt.binding(function() { return scope })150 item.scope = Qt.binding(function() { return scope })
135 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })151 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
136 item.tabBarHeight = pageHeader.implicitHeight;152 item.tabBarHeight = dashPageHeader.implicitHeight;
137 item.pageHeader = pageHeader;153 item.pageHeader = dashPageHeader;
138 item.openEffect = openEffect;
139 item.previewListView = previewListView;154 item.previewListView = previewListView;
140 dashContentList.movementStarted.connect(item.movementStarted)155 dashContentList.movementStarted.connect(item.movementStarted)
141 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)156 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
142 dashContent.scopeLoaded(item.scope.id)157 dashContent.scopeLoaded(item.scope.id)
143 }158 }
159 Connections {
160 target: isCurrent ? scope : null
161 onGotoScope: {
162 // Note here scopeId is the signal parameter and not the loader property
163 dashContent.gotoScope(scopeId);
164 }
165 onOpenScope: {
166 dashContent.openScope(scope);
167 }
168 }
144169
145 Component.onDestruction: active = false170 Component.onDestruction: active = false
146 }171 }
147 }172 }
148173
149 PageHeader {174 PageHeader {
150 id: pageHeader175 id: dashPageHeader
151 objectName: "pageHeader"176 objectName: "pageHeader"
152 width: parent.width177 width: parent.width
153 searchEntryEnabled: true178 searchEntryEnabled: true
@@ -157,12 +182,16 @@
157 childItem: TabBar {182 childItem: TabBar {
158 id: tabBar183 id: tabBar
159 objectName: "tabbar"184 objectName: "tabbar"
160 height: units.gu(7)185 height: units.gu(6.5)
161 width: parent.width186 width: parent.width
162 selectionMode: false187 selectionMode: false
163 style: DashContentTabBarStyle {}188 style: DashContentTabBarStyle {}
164189
165 model: dashContentList.model190 // TODO This together with the __styleInstance onModelChanged below
191 // are a workaround for the first tab sometimes not showing the text.
192 // But Tabs are going away in the future so not sure if makes
193 // sense invetigating what's the problem at this stage
194 model: dashContentList.model.count > 0 ? dashContentList.model : null
166195
167 onSelectedIndexChanged: {196 onSelectedIndexChanged: {
168 dashContentList.currentIndex = selectedIndex;197 dashContentList.currentIndex = selectedIndex;
@@ -176,36 +205,23 @@
176 }205 }
177206
178 Connections {207 Connections {
179 target: model208 target: __styleInstance
180 onCountChanged: {209 onModelChanged: {
181 if (tabBar.selectedIndex < 0 && model.count > 0)210 tabBar.selectedIndex = -1;
182 tabBar.selectedIndex = 0;211 tabBar.selectedIndex = 0;
183 }212 }
184 }213 }
185
186 Component.onCompleted: {
187 __styleInstance.headerTextStyle = Text.Raised
188 __styleInstance.headerTextStyleColor = "black"
189 }
190 }214 }
191 }215 }
192 }216 }
193217
194 DashContentOpenEffect {
195 id: openEffect
196 anchors {
197 fill: parent
198 bottomMargin: -bottomOverflow
199 }
200 sourceItem: dashContentListHolder
201 previewListView: previewListView
202 }
203
204 PreviewListView {218 PreviewListView {
205 id: previewListView219 id: previewListView
206 openEffect: openEffect220 visible: x != width
207 categoryView: dashContentList.currentItem ? dashContentList.currentItem.categoryView : null
208 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null221 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
209 anchors.fill: parent222 pageHeader: dashPageHeader
223 width: parent.width
224 height: parent.height
225 anchors.left: dashContentListHolder.right
210 }226 }
211}227}
212228
=== removed file 'qml/Dash/DashContentOpenEffect.qml'
--- qml/Dash/DashContentOpenEffect.qml 2013-11-05 16:06:09 +0000
+++ qml/Dash/DashContentOpenEffect.qml 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import "../Components"
20
21OpenEffect {
22 property PreviewListView previewListView: null
23
24 objectName: "openEffect"
25 anchors {
26 fill: parent
27 bottomMargin: -bottomOverflow
28 }
29
30 enabled: gap > 0.0
31
32 topGapPx: (1 - gap) * positionPx
33 topOpacity: (1 - gap * 1.2)
34 bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx)
35 bottomOverflow: units.gu(20)
36 live: !expansionAnimation.running
37
38 property int targetBottomGapPx: height - units.gu(8) - bottomOverflow
39 property real gap: previewListView.open ? 1.0 : 0.0
40
41 Behavior on gap {
42 NumberAnimation {
43 id: expansionAnimation
44 duration: 200
45 easing.type: Easing.InOutQuad
46 onRunningChanged: {
47 if (!previewListView.open && !running) {
48 previewListView.onScreen = false
49 }
50 }
51 }
52 }
53 Behavior on positionPx {
54 enabled: previewListView.open
55 UbuntuNumberAnimation {}
56 }
57}
580
=== modified file 'qml/Dash/DashContentTabBarStyle.qml'
--- qml/Dash/DashContentTabBarStyle.qml 2013-12-02 15:58:26 +0000
+++ qml/Dash/DashContentTabBarStyle.qml 2014-03-07 12:41:18 +0000
@@ -18,4 +18,7 @@
1818
19TabBarStyle {19TabBarStyle {
20 indicatorImageSource: "graphics/tabbarchevron.png"20 indicatorImageSource: "graphics/tabbarchevron.png"
21 // TODO karni: These should come from updated Ubuntu Palette.
22 headerTextColor: "#88888888"
23 headerTextSelectedColor: "#888888"
21}24}
2225
=== modified file 'qml/Dash/DashFilterGrid.qml'
--- qml/Dash/DashFilterGrid.qml 2013-12-10 15:39:51 +0000
+++ qml/Dash/DashFilterGrid.qml 2014-03-07 12:41:18 +0000
@@ -26,11 +26,14 @@
26 property alias delegate: filterGrid.delegate26 property alias delegate: filterGrid.delegate
27 property alias delegateWidth: filterGrid.delegateWidth27 property alias delegateWidth: filterGrid.delegateWidth
28 property alias delegateHeight: filterGrid.delegateHeight28 property alias delegateHeight: filterGrid.delegateHeight
29 property alias verticalSpacing: filterGrid.verticalSpacing
29 property alias maximumNumberOfColumns: filterGrid.maximumNumberOfColumns30 property alias maximumNumberOfColumns: filterGrid.maximumNumberOfColumns
30 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing31 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
32 property alias collapsedRowCount: filterGrid.collapsedRowCount
33
34 property FilterGrid grid: filterGrid
3135
32 collapsedHeight: filterGrid.collapsedHeight36 collapsedHeight: filterGrid.collapsedHeight
33 collapsedRowCount: filterGrid.collapsedRowCount
34 columns: filterGrid.columns37 columns: filterGrid.columns
35 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount38 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
36 currentItem: filterGrid.currentItem39 currentItem: filterGrid.currentItem
@@ -38,7 +41,6 @@
38 height: filterGrid.height41 height: filterGrid.height
39 margins: filterGrid.margins42 margins: filterGrid.margins
40 uncollapsedHeight: filterGrid.uncollapsedHeight43 uncollapsedHeight: filterGrid.uncollapsedHeight
41 verticalSpacing: filterGrid.verticalSpacing
4244
43 function startFilterAnimation(filter) {45 function startFilterAnimation(filter) {
44 filterGrid.startFilterAnimation(filter)46 filterGrid.startFilterAnimation(filter)
4547
=== modified file 'qml/Dash/DashPreviewPlaceholder.qml'
--- qml/Dash/DashPreviewPlaceholder.qml 2013-09-30 12:17:20 +0000
+++ qml/Dash/DashPreviewPlaceholder.qml 2014-03-07 12:41:18 +0000
@@ -20,6 +20,6 @@
20DashPreview {20DashPreview {
21 ActivityIndicator {21 ActivityIndicator {
22 anchors.centerIn: parent22 anchors.centerIn: parent
23 running: true23 running: visible
24 }24 }
25}25}
2626
=== modified file 'qml/Dash/DashRenderer.qml'
--- qml/Dash/DashRenderer.qml 2013-12-10 15:39:51 +0000
+++ qml/Dash/DashRenderer.qml 2014-03-07 12:41:18 +0000
@@ -62,4 +62,10 @@
6262
63 function startFilterAnimation(filter) {63 function startFilterAnimation(filter) {
64 }64 }
65
66 /// Category template definition from the scope
67 property var template
68
69 /// Component mapping and configuration from the scope
70 property var components
65}71}
6672
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2014-02-28 10:46:49 +0000
+++ qml/Dash/GenericScopeView.qml 2014-03-07 12:41:18 +0000
@@ -17,7 +17,7 @@
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Utils 0.119import Utils 0.1
20import Unity 0.120import Unity 0.2
21import "../Components"21import "../Components"
22import "../Components/ListItems" as ListItems22import "../Components/ListItems" as ListItems
2323
@@ -30,7 +30,6 @@
30 property alias moving: categoryView.moving30 property alias moving: categoryView.moving
31 property int tabBarHeight: 031 property int tabBarHeight: 0
32 property PageHeader pageHeader: null32 property PageHeader pageHeader: null
33 property OpenEffect openEffect: null
34 property Item previewListView: null33 property Item previewListView: null
3534
36 signal movementStarted35 signal movementStarted
@@ -55,7 +54,7 @@
55 Binding {54 Binding {
56 target: scope55 target: scope
57 property: "isActive"56 property: "isActive"
58 value: isCurrent && !previewListView.onScreen57 value: isCurrent && !previewListView.open
59 }58 }
6059
61 Timer {60 Timer {
@@ -115,10 +114,9 @@
115 objectName: "categoryListView"114 objectName: "categoryListView"
116 anchors.fill: parent115 anchors.fill: parent
117 model: scopeView.categories116 model: scopeView.categories
118 forceNoClip: previewListView.onScreen117 forceNoClip: previewListView.open
119118
120 property string expandedCategoryId: ""119 property string expandedCategoryId: ""
121 signal correctExpandedCategory();
122120
123 onContentYChanged: pageHeader.positionRealHeader();121 onContentYChanged: pageHeader.positionRealHeader();
124 onOriginYChanged: pageHeader.positionRealHeader();122 onOriginYChanged: pageHeader.positionRealHeader();
@@ -133,6 +131,7 @@
133 id: baseItem131 id: baseItem
134 objectName: "dashCategory" + category132 objectName: "dashCategory" + category
135 highlightWhenPressed: false133 highlightWhenPressed: false
134 showDivider: false
136135
137 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false136 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
138 readonly property bool filtered: rendererLoader.item ? rendererLoader.item.filter : true137 readonly property bool filtered: rendererLoader.item ? rendererLoader.item.filter : true
@@ -147,7 +146,7 @@
147 right: parent.right146 right: parent.right
148 }147 }
149148
150 source: getRenderer(model.renderer, model.contentType, model.rendererHint, results)149 source: getRenderer(model.renderer, results)
151150
152 onLoaded: {151 onLoaded: {
153 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {152 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
@@ -155,9 +154,10 @@
155 scopeView.enableHeightBehaviorOnNextCreation = false;154 scopeView.enableHeightBehaviorOnNextCreation = false;
156 }155 }
157 if (source.toString().indexOf("Apps/RunningApplicationsGrid.qml") != -1) {156 if (source.toString().indexOf("Apps/RunningApplicationsGrid.qml") != -1) {
158 // TODO: the running apps grid doesn't support standard scope results model yet157 // TODO: this is still a kludge :D Ideally add some kind of hook so that we
159 item.firstModel = Qt.binding(function() { return results.firstModel })158 // can do this from DashApps.qml or think a better way that needs no special casing
160 item.secondModel = Qt.binding(function() { return results.secondModel })159 item.firstModel = Qt.binding(function() { return mainStageApplicationsModel })
160 item.secondModel = Qt.binding(function() { return sideStageApplicationModel })
161 item.canEnableTerminationMode = Qt.binding(function() { return scopeView.isCurrent })161 item.canEnableTerminationMode = Qt.binding(function() { return scopeView.isCurrent })
162 } else {162 } else {
163 item.model = Qt.binding(function() { return results })163 item.model = Qt.binding(function() { return results })
@@ -170,6 +170,9 @@
170 }170 }
171 }171 }
172 updateDelegateCreationRange();172 updateDelegateCreationRange();
173 // FIXME: should be "template", not "renderer"
174 item.template = Qt.binding(function() { return model.renderer });
175 item.components = Qt.binding(function() { return model.components });
173 }176 }
174177
175 Component.onDestruction: {178 Component.onDestruction: {
@@ -181,39 +184,24 @@
181 Connections {184 Connections {
182 target: rendererLoader.item185 target: rendererLoader.item
183 onClicked: {186 onClicked: {
184 // Prepare the preview in case activate() triggers a preview only187 if (scopeView.scope.id === "scopes" || (scopeView.scope.id == "clickscope" && categoryId == "local")) {
185 openEffect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight);188 // TODO Technically it is possible that calling activate() will make the scope emit
186 previewListView.categoryId = categoryId189 // previewRequested so that we show a preview but there's no scope that does that yet
187 previewListView.categoryDelegate = rendererLoader.item190 // so it's not implemented
188 previewListView.model = target.model;191 var item = target.model.get(index);
189 previewListView.init = true;192 scopeView.scope.activate(item.result)
190 previewListView.currentIndex = index;
191
192 var item = target.model.get(index);
193
194 if ((scopeView.scope.id == "applications.scope" && categoryId == "installed")
195 || (scopeView.scope.id == "home.scope" && categoryId == "applications.scope")) {
196 scopeView.scope.activate(item.uri, item.icon, item.category, 0, item.mimetype, item.title,
197 item.comment, item.dndUri, item.metadata)
198 } else {193 } else {
194 previewListView.model = target.model;
195 previewListView.currentIndex = -1
196 previewListView.currentIndex = index;
199 previewListView.open = true197 previewListView.open = true
200
201 scopeView.scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title,
202 item.comment, item.dndUri, item.metadata)
203 }198 }
204 }199 }
205 onPressAndHold: {200 onPressAndHold: {
206 openEffect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight);
207 previewListView.categoryId = categoryId
208 previewListView.categoryDelegate = rendererLoader.item
209 previewListView.model = target.model;201 previewListView.model = target.model;
210 previewListView.init = true;202 previewListView.currentIndex = -1
211 previewListView.currentIndex = index;203 previewListView.currentIndex = index;
212 previewListView.open = true204 previewListView.open = true
213
214 var item = target.model.get(index)
215 scopeView.scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title,
216 item.comment, item.dndUri, item.metadata)
217 }205 }
218 }206 }
219 Connections {207 Connections {
@@ -221,9 +209,6 @@
221 onExpandedCategoryIdChanged: {209 onExpandedCategoryIdChanged: {
222 collapseAllButExpandedCategory();210 collapseAllButExpandedCategory();
223 }211 }
224 onCorrectExpandedCategory: {
225 collapseAllButExpandedCategory();
226 }
227 function collapseAllButExpandedCategory() {212 function collapseAllButExpandedCategory() {
228 var item = rendererLoader.item;213 var item = rendererLoader.item;
229 if (item.expandable) {214 if (item.expandable) {
@@ -275,6 +260,31 @@
275 }260 }
276 }261 }
277 }262 }
263
264 Image {
265 visible: index != 0
266 anchors {
267 top: parent.top
268 left: parent.left
269 right: parent.right
270 }
271 fillMode: Image.Stretch
272 source: "graphics/dash_divider_top_lightgrad.png"
273 z: -1
274 }
275
276 Image {
277 // FIXME Should not rely on count field of model, SortfilterProxyModel in this case.
278 visible: index != categoryView.model.count - 1
279 anchors {
280 bottom: parent.bottom
281 left: parent.left
282 right: parent.right
283 }
284 fillMode: Image.Stretch
285 source: "graphics/dash_divider_top_darkgrad.png"
286 z: -1
287 }
278 }288 }
279289
280 onHeightChanged: rendererLoader.updateDelegateCreationRange();290 onHeightChanged: rendererLoader.updateDelegateCreationRange();
@@ -302,95 +312,35 @@
302 pageHeader: Item {312 pageHeader: Item {
303 implicitHeight: scopeView.tabBarHeight313 implicitHeight: scopeView.tabBarHeight
304 onHeightChanged: {314 onHeightChanged: {
305 if (scopeView.pageHeader) {315 if (scopeView.pageHeader && scopeView.isCurrent) {
306 scopeView.pageHeader.height = height;316 scopeView.pageHeader.height = height;
307 }317 }
308 }318 }
309 onYChanged: positionRealHeader();319 onYChanged: positionRealHeader();
310320
311 function positionRealHeader() {321 function positionRealHeader() {
312 if (scopeView.pageHeader) {322 if (scopeView.pageHeader && scopeView.isCurrent) {
313 scopeView.pageHeader.y = y + parent.y;323 scopeView.pageHeader.y = y + parent.y;
314 }324 }
315 }325 }
316 }326 }
317 }327 }
318328
319 function getDefaultRendererId(contentType) {329 function getRenderer(template, results) {
320 switch (contentType) {330 var layout = template["category-layout"];
321 default: return "grid";331
322 }332 if (layout == "running-apps") {
323 }333 return "Apps/RunningApplicationsGrid.qml";
324334 }
325 function getRenderer(rendererId, contentType, rendererHint, results) {335
326 if (rendererId == "default") {336 if (layout === "carousel") {
327 rendererId = getDefaultRendererId(contentType);337 // TODO: Selectively disable carousel, 4 is fixed for now, should change depending on form factor
328 }338 if (results.count <= 4) layout = "grid";
329 if (rendererId == "carousel") {339 }
330 // Selectively disable carousel, 6 is fixed for now, should change on the form factor340 switch (layout) {
331 if (results.count <= 6)341 case "carousel": return "CardCarousel.qml";
332 rendererId = "grid"342 case "grid":
333 }343 default: return "CardFilterGrid.qml";
334 switch (rendererId) {
335 case "carousel": {
336 switch (contentType) {
337 case "music": return "Music/MusicCarousel.qml";
338 case "video": return "Video/VideoCarousel.qml";
339 default: return "Generic/GenericCarousel.qml";
340 }
341 }
342 case "grid": {
343 switch (contentType) {
344 case "apps": {
345 if (rendererHint == "toggled")
346 return "Apps/DashPluginFilterGrid.qml";
347 else
348 return "Generic/GenericFilterGrid.qml";
349 }
350 case "music": return "Music/MusicFilterGrid.qml";
351 case "video": return "Video/VideoFilterGrid.qml";
352 case "weather": return "Generic/WeatherFilterGrid.qml";
353 default: return "Generic/GenericFilterGrid.qml";
354 }
355 }
356 case "special": {
357 switch (contentType) {
358 case "apps": return "Apps/RunningApplicationsGrid.qml";
359 default: return "Generic/GenericFilterGrid.qml";
360 }
361 }
362 default: return "Generic/GenericFilterGrid.qml";
363 }
364 }
365
366 Connections {
367 target: scopeView.scope
368 onPreviewReady: {
369 if (previewListView.init) {
370 // Preview was triggered because of a click on the item. Need to expand now.
371 if (!previewListView.open) {
372 previewListView.open = true
373 }
374
375 var index = previewListView.currentIndex
376 previewListView.currentIndex = -1
377 previewListView.currentIndex = index
378 previewListView.init = false
379 }
380 previewListView.currentItem.previewData = preview
381 }
382 }
383
384 // TODO: Move as InverseMouseArea to DashPreview
385 MouseArea {
386 objectName: "closePreviewMouseArea"
387 enabled: previewListView.onScreen
388 anchors {
389 fill: parent
390 topMargin: openEffect.bottomGapPx
391 }
392 onClicked: {
393 previewListView.open = false;
394 }344 }
395 }345 }
396}346}
397347
=== modified file 'qml/Dash/PreviewListView.qml'
--- qml/Dash/PreviewListView.qml 2014-01-28 15:57:51 +0000
+++ qml/Dash/PreviewListView.qml 2014-03-07 12:41:18 +0000
@@ -16,53 +16,53 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Unity 0.119import Unity 0.2
20import "../Components"20import "../Components"
21import "Previews" as Previews
2122
22Item {23Item {
23 property OpenEffect openEffect: null24 id: root
24 property ScopeListView categoryView: null25
25 property Scope scope: null26 property Scope scope: null
27 property var pageHeader: null
2628
27 property alias open: previewListView.open29 property alias open: previewListView.open
28 property alias onScreen: previewListView.onScreen
29 property alias categoryId: previewListView.categoryId
30 property alias categoryDelegate: previewListView.categoryDelegate
31 property alias init: previewListView.init
32 property alias model: previewListView.model30 property alias model: previewListView.model
33 property alias currentIndex: previewListView.currentIndex31 property alias currentIndex: previewListView.currentIndex
34 property alias currentItem: previewListView.currentItem32 property alias currentItem: previewListView.currentItem
35 property alias count: previewListView.count33 property alias count: previewListView.count
3634
37 Image {35 PageHeader {
38 objectName: "pointerArrow"36 id: header
39 anchors {37 width: parent.width
40 top: previewListView.bottom38 searchEntryEnabled: false
41 left: parent.left39 scope: root.scope
42 leftMargin: previewListView.categoryDelegate !== undefined && previewListView.categoryDelegate.currentItem ?40 height: units.gu(8.5)
43 previewListView.categoryDelegate.currentItem.center + (-width + margins) / 2 : 041 showBackButton: true
42 onBackClicked: root.open = false
4443
45 Behavior on leftMargin {44 childItem: Label {
46 SmoothedAnimation {45 id: label
47 duration: UbuntuAnimation.FastDuration46 anchors {
48 }47 left: parent.left
48 right: parent.right
49 verticalCenter: parent.verticalCenter
49 }50 }
51 text: scope ? i18n.tr("%1 Preview").arg(scope.name) : ""
52 color: "#888888"
53 font.family: "Ubuntu"
54 font.weight: Font.Light
55 fontSize: "x-large"
56 elide: Text.ElideRight
50 }57 }
51 height: units.gu(1)
52 width: units.gu(2)
53 property int margins: previewListView.categoryDelegate ? previewListView.categoryDelegate.margins : 0
54 opacity: previewListView.open ? .5 : 0
55
56 source: "graphics/tooltip_arrow.png"
57 }58 }
5859
59 ListView {60 ListView {
60 id: previewListView61 id: previewListView
61 objectName: "previewListView"62 objectName: "previewListView"
62 height: openEffect.bottomGapPx - openEffect.topGapPx
63 anchors {63 anchors {
64 top: parent.top64 top: header.bottom
65 topMargin: openEffect.topGapPx65 bottom: parent.bottom
66 left: parent.left66 left: parent.left
67 right: parent.right67 right: parent.right
68 }68 }
@@ -77,71 +77,17 @@
7777
78 // To be set before opening the preview78 // To be set before opening the preview
79 property string categoryId: ""79 property string categoryId: ""
80 property var categoryDelegate
8180
82 // because the ListView is built asynchronous, setting the81 // because the ListView is built asynchronous, setting the
83 // currentIndex directly won't work. We need to refresh it82 // currentIndex directly won't work. We need to refresh it
84 // when the first preview is ready to be displayed.83 // when the first preview is ready to be displayed.
85 property bool init: true84 property bool init: true
8685
87 PreviewDelegateMapper {
88 id: previewDelegateMapper
89 }
90
91 onCurrentIndexChanged: positionListView();
92
93 function positionListView() {
94 if (!open) {
95 return;
96 }
97
98 var row = Math.floor(currentIndex / categoryDelegate.columns);
99 if (categoryDelegate.collapsedRowCount <= row) {
100 categoryView.expandedCategoryId = categoryId
101 }
102
103 categoryDelegate.highlightIndex = currentIndex
104
105 if (!init && model !== undefined) {
106 var item = model.get(currentIndex)
107 scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
108 }
109
110 // Adjust contentY in case we need to change to it to show the next row
111 if (categoryDelegate.rows > 1) {
112 var itemY = categoryView.contentItem.mapFromItem(categoryDelegate.currentItem).y;
113
114 // Find new contentY and effect.postionPx
115 var newContentY = itemY - openEffect.positionPx - categoryDelegate.verticalSpacing;
116
117 // Make sure the item is not covered by a header. Move the effect split down if necessary
118 var headerHeight = pageHeader.height + categoryView.stickyHeaderHeight;
119 var effectAdjust = Math.max(openEffect.positionPx, headerHeight);
120
121 // Make sure we don't overscroll the listview. If yes, adjust effect position
122 if (newContentY < 0) {
123 effectAdjust += newContentY;
124 newContentY = 0;
125 }
126 if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) {
127 effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY
128 newContentY = categoryView.contentHeight - categoryView.height;
129 }
130
131 openEffect.positionPx = effectAdjust;
132 categoryView.contentY = newContentY;
133 }
134 }
135
136 property bool open: false86 property bool open: false
137 property bool onScreen: false
13887
139 onOpenChanged: {88 onOpenChanged: {
140 if (open) {89 if (open) {
141 onScreen = true;
142 categoryDelegate.highlightIndex = currentIndex;
143 pageHeader.unfocus();90 pageHeader.unfocus();
144 positionListView();
145 } else {91 } else {
146 // Cancel any pending preview requests or actions92 // Cancel any pending preview requests or actions
147 if (previewListView.currentItem.previewData !== undefined) {93 if (previewListView.currentItem.previewData !== undefined) {
@@ -149,68 +95,43 @@
149 }95 }
150 scope.cancelActivation();96 scope.cancelActivation();
151 model = undefined;97 model = undefined;
152 categoryView.correctExpandedCategory();
153 categoryDelegate.highlightIndex = -1;
154 }98 }
155 }99 }
156100
157 Rectangle {101 delegate: Item {
158 anchors.fill: parent
159 color: Qt.rgba(0, 0, 0, .3)
160 z: -1
161 }
162
163 delegate: Loader {
164 id: previewLoader
165 objectName: "previewLoader" + index
166 height: previewListView.height102 height: previewListView.height
167 width: previewListView.width103 width: previewListView.width
168 asynchronous: true104
169 source: previewListView.onScreen ?105 readonly property bool ready: preview.previewModel.loaded
170 (previewData !== undefined ? previewDelegateMapper.map(previewData.rendererName) : "DashPreviewPlaceholder.qml") : ""106
171107 Previews.Preview {
172 onPreviewDataChanged: {108 id: preview
173 if (previewData !== undefined && source.toString().indexOf("DashPreviewPlaceholder.qml") != -1) {109 objectName: "preview" + index
174 previewLoader.opacity = 0;110 anchors.fill: parent
175 }111
176 }112 isCurrent: parent.ListView.isCurrentItem
177113
178 onSourceChanged: {114 previewModel: {
179 if (previewData !== undefined) {115 var previewStack = root.scope.preview(result);
180 fadeIn.start()116 return previewStack.get(0);
181 }117 }
182 }118
183119 // onClose: {
184 PropertyAnimation {120 // previewListView.open = false
185 id: fadeIn121 // }
186 target: previewLoader122
187 property: "opacity"123 }
188 from: 0.0124
189 to: 1.0125 MouseArea {
190 duration: UbuntuAnimation.BriskDuration126 id: processingMouseArea
191 }127 objectName: "processingMouseArea"
192128 anchors.fill: parent
193 property var previewData129 enabled: !preview.previewModel.loaded || preview.previewModel.processingAction
194 property bool valid: item !== null130
195131 ActivityIndicator {
196 onLoaded: {132 anchors.centerIn: parent
197 if (previewListView.onScreen && previewData !== undefined) {133 visible: root.open && parent.enabled
198 item.previewData = Qt.binding(function() { return previewData })134 running: visible
199 item.isCurrent = Qt.binding(function() { return ListView.isCurrentItem })
200 }
201 }
202
203 Connections {
204 ignoreUnknownSignals: true
205 target: item
206 onClose: {
207 previewListView.open = false
208 }
209 }
210
211 function closePreviewSpinner() {
212 if (item) {
213 item.showProcessingAction = false;
214 }135 }
215 }136 }
216 }137 }
217138
=== modified file 'qml/Dash/Previews/Preview.qml'
--- qml/Dash/Previews/Preview.qml 2014-02-12 09:36:33 +0000
+++ qml/Dash/Previews/Preview.qml 2014-03-07 12:41:18 +0000
@@ -39,7 +39,8 @@
39 clip: true39 clip: true
4040
41 Connections {41 Connections {
42 target: shell.applicationManager42 target: shell.applicationManager || null
43 ignoreUnknownSignals: true
43 onMainStageFocusedApplicationChanged: {44 onMainStageFocusedApplicationChanged: {
44 root.close();45 root.close();
45 }46 }
@@ -48,7 +49,11 @@
48 }49 }
49 }50 }
5051
51 onPreviewModelChanged: processingMouseArea.enabled = false52 Binding {
53 target: previewModel
54 property: "widgetColumnCount"
55 value: row.columns
56 }
5257
53 MouseArea {58 MouseArea {
54 anchors.fill: parent59 anchors.fill: parent
@@ -60,18 +65,21 @@
60 spacing: units.gu(1)65 spacing: units.gu(1)
61 anchors { fill: parent; margins: spacing }66 anchors { fill: parent; margins: spacing }
6267
68 property int columns: width >= units.gu(80) ? 2 : 1
69 property real columnWidth: width / columns
70
63 Repeater {71 Repeater {
64 model: 172 model: previewModel
6573
66 delegate: ListView {74 delegate: ListView {
67 id: column75 id: column
68 anchors { top: parent.top; bottom: parent.bottom }76 anchors { top: parent.top; bottom: parent.bottom }
69 width: row.width77 width: row.columnWidth
70 spacing: row.spacing78 spacing: row.spacing
71 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 079 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
7280
73 model: previewModel81 model: columnModel
74 cacheBuffer: units.gu(40)82 cacheBuffer: height
7583
76 Behavior on contentY { UbuntuNumberAnimation { } }84 Behavior on contentY { UbuntuNumberAnimation { } }
7785
@@ -80,10 +88,14 @@
80 widgetType: model.type88 widgetType: model.type
81 widgetData: model.properties89 widgetData: model.properties
82 isCurrentPreview: root.isCurrent90 isCurrentPreview: root.isCurrent
83 anchors { left: parent.left; right: parent.right }91 anchors {
92 left: parent.left
93 right: parent.right
94 leftMargin: units.gu(1)
95 rightMargin: units.gu(1)
96 }
8497
85 onTriggered: {98 onTriggered: {
86 processingMouseArea.enabled = true;
87 previewModel.triggered(widgetId, actionId, data);99 previewModel.triggered(widgetId, actionId, data);
88 }100 }
89101
@@ -94,11 +106,4 @@
94 }106 }
95 }107 }
96 }108 }
97
98 MouseArea {
99 id: processingMouseArea
100 objectName: "processingMouseArea"
101 anchors.fill: parent
102 enabled: false
103 }
104}109}
105110
=== modified file 'qml/Dash/Previews/PreviewActions.qml'
--- qml/Dash/Previews/PreviewActions.qml 2014-02-12 09:11:54 +0000
+++ qml/Dash/Previews/PreviewActions.qml 2014-03-07 12:41:18 +0000
@@ -24,7 +24,7 @@
24PreviewWidget {24PreviewWidget {
25 id: root25 id: root
2626
27 height: row.height27 height: row.height + units.gu(1)
2828
29 Row {29 Row {
30 id: row30 id: row
3131
=== modified file 'qml/Dash/Previews/PreviewAudioPlayback.qml'
--- qml/Dash/Previews/PreviewAudioPlayback.qml 2014-02-05 12:37:20 +0000
+++ qml/Dash/Previews/PreviewAudioPlayback.qml 2014-03-07 12:41:18 +0000
@@ -139,7 +139,7 @@
139 objectName: "trackTitleLabel"139 objectName: "trackTitleLabel"
140 anchors { top: parent.top; left: parent.left; right: parent.right }140 anchors { top: parent.top; left: parent.left; right: parent.right }
141 opacity: 0.9141 opacity: 0.9
142 color: Theme.palette.selected.backgroundText142 color: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
143 fontSize: "small"143 fontSize: "small"
144 horizontalAlignment: Text.AlignLeft144 horizontalAlignment: Text.AlignLeft
145 text: modelData["title"]145 text: modelData["title"]
@@ -152,7 +152,7 @@
152 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }152 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
153 visible: text !== ""153 visible: text !== ""
154 opacity: 0.9154 opacity: 0.9
155 color: Theme.palette.selected.backgroundText155 color: "lightgrey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
156 fontSize: "small"156 fontSize: "small"
157 horizontalAlignment: Text.AlignLeft157 horizontalAlignment: Text.AlignLeft
158 text: modelData["subtitle"] || ""158 text: modelData["subtitle"] || ""
@@ -192,7 +192,7 @@
192 anchors.verticalCenter: parent.verticalCenter192 anchors.verticalCenter: parent.verticalCenter
193 width: parent.column3Width193 width: parent.column3Width
194 opacity: 0.9194 opacity: 0.9
195 color: Theme.palette.selected.backgroundText195 color: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
196 fontSize: "small"196 fontSize: "small"
197 horizontalAlignment: Text.AlignRight197 horizontalAlignment: Text.AlignRight
198 text: audio.lengthToString(modelData["length"])198 text: audio.lengthToString(modelData["length"])
199199
=== modified file 'qml/Dash/Previews/PreviewHeader.qml'
--- qml/Dash/Previews/PreviewHeader.qml 2014-02-07 14:08:40 +0000
+++ qml/Dash/Previews/PreviewHeader.qml 2014-03-07 12:41:18 +0000
@@ -34,5 +34,7 @@
34 title: root.widgetData["title"] || ""34 title: root.widgetData["title"] || ""
35 subtitle: root.widgetData["subtitle"] || ""35 subtitle: root.widgetData["subtitle"] || ""
36 width: parent.width36 width: parent.width
37
38 titleSize: "large"
37 }39 }
38}
39\ No newline at end of file40\ No newline at end of file
41}
4042
=== modified file 'qml/Dash/Previews/PreviewImageGallery.qml'
--- qml/Dash/Previews/PreviewImageGallery.qml 2014-02-05 12:08:18 +0000
+++ qml/Dash/Previews/PreviewImageGallery.qml 2014-03-07 12:41:18 +0000
@@ -32,6 +32,16 @@
32 orientation: ListView.Horizontal32 orientation: ListView.Horizontal
33 cacheBuffer: width * 333 cacheBuffer: width * 3
34 model: root.widgetData["sources"]34 model: root.widgetData["sources"]
35 clip: true
36
37 // FIXME: Because of ListViews inside ListViews inside Flickables inside ListViews (and some more)
38 // we finally reached the point where this ListView doesn't correctly get swipe input any more but
39 // instead the parent ListView is the one that is swiped. This MouseArea sort of creates a blocking
40 // layer to make sure this ListView can be swiped, regardless of what's behind it.
41 MouseArea {
42 anchors.fill: parent
43 enabled: parent.contentWidth > parent.width
44 }
3545
36 LazyImage {46 LazyImage {
37 objectName: "placeholderScreenshot"47 objectName: "placeholderScreenshot"
3848
=== modified file 'qml/Dash/Previews/PreviewTextSummary.qml'
--- qml/Dash/Previews/PreviewTextSummary.qml 2014-02-06 10:23:05 +0000
+++ qml/Dash/Previews/PreviewTextSummary.qml 2014-03-07 12:41:18 +0000
@@ -38,7 +38,8 @@
38 right: parent.right38 right: parent.right
39 }39 }
40 fontSize: "large"40 fontSize: "large"
41 color: Theme.palette.selected.backgroundText41 // TODO karni: Yet another fix requiring Palette update.
42 color: "grey" //Theme.palette.selected.backgroundText
42 visible: text !== ""43 visible: text !== ""
43 opacity: .844 opacity: .8
44 text: widgetData["title"] || ""45 text: widgetData["title"] || ""
@@ -58,8 +59,10 @@
58 }59 }
59 height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)60 height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
60 clip: true61 clip: true
61 fontSize: "medium"62 fontSize: "small"
62 color: Theme.palette.selected.backgroundText63 lineHeight: 1.2
64 // TODO karni: Yet another fix requiring Palette update.
65 color: "grey" //Theme.palette.selected.backgroundText
63 opacity: .866 opacity: .8
64 text: widgetData["text"]67 text: widgetData["text"]
65 wrapMode: Text.Wrap68 wrapMode: Text.Wrap
6669
=== modified file 'qml/Dash/Previews/PreviewWidgetFactory.qml'
--- qml/Dash/Previews/PreviewWidgetFactory.qml 2014-02-21 11:24:12 +0000
+++ qml/Dash/Previews/PreviewWidgetFactory.qml 2014-03-07 12:41:18 +0000
@@ -46,7 +46,7 @@
46 case "audio": return "PreviewAudioPlayback.qml";46 case "audio": return "PreviewAudioPlayback.qml";
47 case "gallery": return "PreviewImageGallery.qml";47 case "gallery": return "PreviewImageGallery.qml";
48 case "header": return "PreviewHeader.qml";48 case "header": return "PreviewHeader.qml";
49 case "image": return "PreviewZoomableImage.qml"49 case "image": return "PreviewZoomableImage.qml";
50 case "progress": return "PreviewProgress.qml";50 case "progress": return "PreviewProgress.qml";
51 case "rating-input": return "PreviewRatingInput.qml";51 case "rating-input": return "PreviewRatingInput.qml";
52 case "reviews": return "PreviewRatingDisplay.qml";52 case "reviews": return "PreviewRatingDisplay.qml";
5353
=== modified file 'qml/Dash/ScopeDelegateMapper.qml'
--- qml/Dash/ScopeDelegateMapper.qml 2013-10-11 10:12:35 +0000
+++ qml/Dash/ScopeDelegateMapper.qml 2014-03-07 12:41:18 +0000
@@ -17,7 +17,7 @@
17import QtQuick 2.017import QtQuick 2.0
1818
19QtObject {19QtObject {
20 property var scopeDelegateMapping: {"applications.scope": "DashApps.qml",20 property var scopeDelegateMapping: {"clickscope": "DashApps.qml",
21 "home.scope": "DashHome.qml"21 "home.scope": "DashHome.qml"
22 }22 }
23 property string genericScope: "GenericScopeView.qml"23 property string genericScope: "GenericScopeView.qml"
2424
=== added file 'qml/Dash/ScopeItem.qml'
--- qml/Dash/ScopeItem.qml 1970-01-01 00:00:00 +0000
+++ qml/Dash/ScopeItem.qml 2014-03-07 12:41:18 +0000
@@ -0,0 +1,94 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import Unity 0.2
20import "../Components"
21
22Item {
23 id: root
24
25 property alias scope: scopeView.scope
26 property alias previewOpen: previewListView.open
27
28 property ListModel searchHistory
29
30 signal back
31 signal gotoScope(string scopeId)
32 signal openScope(var scope)
33
34 Item {
35 id: scopeViewHolder
36
37 x: previewListView.open ? -width : 0
38 Behavior on x { UbuntuNumberAnimation { } }
39 width: parent.width
40 height: parent.height
41
42 GenericScopeView {
43 id: scopeView
44 width: parent.width
45 height: parent.height
46 isCurrent: scope != null
47 tabBarHeight: scopeItemPageHeader.implicitHeight
48 pageHeader: scopeItemPageHeader
49 previewListView: previewListView
50
51 Connections {
52 target: scopeView.isCurrent ? scope : null
53 onGotoScope: root.gotoScope(scopeId);
54 onOpenScope: root.openScope(scope);
55 }
56 }
57
58 PageHeader {
59 id: scopeItemPageHeader
60 width: parent.width
61 searchEntryEnabled: true
62 searchHistory: root.searchHistory
63 scope: root.scope
64 height: units.gu(8.5)
65 showBackButton: true
66 onBackClicked: root.back();
67
68 childItem: Label {
69 id: label
70 anchors {
71 left: parent.left
72 right: parent.right
73 verticalCenter: parent.verticalCenter
74 }
75 text: scope ? scope.name : ""
76 color: "#888888"
77 font.family: "Ubuntu"
78 font.weight: Font.Light
79 fontSize: "x-large"
80 elide: Text.ElideRight
81 }
82 }
83 }
84
85 PreviewListView {
86 id: previewListView
87 visible: x != width
88 pageHeader: scopeItemPageHeader
89 scope: root.scope
90 width: parent.width
91 height: parent.height
92 anchors.left: scopeViewHolder.right
93 }
94}
095
=== modified file 'qml/Dash/SearchableResultModel.qml'
--- qml/Dash/SearchableResultModel.qml 2013-09-30 12:17:20 +0000
+++ qml/Dash/SearchableResultModel.qml 2014-03-07 12:41:18 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import Utils 0.117import Utils 0.1
18import Unity 0.118import Unity 0.2
1919
20SortFilterProxyModel {20SortFilterProxyModel {
21 id: root21 id: root
2222
=== added file 'qml/Dash/graphics/dash_divider_top_darkgrad@27.png'
23Binary files qml/Dash/graphics/dash_divider_top_darkgrad@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dash_divider_top_darkgrad@27.png 2014-03-07 12:41:18 +0000 differ23Binary files qml/Dash/graphics/dash_divider_top_darkgrad@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dash_divider_top_darkgrad@27.png 2014-03-07 12:41:18 +0000 differ
=== added file 'qml/Dash/graphics/dash_divider_top_lightgrad@27.png'
24Binary files qml/Dash/graphics/dash_divider_top_lightgrad@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dash_divider_top_lightgrad@27.png 2014-03-07 12:41:18 +0000 differ24Binary files qml/Dash/graphics/dash_divider_top_lightgrad@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dash_divider_top_lightgrad@27.png 2014-03-07 12:41:18 +0000 differ
=== renamed file 'qml/Dash/graphics/header_handlearrow2@20.png' => 'qml/Dash/graphics/header_handlearrow2@27.png'
25Binary files qml/Dash/graphics/header_handlearrow2@20.png 2013-08-08 14:34:00 +0000 and qml/Dash/graphics/header_handlearrow2@27.png 2014-03-07 12:41:18 +0000 differ25Binary files qml/Dash/graphics/header_handlearrow2@20.png 2013-08-08 14:34:00 +0000 and qml/Dash/graphics/header_handlearrow2@27.png 2014-03-07 12:41:18 +0000 differ
=== renamed file 'qml/Dash/graphics/header_handlearrow@20.png' => 'qml/Dash/graphics/header_handlearrow@27.png'
26Binary files qml/Dash/graphics/header_handlearrow@20.png 2013-08-08 14:34:00 +0000 and qml/Dash/graphics/header_handlearrow@27.png 2014-03-07 12:41:18 +0000 differ26Binary files qml/Dash/graphics/header_handlearrow@20.png 2013-08-08 14:34:00 +0000 and qml/Dash/graphics/header_handlearrow@27.png 2014-03-07 12:41:18 +0000 differ
=== added file 'qml/Dash/graphics/paper_landscape@27.png'
27Binary files qml/Dash/graphics/paper_landscape@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/paper_landscape@27.png 2014-03-07 12:41:18 +0000 differ27Binary files qml/Dash/graphics/paper_landscape@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/paper_landscape@27.png 2014-03-07 12:41:18 +0000 differ
=== added file 'qml/Dash/graphics/paper_portrait@27.png'
28Binary files qml/Dash/graphics/paper_portrait@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/paper_portrait@27.png 2014-03-07 12:41:18 +0000 differ28Binary files qml/Dash/graphics/paper_portrait@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/paper_portrait@27.png 2014-03-07 12:41:18 +0000 differ
=== modified file 'qml/Dash/graphics/tabbarchevron@27.png'
29Binary files qml/Dash/graphics/tabbarchevron@27.png 2013-12-02 15:58:26 +0000 and qml/Dash/graphics/tabbarchevron@27.png 2014-03-07 12:41:18 +0000 differ29Binary files qml/Dash/graphics/tabbarchevron@27.png 2013-12-02 15:58:26 +0000 and qml/Dash/graphics/tabbarchevron@27.png 2014-03-07 12:41:18 +0000 differ
=== modified file 'qml/Launcher/Launcher.qml'
--- qml/Launcher/Launcher.qml 2013-12-04 13:41:51 +0000
+++ qml/Launcher/Launcher.qml 2014-03-07 12:41:18 +0000
@@ -18,7 +18,6 @@
18import "../Components"18import "../Components"
19import Ubuntu.Components 0.119import Ubuntu.Components 0.1
20import Ubuntu.Gestures 0.120import Ubuntu.Gestures 0.1
21import Unity 0.1
22import Unity.Launcher 0.121import Unity.Launcher 0.1
2322
24Item {23Item {
2524
=== modified file 'qml/Launcher/LauncherPanel.qml'
--- qml/Launcher/LauncherPanel.qml 2013-12-04 13:41:51 +0000
+++ qml/Launcher/LauncherPanel.qml 2014-03-07 12:41:18 +0000
@@ -17,7 +17,6 @@
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Ubuntu.Components.ListItems 0.1 as ListItems19import Ubuntu.Components.ListItems 0.1 as ListItems
20import Unity 0.1
21import Unity.Launcher 0.120import Unity.Launcher 0.1
22import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 0.1
23import "../Components/ListItems"22import "../Components/ListItems"
2423
=== modified file 'qml/Panel/MenuContent.qml'
--- qml/Panel/MenuContent.qml 2014-01-14 16:44:35 +0000
+++ qml/Panel/MenuContent.qml 2014-03-07 12:41:18 +0000
@@ -26,6 +26,7 @@
26MainView {26MainView {
27 id: content27 id: content
2828
29 nativeOrientationAngle: 0 // stop contents being re-rotated when shell in landscape
29 property QtObject indicatorsModel: null30 property QtObject indicatorsModel: null
30 property bool __contentActive: false31 property bool __contentActive: false
31 readonly property int currentMenuIndex: tabs.selectedTabIndex32 readonly property int currentMenuIndex: tabs.selectedTabIndex
3233
=== modified file 'qml/ScopeTool.qml'
--- qml/ScopeTool.qml 2014-01-10 10:42:44 +0000
+++ qml/ScopeTool.qml 2014-03-07 12:41:18 +0000
@@ -18,7 +18,7 @@
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Ubuntu.Components.Popups 0.119import Ubuntu.Components.Popups 0.1
20import Utils 0.120import Utils 0.1
21import Unity 0.121import Unity 0.2
22import "Components"22import "Components"
23import "Dash"23import "Dash"
2424
@@ -61,6 +61,14 @@
61 color: "#FCFCFC"61 color: "#FCFCFC"
62 }62 }
6363
64 Image {
65 anchors.fill: dashContent
66 source: root.width > root.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
67 fillMode: Image.PreserveAspectCrop
68 horizontalAlignment: Image.AlignRight
69 verticalAlignment: Image.AlignTop
70 }
71
64 DashContent {72 DashContent {
65 id: dashContent73 id: dashContent
6674
6775
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2014-03-04 11:42:38 +0000
+++ qml/Shell.qml 2014-03-07 12:41:18 +0000
@@ -37,6 +37,7 @@
3737
38FocusScope {38FocusScope {
39 id: shell39 id: shell
40 objectName: "shell"
4041
41 // this is only here to select the width / height of the window if not running fullscreen42 // this is only here to select the width / height of the window if not running fullscreen
42 property bool tablet: false43 property bool tablet: false
@@ -77,10 +78,11 @@
77 // FIXME: if application focused before shell starts, shell draws on top of it only.78 // FIXME: if application focused before shell starts, shell draws on top of it only.
78 // We should detect already running applications on shell start and bring them to the front.79 // We should detect already running applications on shell start and bring them to the front.
79 applicationManager.unfocusCurrentApplication();80 applicationManager.unfocusCurrentApplication();
81
82 applicationManager.setMainStageAppRect(mainStageAppRect);
83 applicationManager.setSideStageAppRect(sideStageAppRect);
80 }84 }
8185
82 readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
83 || !!applicationManager.sideStageFocusedApplication
84 // Used for autopilot testing.86 // Used for autopilot testing.
85 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId87 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
8688
@@ -116,6 +118,11 @@
116 }118 }
117 }119 }
118120
121 Connections {
122 target: applicationManager
123 onFocusRequested: activateApplication(appId)
124 }
125
119 GSettings {126 GSettings {
120 id: backgroundSettings127 id: backgroundSettings
121 schema.id: "org.gnome.desktop.background"128 schema.id: "org.gnome.desktop.background"
@@ -125,27 +132,6 @@
125 shell.background = gSettingsPicture132 shell.background = gSettingsPicture
126 }133 }
127134
128 // This is a dummy image that is needed to determine if the picture url
129 // in backgroundSettings points to a valid picture file.
130 // We can't do this with the real background image because setting a
131 // new source in onStatusChanged triggers a binding loop detection
132 // inside Image, which causes it not to render even though a valid source
133 // would be set. We don't mind about this image staying black and just
134 // use it for verification to populate the source for the real
135 // background image.
136 Image {
137 source: shell.background
138 height: 0
139 width: 0
140 sourceSize.height: 0
141 sourceSize.width: 0
142 onStatusChanged: {
143 if (status == Image.Error && source != shell.defaultBackground) {
144 shell.background = defaultBackground
145 }
146 }
147 }
148
149 VolumeControl {135 VolumeControl {
150 id: volumeControl136 id: volumeControl
151 }137 }
@@ -161,67 +147,94 @@
161 // Whether the underlay is fully covered by opaque UI elements.147 // Whether the underlay is fully covered by opaque UI elements.
162 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth148 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
163149
164 readonly property bool applicationRunning: ((mainStage.applications && mainStage.applications.count > 0)150 readonly property bool mainStageApplicationRunning: mainStage.applications && mainStage.applications.count > 0
165 || (sideStage.applications && sideStage.applications.count > 0))151 readonly property bool sideStageApplicationRunning: sideStage.applications && sideStage.applications.count > 0
166152
167 // Whether the user should see the topmost application surface (if there's one at all).153 // Whether the user should see the topmost application surface (if there's one at all).
168 readonly property bool applicationSurfaceShouldBeSeen: applicationRunning && !stages.fullyHidden154 readonly property bool mainStageApplicationShown: mainStageApplicationRunning && !stages.fullyHidden
169 && !mainStage.usingScreenshots // but want sideStage animating over app surface155 && !mainStage.usingScreenshots // but want sideStage animating over app surface
170156
171157
172158
173 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user159 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
174 // through the translucent parts of the shell surface.160 // through the translucent parts of the shell surface.
175 visible: !fullyCovered && !applicationSurfaceShouldBeSeen161 visible: !fullyCovered && !mainStageApplicationShown
176162
177 CrossFadeImage {163 Item {
178 id: backgroundImage164 id: underlayClipper
179 objectName: "backgroundImage"165 clip: !parent.mainStageApplicationShown && parent.sideStageApplicationRunning && stagesOuterContainer.showProgress > 0
180166 width: {
181 anchors.fill: parent167 if (clip) {
182 source: shell.background168 var w = parent.width - sideStage.width
183 fillMode: Image.PreserveAspectCrop169 w += stagesOuterContainer.x + stages.x + (sideStage.x - sideStageRevealer.openedValue)
184 }170 return Math.min(w, parent.width);
185
186 Rectangle {
187 anchors.fill: parent
188 color: "black"
189 opacity: dash.disappearingAnimationProgress
190 }
191
192 Dash {
193 id: dash
194 objectName: "dash"
195
196 available: !greeter.shown && !lockscreen.shown
197 hides: [stages, launcher, panel.indicators]
198 shown: disappearingAnimationProgress !== 1.0
199 enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
200 // FIXME: unfocus all applications when going back to the dash
201 onEnabledChanged: {
202 if (enabled) {
203 shell.applicationManager.unfocusCurrentApplication()
204 }
205 }
206
207 anchors {
208 fill: parent
209 topMargin: panel.panelHeight
210 }
211
212 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
213 opacity: 1.0 - disappearingAnimationProgress
214 property real disappearingAnimationProgress: {
215 if (greeter.shown) {
216 return greeter.showProgress;
217 } else {171 } else {
218 return stagesOuterContainer.showProgress;172 return parent.width;
219 }173 }
220 }174 }
221175 height: parent.height
222 // FIXME: only necessary because stagesOuterContainer.showProgress and176
223 // greeterRevealer.animatedProgress are not animated177 Image {
224 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}178 anchors.fill: dash
179 source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
180 fillMode: Image.PreserveAspectCrop
181 horizontalAlignment: Image.AlignRight
182 verticalAlignment: Image.AlignTop
183 }
184
185 Dash {
186 id: dash
187 objectName: "dash"
188
189 available: !greeter.shown && !lockscreen.shown
190 hides: [stages, launcher, panel.indicators]
191 shown: disappearingAnimationProgress !== 1.0
192 enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
193 // FIXME: unfocus all applications when going back to the dash
194 onEnabledChanged: {
195 if (enabled) {
196 shell.applicationManager.unfocusCurrentApplication()
197 }
198 }
199
200 width: underlay.width
201 height: underlay.height - y
202 y: panel.panelHeight
203
204 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
205 opacity: 1.0 - disappearingAnimationProgress
206 property real disappearingAnimationProgress: {
207 if (greeter.shown) {
208 return greeter.showProgress;
209 } else {
210 if (underlayClipper.clip)
211 return 0;
212 else
213 return stagesOuterContainer.showProgress;
214 }
215 }
216
217 // FIXME: only necessary because stagesOuterContainer.showProgress and
218 // greeterRevealer.animatedProgress are not animated
219 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
220 }
221
222 Rectangle {
223 width: underlay.width
224 height: underlay.height
225 color: "black"
226 opacity: 0.5 * ((sideStage.x - sideStageRevealer.closedValue) / (sideStageRevealer.openedValue - sideStageRevealer.closedValue))
227 visible: sideStageHideButton.enabled
228 }
229
230 AbstractButton {
231 id: sideStageHideButton
232 enabled: mainStage.applications.count == 0 && sideStage.shown
233 anchors.fill: parent
234 onClicked: {
235 sideStage.hide();
236 }
237 }
225 }238 }
226 }239 }
227240
@@ -230,7 +243,7 @@
230243
231 width: parent.width244 width: parent.width
232 height: parent.height245 height: parent.height
233 x: launcher.progress246 x: mainStage.applications.count > 0 ? launcher.progress : 0
234 Behavior on x {SmoothedAnimation{velocity: 600}}247 Behavior on x {SmoothedAnimation{velocity: 600}}
235248
236 property real showProgress:249 property real showProgress:
@@ -242,6 +255,16 @@
242255
243 x: width256 x: width
244257
258 function doLauncherHide() {
259 if (mainStage.applications.count > 0) {
260 hide();
261 } else {
262 if (sideStage.shown) {
263 sideStage.hide();
264 }
265 }
266 }
267
245 property bool fullyShown: shown && x == 0 && parent.x == 0268 property bool fullyShown: shown && x == 0 && parent.x == 0
246 property bool fullyHidden: !shown && x == width269 property bool fullyHidden: !shown && x == width
247 available: !greeter.shown270 available: !greeter.shown
@@ -326,11 +349,6 @@
326 rightEdgeDraggingAreaWidth: shell.edgeSize349 rightEdgeDraggingAreaWidth: shell.edgeSize
327 normalApplicationY: shell.panelHeight350 normalApplicationY: shell.panelHeight
328351
329 onShownChanged: {
330 if (!shown && mainStage.applications.count == 0) {
331 stages.hide();
332 }
333 }
334 // FIXME: when hiding the side stage, refocus the main stage352 // FIXME: when hiding the side stage, refocus the main stage
335 // application so that it goes in front of the side stage353 // application so that it goes in front of the side stage
336 // application and hides it354 // application and hides it
@@ -355,12 +373,29 @@
355 width: units.gu(40)373 width: units.gu(40)
356 height: stages.height374 height: stages.height
357 handleExpanded: sideStageRevealer.pressed375 handleExpanded: sideStageRevealer.pressed
376
377 Connections {
378 target: sideStage.applications
379 onCountChanged: {
380 if (sideStage.applications.count == 0) {
381 if (sideStage.shown) { // if all SS app closed, hide side stage
382 sideStage.hide();
383 } else {
384 // Sidestage is hidden and there is no main app, make sure the
385 // stages is totally hidden too
386 if (mainStage.applications.count == 0) {
387 stages.hideNow();
388 }
389 }
390 }
391 }
392 }
358 }393 }
359394
360 Revealer {395 Revealer {
361 id: sideStageRevealer396 id: sideStageRevealer
362397
363 enabled: mainStage.applications.count > 0 && sideStage.applications.count > 0398 enabled: sideStage.applications.count > 0
364 && sideStage.available399 && sideStage.available
365 direction: Qt.RightToLeft400 direction: Qt.RightToLeft
366 openedValue: parent.width - sideStage.width401 openedValue: parent.width - sideStage.width
@@ -378,6 +413,26 @@
378 orientation: Qt.Horizontal413 orientation: Qt.Horizontal
379 }414 }
380415
416 // Defines the rectangle occupied by an application on the main or side stage.
417 // Used only to inform the ApplicationManager. Can be removed when the proper
418 // architecture is in place (unity8 as mir compositor).
419 Item {
420 id: mainStageAppRect
421 x: mainStage.x
422 y: mainStage.y + mainStage.normalApplicationY
423 width: mainStage.width
424 height: mainStage.height
425 visible: false; enabled: false
426 }
427 Item {
428 id: sideStageAppRect
429 x: sideStageRevealer.openedValue
430 y: sideStage.y + sideStage.normalApplicationY
431 width: sideStage.width
432 height: sideStage.height
433 visible: false; enabled: false
434 }
435
381 DragHandle {436 DragHandle {
382 id: stagesDragHandle437 id: stagesDragHandle
383438
@@ -461,7 +516,7 @@
461 hides: [launcher, panel.indicators, hud]516 hides: [launcher, panel.indicators, hud]
462 shown: true517 shown: true
463518
464 defaultBackground: shell.background519 defaultBackground: shell.defaultBackground
465520
466 y: panel.panelHeight521 y: panel.panelHeight
467 width: parent.width522 width: parent.width
@@ -474,7 +529,9 @@
474529
475 function removeApplicationFocus() {530 function removeApplicationFocus() {
476 greeter.previousMainApp = applicationManager.mainStageFocusedApplication;531 greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
477 greeter.previousSideApp = applicationManager.sideStageFocusedApplication;532 if (sideStage.fullyShown) { // if side stage hidden, don't focus it on restore
533 greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
534 }
478 applicationManager.unfocusCurrentApplication();535 applicationManager.unfocusCurrentApplication();
479 }536 }
480537
@@ -543,8 +600,14 @@
543 }600 }
544601
545 InputFilterArea {602 InputFilterArea {
546 anchors.fill: parent603 width: {
547 blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown604 if (applicationManager.sideStageFocusedApplication && sideStage.shown)
605 return parent.width - sideStage.width;
606 else
607 return parent.width;
608 }
609 height: parent.height
610 blockInput: !applicationManager.mainStageFocusedApplication || greeter.shown || lockscreen.shown || launcher.shown
548 || panel.indicators.shown || hud.shown611 || panel.indicators.shown || hud.shown
549 }612 }
550613
@@ -571,7 +634,7 @@
571 function showHome() {634 function showHome() {
572 var animate = !greeter.shown && !stages.shown635 var animate = !greeter.shown && !stages.shown
573 greeter.hide()636 greeter.hide()
574 dash.setCurrentScope("home.scope", animate, false)637 dash.setCurrentScope("clickscope", animate, false)
575 stages.hide()638 stages.hide()
576 }639 }
577640
@@ -594,7 +657,7 @@
594 contentEnabled: edgeDemo.panelContentEnabled657 contentEnabled: edgeDemo.panelContentEnabled
595 }658 }
596 fullscreenMode: shell.fullscreenMode659 fullscreenMode: shell.fullscreenMode
597 searchVisible: !greeter.shown && !lockscreen.shown && dash.shown660 searchVisible: !greeter.shown && !lockscreen.shown && dash.shown && dash.searchable
598661
599 InputFilterArea {662 InputFilterArea {
600 anchors {663 anchors {
@@ -646,7 +709,7 @@
646 theHud: hud709 theHud: hud
647 anchors.fill: parent710 anchors.fill: parent
648 enabled: hud.available711 enabled: hud.available
649 applicationIsOnForeground: applicationFocused712 applicationIsOnForeground: (stages.shown && mainStage.applications.count > 0) || (stages.shown && sideStage.shown)
650 }713 }
651714
652 InputFilterArea {715 InputFilterArea {
@@ -668,7 +731,7 @@
668 anchors.bottom: parent.bottom731 anchors.bottom: parent.bottom
669 width: parent.width732 width: parent.width
670 dragAreaWidth: shell.edgeSize733 dragAreaWidth: shell.edgeSize
671 available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled734 available: !greeter.locked && edgeDemo.launcherEnabled
672735
673 onShowDashHome: {736 onShowDashHome: {
674 if (edgeDemo.running)737 if (edgeDemo.running)
@@ -678,11 +741,11 @@
678 }741 }
679 onDash: {742 onDash: {
680 if (stages.shown) {743 if (stages.shown) {
681 stages.hide();744 stages.doLauncherHide();
682 launcher.hide();745 launcher.hide();
683 }746 }
684 }747 }
685 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("applications.scope", false, true)748 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)
686 onLauncherApplicationSelected:{749 onLauncherApplicationSelected:{
687 if (edgeDemo.running)750 if (edgeDemo.running)
688 return;751 return;
@@ -762,21 +825,6 @@
762 value: "unity8"825 value: "unity8"
763 }826 }
764827
765 OSKController {
766 anchors.topMargin: panel.panelHeight
767 anchors.fill: parent // as needs to know the geometry of the shell
768 }
769
770 //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
771 MouseArea {
772 anchors.bottom: parent.bottom
773 anchors.left: parent.left
774 anchors.right: parent.right
775 height: shell.applicationManager ? shell.applicationManager.keyboardHeight : 0
776
777 enabled: shell.applicationManager && shell.applicationManager.keyboardVisible
778 }
779
780 Label {828 Label {
781 anchors.centerIn: parent829 anchors.centerIn: parent
782 visible: applicationManager.fake830 visible: applicationManager.fake
@@ -797,7 +845,7 @@
797 launcher: launcher845 launcher: launcher
798 dash: dash846 dash: dash
799 indicators: panel.indicators847 indicators: panel.indicators
800 underlay: underlay848 underlay: underlayClipper
801 }849 }
802850
803 Connections {851 Connections {
804852
=== added file 'qml/ShellOrientator.qml'
--- qml/ShellOrientator.qml 1970-01-01 00:00:00 +0000
+++ qml/ShellOrientator.qml 2014-03-07 12:41:18 +0000
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtQuick.Window 2.0
19import Unity.Application 0.1
20
21Item {
22 id: orientator
23
24 // this is only here to select the width / height of the window if not running fullscreen
25 property bool tablet: false
26 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
27 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
28
29 Item {
30 anchors.fill: parent
31 rotation: Screen.angleBetween(nativeOrientation, Screen.primaryOrientation)
32 Shell {
33 x: (parent.rotation == 0) ? 0 : (parent.width - parent.height) / 2
34 y: (parent.rotation == 0) ? 0 : -(parent.width - parent.height) / 2
35 width: (parent.rotation == 0) ? parent.width : parent.height
36 height: (parent.rotation == 0) ? parent.height : parent.width
37 }
38 }
39
40 OSKController {
41 anchors.fill: parent // as needs to know the geometry of the shell
42 }
43}
044
=== modified file 'src/main.cpp'
--- src/main.cpp 2014-02-27 11:54:16 +0000
+++ src/main.cpp 2014-03-07 12:41:18 +0000
@@ -98,6 +98,16 @@
98 view->setFlags(Qt::FramelessWindowHint);98 view->setFlags(Qt::FramelessWindowHint);
99 }99 }
100100
101 const QByteArray orientation = qgetenv("NATIVE_ORIENTATION");
102 Qt::ScreenOrientation orientationAngle = Qt::PrimaryOrientation;
103 if (orientation == "landscape") {
104 orientationAngle = Qt::LandscapeOrientation;
105 } else if (!orientation.isEmpty() && orientation != "portrait") {
106 qDebug() << "Unknown NATIVE_ORIENTATION setting, ignoring";
107 }
108
109 view->rootContext()->setContextProperty("nativeOrientation", orientationAngle);
110
101 // You will need this if you want to interact with touch-only components using a mouse111 // You will need this if you want to interact with touch-only components using a mouse
102 // Needed only when manually testing on a desktop.112 // Needed only when manually testing on a desktop.
103 MouseTouchAdaptor *mouseTouchAdaptor = 0;113 MouseTouchAdaptor *mouseTouchAdaptor = 0;
@@ -115,7 +125,7 @@
115 nativeInterface->setProperty("ubuntuSessionType", 1);125 nativeInterface->setProperty("ubuntuSessionType", 1);
116 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE126 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
117127
118 QUrl source(::qmlDirectory()+"Shell.qml");128 QUrl source(::qmlDirectory()+"ShellOrientator.qml");
119 prependImportPaths(view->engine(), ::overrideImportPaths());129 prependImportPaths(view->engine(), ::overrideImportPaths());
120 appendImportPaths(view->engine(), ::fallbackImportPaths());130 appendImportPaths(view->engine(), ::fallbackImportPaths());
121131
122132
=== modified file 'tests/mocks/Unity/fake_unity_plugin.cpp'
--- tests/mocks/Unity/fake_unity_plugin.cpp 2014-02-07 09:55:56 +0000
+++ tests/mocks/Unity/fake_unity_plugin.cpp 2014-03-07 12:41:18 +0000
@@ -48,5 +48,12 @@
48 qmlRegisterUncreatableType<CategoryResults>(uri, 0, 1, "CategoryResults", "Can't create");48 qmlRegisterUncreatableType<CategoryResults>(uri, 0, 1, "CategoryResults", "Can't create");
49 qmlRegisterType<DeeListModel>(uri, 0, 1, "DeeListModel");49 qmlRegisterType<DeeListModel>(uri, 0, 1, "DeeListModel");
5050
51 qmlRegisterType<scopes_ng::PreviewModel>(uri, 0, 1, "FakePreviewModel");51 // same for version 0.2
52 qmlRegisterUncreatableType<Preview>(uri, 0, 2, "Preview", "Can't create Preview object in QML.");
53 qmlRegisterType<Scopes>(uri, 0, 2, "Scopes");
54 qmlRegisterType<Scope>(uri, 0, 2, "Scope");
55 qmlRegisterType<Categories>(uri, 0, 2, "Categories");
56 qmlRegisterUncreatableType<CategoryResults>(uri, 0, 2, "CategoryResults", "Can't create");
57 qmlRegisterType<DeeListModel>(uri, 0, 2, "DeeListModel");
58 qmlRegisterType<scopes_ng::PreviewModel>(uri, 0, 2, "FakePreviewModel");
52}59}
5360
=== modified file 'tests/plugins/DashViews/organicgridtest.cpp'
--- tests/plugins/DashViews/organicgridtest.cpp 2014-01-14 12:25:52 +0000
+++ tests/plugins/DashViews/organicgridtest.cpp 2014-03-07 12:41:18 +0000
@@ -134,11 +134,12 @@
134 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/organicgridtest.qml"));134 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/organicgridtest.qml"));
135135
136 view->show();136 view->show();
137 QTest::qWaitForWindowExposed(view);
137 view->resize(470, 400);138 view->resize(470, 400);
138 QTest::qWaitForWindowExposed(view);
139139
140 grid = dynamic_cast<OrganicGrid*>(view->rootObject()->findChild<QObject*>("grid"));140 grid = dynamic_cast<OrganicGrid*>(view->rootObject()->findChild<QObject*>("grid"));
141 grid->setModel(model);141 grid->setModel(model);
142 QTRY_COMPARE(grid->width(), 470.);
142143
143 checkInitialPositions();144 checkInitialPositions();
144 }145 }
145146
=== modified file 'tests/plugins/DashViews/verticaljournaltest.cpp'
--- tests/plugins/DashViews/verticaljournaltest.cpp 2014-01-17 10:08:23 +0000
+++ tests/plugins/DashViews/verticaljournaltest.cpp 2014-03-07 12:41:18 +0000
@@ -135,11 +135,12 @@
135 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltest.qml"));135 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltest.qml"));
136136
137 view->show();137 view->show();
138 view->resize(470, 400);
139 QTest::qWaitForWindowExposed(view);138 QTest::qWaitForWindowExposed(view);
139 view->resize(470, 400);
140140
141 vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));141 vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));
142 vj->setModel(model);142 vj->setModel(model);
143 QTRY_COMPARE(vj->width(), 470.);
143144
144 checkInitialPositions();145 checkInitialPositions();
145 }146 }
146147
=== modified file 'tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp'
--- tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp 2014-02-24 16:05:07 +0000
+++ tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp 2014-03-07 12:41:18 +0000
@@ -103,6 +103,14 @@
103{103{
104 GestureTest::init();104 GestureTest::init();
105105
106 // We shouldn't need the three lines below, but a compiz/unity7
107 // regression means we don't pass the test without them because
108 // the window doesn't have the proper size. Can be removed in the
109 // future if the regression is fixed and tests pass again
110 m_view->resize(m_view->rootObject()->width(), m_view->rootObject()->height());
111 QTRY_COMPARE(m_view->width(), (int)m_view->rootObject()->width());
112 QTRY_COMPARE(m_view->height(), (int)m_view->rootObject()->height());
113
106 fakeTimeSource.reset(new FakeTimeSource);114 fakeTimeSource.reset(new FakeTimeSource);
107 fakeTimer = new FakeTimer(fakeTimeSource);115 fakeTimer = new FakeTimer(fakeTimeSource);
108}116}
109117
=== modified file 'tests/qmltests/Dash/Previews/tst_Preview.qml'
--- tests/qmltests/Dash/Previews/tst_Preview.qml 2014-02-12 08:22:16 +0000
+++ tests/qmltests/Dash/Previews/tst_Preview.qml 2014-03-07 12:41:18 +0000
@@ -18,7 +18,7 @@
18import QtTest 1.018import QtTest 1.0
19import "../../../../qml/Dash/Previews"19import "../../../../qml/Dash/Previews"
20import Unity.Test 0.1 as UT20import Unity.Test 0.1 as UT
21import Unity 0.1 as Unity21import Unity 0.2 as Unity
2222
23Rectangle {23Rectangle {
24 id: root24 id: root
2525
=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
--- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-02-05 08:20:25 +0000
+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-03-07 12:41:18 +0000
@@ -301,18 +301,18 @@
301 }301 }
302302
303 function test_getRendererCarouselGridFallback() {303 function test_getRendererCarouselGridFallback() {
304 var rendererId = "carousel"304 var template = new Object()
305 var contentType = ""305 template["category-layout"] = "carousel"
306 var rendererHint = ""
307 var results = new Object()306 var results = new Object()
308307 var renderer
309 results.count = 7308
310 var renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)309 results.count = 5
311 compare(renderer, "Generic/GenericCarousel.qml")310 renderer = genericScopeView.getRenderer(template, results)
312311 compare(renderer, "CardCarousel.qml")
313 results.count = 6312
314 renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)313 results.count = 4
315 compare(renderer, "Generic/GenericFilterGrid.qml")314 renderer = genericScopeView.getRenderer(template, results)
315 compare(renderer, "CardFilterGrid.qml")
316 }316 }
317317
318 function test_showPreviewCarousel() {318 function test_showPreviewCarousel() {
319319
=== modified file 'tools/registry-tracker.cpp'
--- tools/registry-tracker.cpp 2013-12-20 15:27:59 +0000
+++ tools/registry-tracker.cpp 2014-03-07 12:41:18 +0000
@@ -112,5 +112,6 @@
112 QStringList arguments;112 QStringList arguments;
113 arguments << m_runtime_config.fileName();113 arguments << m_runtime_config.fileName();
114114
115 m_registry.setProcessChannelMode(QProcess::ForwardedChannels);
115 m_registry.start(registryBin, arguments);116 m_registry.start(registryBin, arguments);
116}117}

Subscribers

People subscribed via source and target branches