Merge lp:~unity-team/unity8/screens-workspaces-switcher into lp:unity8
- screens-workspaces-switcher
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~unity-team/unity8/screens-workspaces-switcher |
Merge into: | lp:unity8 |
Prerequisite: | lp:~unity-team/unity8/workspace-backend |
Diff against target: |
2624 lines (+1383/-431) 25 files modified
plugins/WindowManager/Screen.h (+0/-1) plugins/WindowManager/Screens.cpp (+10/-0) plugins/WindowManager/Screens.h (+3/-0) plugins/WindowManager/WorkspaceModel.h (+2/-2) qml/Shell.qml (+4/-4) qml/Stage/ApplicationWindow.qml (+12/-209) qml/Stage/DecoratedWindow.qml (+10/-10) qml/Stage/Spread/ScreensAndWorkspaces.qml (+261/-0) qml/Stage/Spread/Spread.qml (+8/-9) qml/Stage/Spread/SpreadDelegateInputArea.qml (+36/-17) qml/Stage/Spread/WorkspacePreview.qml (+127/-0) qml/Stage/Spread/Workspaces.qml (+412/-0) qml/Stage/Stage.qml (+206/-99) qml/Stage/WindowResizeArea.qml (+27/-4) qml/Stage/WindowStateSaver.qml (+4/-1) qml/Stage/WorkspaceSwitcher.qml (+196/-0) tests/mocks/Unity/Application/MirSurfaceItem.cpp (+26/-7) tests/mocks/Unity/Application/resources/MirSurfaceItem.qml (+0/-3) tests/mocks/WindowManager/MockScreens.cpp (+7/-4) tests/qmltests/Stage/tst_ApplicationWindow.qml (+10/-42) tests/qmltests/Stage/tst_DesktopStage.qml (+0/-2) tests/qmltests/Stage/tst_PhoneStage.qml (+0/-1) tests/qmltests/Stage/tst_TabletStage.qml (+6/-10) tests/qmltests/tst_OrientedShell.qml (+0/-1) tests/qmltests/tst_Shell.qml (+16/-5) |
To merge this branch: | bzr merge lp:~unity-team/unity8/screens-workspaces-switcher |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot | continuous-integration | Needs Fixing | |
Unity Team | Pending | ||
Review via email: mp+320155@code.launchpad.net |
This proposal supersedes a proposal from 2017-02-23.
Commit message
screens and workspaces switcher
Description of the change
Prereq-archive: ppa:ci-
WIP
related branches:
https:/
https:/
https:/
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2764
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2766
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2766
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2787
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2788
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2789
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2790
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2792
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2793
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2794
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2795
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2799
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal | # |
I know this is still very much WIP but better have a look at those missing i18n.tr() calls, otherwise they'll get forgotten for sure :)
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2800
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2801
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2802
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2803
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2804
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2805
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2806
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2807
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2807
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2808
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2809
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2810
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2813
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2814
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2816
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2817
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2818
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2820
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2821
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:2822
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2824. By Nick Dedekind
-
merged with prereq
- 2825. By Michael Zanetti
-
fix the mock to not be funky with screen sizes at startup
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2823
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2825
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2826. By Michael Zanetti
-
implement our own popup
- 2827. By Michael Zanetti
-
fix workspace drag reordering again
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2826
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2827
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2828. By Nick Dedekind
-
merged prereq
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2828
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2829
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2830
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2829. By Michael Zanetti
-
bring the splash screen back, drop the screenshot image (surfaces keep on to their buffer now anyways)
- 2830. By Michael Zanetti
-
merge
- 2831. By Michael Zanetti
-
merge
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2831
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2832. By Michael Zanetti
-
some tweaks and cleanups
- 2833. By Michael Zanetti
-
prevent closing a workspace if it's the last one
- 2834. By Michael Zanetti
-
apply nick's patch for fixing tiny window sizes
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2832
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2834
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2835. By Michael Zanetti
-
merge prereq
- 2836. By Michael Zanetti
-
add WorkspaceSwitcher
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2835
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2837. By Nick Dedekind
-
merged with prereq
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2836
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2837
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2838
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2838. By Michael Zanetti
-
don't reach out of context
- 2839. By Michael Zanetti
-
merge
- 2840. By Michael Zanetti
-
merge parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2840
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2841. By Nick Dedekind
-
merged parent
- 2842. By Nick Dedekind
-
merged prereq
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2842
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2843. By Michael Zanetti
-
workspace switcher now working
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2843
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2844. By Nick Dedekind
-
merged prereq
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2844
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2844
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2845. By Nick Dedekind
-
merged parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2845
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2845
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2846. By Michael Zanetti
-
fix focus issue and activate the surface once dropped on a workspace
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2846
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2847
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2847. By Michael Zanetti
-
decrease timer timeout for hiding the workspaceswitcher
- 2848. By Michael Zanetti
-
merge prereq
- 2849. By Michael Zanetti
-
merge
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2847
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2849
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2850. By Michael Zanetti
-
merge prereq
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2850
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2851. By Michael Zanetti
-
fix testApplication
Window
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2851
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2852. By Michael Zanetti
-
fix testDesktopStage
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2852
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2853. By Michael Zanetti
-
some more tabletstage test fixes
- 2854. By Michael Zanetti
-
merge prereq
- 2855. By Michael Zanetti
-
some more test fixes
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2854
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2855
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2855
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2856. By Michael Zanetti
-
testShell should be working again
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2856
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2857. By Michael Zanetti
-
don't show minimized apps in the workspace previews
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2857
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2858. By Michael Zanetti
-
don't really activate a workspace just yet when clicking on it
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2858
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2859. By Nick Dedekind
-
merged pre-req
- 2860. By Nick Dedekind
-
merged with pre-req
- 2861. By Nick Dedekind
-
merged pre-req
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2859
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2861
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2862. By Nick Dedekind
-
merged prereq
- 2863. By Nick Dedekind
-
merged prereq
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2863
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2864. By Nick Dedekind
-
merged pre-req
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2864
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2865. By Nick Dedekind
-
merged pre-req
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2865
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2866
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
- 2866. By Michael Zanetti
-
test fixes
- 2867. By Michael Zanetti
-
merge
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2867
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2868. By Michael Zanetti
-
rework workspace switcher for up/down navigation for screens
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2868
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2869. By Nick Dedekind
-
removed debug
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2869
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unmerged revisions
- 2869. By Nick Dedekind
-
removed debug
- 2868. By Michael Zanetti
-
rework workspace switcher for up/down navigation for screens
- 2867. By Michael Zanetti
-
merge
- 2866. By Michael Zanetti
-
test fixes
- 2865. By Nick Dedekind
-
merged pre-req
- 2864. By Nick Dedekind
-
merged pre-req
- 2863. By Nick Dedekind
-
merged prereq
- 2862. By Nick Dedekind
-
merged prereq
- 2861. By Nick Dedekind
-
merged pre-req
- 2860. By Nick Dedekind
-
merged with pre-req
Preview Diff
1 | === modified file 'plugins/WindowManager/Screen.h' | |||
2 | --- plugins/WindowManager/Screen.h 2017-04-06 12:58:36 +0000 | |||
3 | +++ plugins/WindowManager/Screen.h 2017-04-06 12:58:37 +0000 | |||
4 | @@ -16,7 +16,6 @@ | |||
5 | 16 | Q_OBJECT | 16 | Q_OBJECT |
6 | 17 | 17 | ||
7 | 18 | Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged) | 18 | Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged) |
8 | 19 | |||
9 | 20 | Q_PROPERTY(bool used READ used NOTIFY usedChanged) | 19 | Q_PROPERTY(bool used READ used NOTIFY usedChanged) |
10 | 21 | Q_PROPERTY(QString name READ name NOTIFY nameChanged) | 20 | Q_PROPERTY(QString name READ name NOTIFY nameChanged) |
11 | 22 | Q_PROPERTY(qtmir::OutputTypes outputType READ outputType NOTIFY outputTypeChanged) | 21 | Q_PROPERTY(qtmir::OutputTypes outputType READ outputType NOTIFY outputTypeChanged) |
12 | 23 | 22 | ||
13 | === modified file 'plugins/WindowManager/Screens.cpp' | |||
14 | --- plugins/WindowManager/Screens.cpp 2017-04-06 12:58:36 +0000 | |||
15 | +++ plugins/WindowManager/Screens.cpp 2017-04-06 12:58:37 +0000 | |||
16 | @@ -67,6 +67,16 @@ | |||
17 | 67 | return count(); | 67 | return count(); |
18 | 68 | } | 68 | } |
19 | 69 | 69 | ||
20 | 70 | int Screens::indexOf(Screen *screen) const | ||
21 | 71 | { | ||
22 | 72 | return m_screens.indexOf(screen); | ||
23 | 73 | } | ||
24 | 74 | |||
25 | 75 | Screen *Screens::get(int index) const | ||
26 | 76 | { | ||
27 | 77 | return m_screens.at(index); | ||
28 | 78 | } | ||
29 | 79 | |||
30 | 70 | int Screens::count() const | 80 | int Screens::count() const |
31 | 71 | { | 81 | { |
32 | 72 | return m_screens.size(); | 82 | return m_screens.size(); |
33 | 73 | 83 | ||
34 | === modified file 'plugins/WindowManager/Screens.h' | |||
35 | --- plugins/WindowManager/Screens.h 2017-04-06 12:58:36 +0000 | |||
36 | +++ plugins/WindowManager/Screens.h 2017-04-06 12:58:37 +0000 | |||
37 | @@ -49,6 +49,9 @@ | |||
38 | 49 | QVariant data(const QModelIndex &index, int role = ScreenRole) const override; | 49 | QVariant data(const QModelIndex &index, int role = ScreenRole) const override; |
39 | 50 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 50 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
40 | 51 | 51 | ||
41 | 52 | Q_INVOKABLE int indexOf(Screen*) const; | ||
42 | 53 | Q_INVOKABLE Screen* get(int index) const; | ||
43 | 54 | |||
44 | 52 | int count() const; | 55 | int count() const; |
45 | 53 | QVariant activeScreen() const; | 56 | QVariant activeScreen() const; |
46 | 54 | 57 | ||
47 | 55 | 58 | ||
48 | === modified file 'plugins/WindowManager/WorkspaceModel.h' | |||
49 | --- plugins/WindowManager/WorkspaceModel.h 2017-04-06 12:58:36 +0000 | |||
50 | +++ plugins/WindowManager/WorkspaceModel.h 2017-04-06 12:58:37 +0000 | |||
51 | @@ -49,8 +49,8 @@ | |||
52 | 49 | void remove(Workspace* workspace); | 49 | void remove(Workspace* workspace); |
53 | 50 | virtual void move(int from, int to); | 50 | virtual void move(int from, int to); |
54 | 51 | 51 | ||
57 | 52 | int indexOf(Workspace *workspace) const; | 52 | Q_INVOKABLE int indexOf(Workspace *workspace) const; |
58 | 53 | Workspace* get(int index) const; | 53 | Q_INVOKABLE Workspace* get(int index) const; |
59 | 54 | 54 | ||
60 | 55 | // From QAbstractItemModel | 55 | // From QAbstractItemModel |
61 | 56 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 56 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
62 | 57 | 57 | ||
63 | === modified file 'qml/Shell.qml' | |||
64 | --- qml/Shell.qml 2017-04-06 12:58:36 +0000 | |||
65 | +++ qml/Shell.qml 2017-04-06 12:58:37 +0000 | |||
66 | @@ -99,7 +99,7 @@ | |||
67 | 99 | 99 | ||
68 | 100 | readonly property var topLevelSurfaceList: { | 100 | readonly property var topLevelSurfaceList: { |
69 | 101 | if (!WMScreen.currentWorkspace) return null; | 101 | if (!WMScreen.currentWorkspace) return null; |
71 | 102 | return WMScreen.currentWorkspace.windowModel | 102 | return stage.temporarySelectedWorkspace ? stage.temporarySelectedWorkspace.windowModel : WMScreen.currentWorkspace.windowModel |
72 | 103 | } | 103 | } |
73 | 104 | 104 | ||
74 | 105 | onMainAppChanged: { | 105 | onMainAppChanged: { |
75 | @@ -189,11 +189,11 @@ | |||
76 | 189 | } | 189 | } |
77 | 190 | 190 | ||
78 | 191 | function startApp(appId) { | 191 | function startApp(appId) { |
82 | 192 | if (ApplicationManager.findApplication(appId)) { | 192 | if (!ApplicationManager.findApplication(appId)) { |
80 | 193 | ApplicationManager.requestFocusApplication(appId); | ||
81 | 194 | } else { | ||
83 | 195 | ApplicationManager.startApplication(appId); | 193 | ApplicationManager.startApplication(appId); |
84 | 196 | } | 194 | } |
85 | 195 | ApplicationManager.requestFocusApplication(appId); | ||
86 | 196 | stage.closeSpread(); | ||
87 | 197 | } | 197 | } |
88 | 198 | 198 | ||
89 | 199 | function startLockedApp(app) { | 199 | function startLockedApp(app) { |
90 | 200 | 200 | ||
91 | === modified file 'qml/Stage/ApplicationWindow.qml' | |||
92 | --- qml/Stage/ApplicationWindow.qml 2017-02-24 12:37:14 +0000 | |||
93 | +++ qml/Stage/ApplicationWindow.qml 2017-04-06 12:58:37 +0000 | |||
94 | @@ -52,13 +52,8 @@ | |||
95 | 52 | // other instructions. | 52 | // other instructions. |
96 | 53 | if (surface) { | 53 | if (surface) { |
97 | 54 | surfaceContainer.surface = surface; | 54 | surfaceContainer.surface = surface; |
98 | 55 | d.liveSurface = surface.live; | ||
99 | 56 | d.hadSurface = false; | ||
100 | 57 | surfaceInitTimer.start(); | 55 | surfaceInitTimer.start(); |
101 | 58 | } else { | 56 | } else { |
102 | 59 | if (d.surfaceInitialized) { | ||
103 | 60 | d.hadSurface = true; | ||
104 | 61 | } | ||
105 | 62 | d.surfaceInitialized = false; | 57 | d.surfaceInitialized = false; |
106 | 63 | surfaceContainer.surface = null; | 58 | surfaceContainer.surface = null; |
107 | 64 | } | 59 | } |
108 | @@ -67,21 +62,6 @@ | |||
109 | 67 | QtObject { | 62 | QtObject { |
110 | 68 | id: d | 63 | id: d |
111 | 69 | 64 | ||
112 | 70 | property bool liveSurface: false; | ||
113 | 71 | property var con: Connections { | ||
114 | 72 | target: root.surface | ||
115 | 73 | onLiveChanged: d.liveSurface = root.surface.live | ||
116 | 74 | } | ||
117 | 75 | // using liveSurface instead of root.surface.live because with the latter | ||
118 | 76 | // this expression is not reevaluated when root.surface changes | ||
119 | 77 | readonly property bool needToTakeScreenshot: root.surface && d.surfaceInitialized && !d.liveSurface | ||
120 | 78 | && applicationState !== ApplicationInfoInterface.Running | ||
121 | 79 | onNeedToTakeScreenshotChanged: { | ||
122 | 80 | if (needToTakeScreenshot && screenshotImage.status === Image.Null) { | ||
123 | 81 | screenshotImage.take(); | ||
124 | 82 | } | ||
125 | 83 | } | ||
126 | 84 | |||
127 | 85 | // helpers so that we don't have to check for the existence of an application everywhere | 65 | // helpers so that we don't have to check for the existence of an application everywhere |
128 | 86 | // (in order to avoid breaking qml binding due to a javascript exception) | 66 | // (in order to avoid breaking qml binding due to a javascript exception) |
129 | 87 | readonly property string name: root.application ? root.application.name : "" | 67 | readonly property string name: root.application ? root.application.name : "" |
130 | @@ -131,34 +111,10 @@ | |||
131 | 131 | id: surfaceInitTimer | 111 | id: surfaceInitTimer |
132 | 132 | interval: 100 | 112 | interval: 100 |
133 | 133 | onTriggered: { | 113 | onTriggered: { |
162 | 134 | if (root.surface && root.surface.live) {d.surfaceInitialized = true;} | 114 | if (root.surface && root.surface.live) { |
163 | 135 | } | 115 | d.surfaceInitialized = true; |
164 | 136 | } | 116 | d.hadSurface = true; |
165 | 137 | 117 | } | |
138 | 138 | Timer { | ||
139 | 139 | id: surfaceIsOldTimer | ||
140 | 140 | interval: 1000 | ||
141 | 141 | onTriggered: { if (stateGroup.state === "surface") { d.surfaceOldEnoughToBeResized = true; } } | ||
142 | 142 | } | ||
143 | 143 | |||
144 | 144 | Image { | ||
145 | 145 | id: screenshotImage | ||
146 | 146 | objectName: "screenshotImage" | ||
147 | 147 | anchors.fill: parent | ||
148 | 148 | fillMode: Image.PreserveAspectCrop | ||
149 | 149 | horizontalAlignment: Image.AlignLeft | ||
150 | 150 | verticalAlignment: Image.AlignTop | ||
151 | 151 | antialiasing: !root.interactive | ||
152 | 152 | z: 1 | ||
153 | 153 | |||
154 | 154 | function take() { | ||
155 | 155 | // Save memory by using a half-resolution (thus quarter size) screenshot. | ||
156 | 156 | // Do not make this a binding, we can only take the screenshot once! | ||
157 | 157 | surfaceContainer.grabToImage( | ||
158 | 158 | function(result) { | ||
159 | 159 | screenshotImage.source = result.url; | ||
160 | 160 | }, | ||
161 | 161 | Qt.size(root.width / 2, root.height / 2)); | ||
166 | 162 | } | 118 | } |
167 | 163 | } | 119 | } |
168 | 164 | 120 | ||
169 | @@ -167,7 +123,7 @@ | |||
170 | 167 | visible: active | 123 | visible: active |
171 | 168 | active: false | 124 | active: false |
172 | 169 | anchors.fill: parent | 125 | anchors.fill: parent |
174 | 170 | z: screenshotImage.z + 1 | 126 | z: 1 |
175 | 171 | sourceComponent: Component { | 127 | sourceComponent: Component { |
176 | 172 | Splash { | 128 | Splash { |
177 | 173 | id: splash | 129 | id: splash |
178 | @@ -238,167 +194,14 @@ | |||
179 | 238 | id: stateGroup | 194 | id: stateGroup |
180 | 239 | objectName: "applicationWindowStateGroup" | 195 | objectName: "applicationWindowStateGroup" |
181 | 240 | states: [ | 196 | states: [ |
197 | 241 | State { | 197 | State{ |
183 | 242 | name: "void" | ||
184 | 243 | when: | ||
185 | 244 | d.hadSurface && (!root.surface || !d.surfaceInitialized) | ||
186 | 245 | && | ||
187 | 246 | screenshotImage.status !== Image.Ready | ||
188 | 247 | }, | ||
189 | 248 | State { | ||
190 | 249 | name: "splashScreen" | ||
191 | 250 | when: | ||
192 | 251 | !d.hadSurface && (!root.surface || !d.surfaceInitialized) | ||
193 | 252 | && | ||
194 | 253 | screenshotImage.status !== Image.Ready | ||
195 | 254 | }, | ||
196 | 255 | State { | ||
198 | 256 | name: "surface" | 198 | name: "surface" |
344 | 257 | when: | 199 | when: (root.surface && d.surfaceInitialized) || d.hadSurface |
345 | 258 | (root.surface && d.surfaceInitialized) | 200 | }, |
346 | 259 | && | 201 | State { |
347 | 260 | (d.liveSurface || | 202 | name: "splash" |
348 | 261 | (d.applicationState !== ApplicationInfoInterface.Running | 203 | when: !root.surface && !d.surfaceInitialized && !d.hadSurface |
349 | 262 | && screenshotImage.status !== Image.Ready)) | 204 | PropertyChanges { target: splashLoader; active: true } |
205 | 263 | PropertyChanges { | ||
206 | 264 | target: root | ||
207 | 265 | implicitWidth: surfaceContainer.implicitWidth | ||
208 | 266 | implicitHeight: surfaceContainer.implicitHeight | ||
209 | 267 | } | ||
210 | 268 | }, | ||
211 | 269 | State { | ||
212 | 270 | name: "screenshot" | ||
213 | 271 | when: | ||
214 | 272 | screenshotImage.status === Image.Ready | ||
215 | 273 | && | ||
216 | 274 | (d.applicationState !== ApplicationInfoInterface.Running | ||
217 | 275 | || !root.surface || !d.surfaceInitialized) | ||
218 | 276 | }, | ||
219 | 277 | State { | ||
220 | 278 | // This is a dead end. From here we expect the surface to be removed from the model | ||
221 | 279 | // shortly after we stop referencing to it in our SurfaceContainer. | ||
222 | 280 | name: "closed" | ||
223 | 281 | when: | ||
224 | 282 | // The surface died while the application is running. It must have been closed | ||
225 | 283 | // by the shell or the application decided to destroy it by itself | ||
226 | 284 | root.surface && d.surfaceInitialized && !d.liveSurface | ||
227 | 285 | && d.applicationState === ApplicationInfoInterface.Running | ||
228 | 286 | } | ||
229 | 287 | ] | ||
230 | 288 | |||
231 | 289 | transitions: [ | ||
232 | 290 | Transition { | ||
233 | 291 | from: ""; to: "splashScreen" | ||
234 | 292 | PropertyAction { target: splashLoader; property: "active"; value: true } | ||
235 | 293 | PropertyAction { target: surfaceContainer | ||
236 | 294 | property: "visible"; value: false } | ||
237 | 295 | }, | ||
238 | 296 | Transition { | ||
239 | 297 | from: "splashScreen"; to: "surface" | ||
240 | 298 | SequentialAnimation { | ||
241 | 299 | PropertyAction { target: surfaceContainer | ||
242 | 300 | property: "opacity"; value: 0.0 } | ||
243 | 301 | PropertyAction { target: surfaceContainer | ||
244 | 302 | property: "visible"; value: true } | ||
245 | 303 | UbuntuNumberAnimation { target: surfaceContainer; property: "opacity"; | ||
246 | 304 | from: 0.0; to: 1.0 | ||
247 | 305 | duration: UbuntuAnimation.BriskDuration } | ||
248 | 306 | ScriptAction { script: { | ||
249 | 307 | splashLoader.active = false; | ||
250 | 308 | surfaceIsOldTimer.start(); | ||
251 | 309 | } } | ||
252 | 310 | } | ||
253 | 311 | }, | ||
254 | 312 | Transition { | ||
255 | 313 | from: "surface"; to: "splashScreen" | ||
256 | 314 | SequentialAnimation { | ||
257 | 315 | ScriptAction { script: { | ||
258 | 316 | surfaceIsOldTimer.stop(); | ||
259 | 317 | d.surfaceOldEnoughToBeResized = false; | ||
260 | 318 | splashLoader.active = true; | ||
261 | 319 | surfaceContainer.visible = true; | ||
262 | 320 | } } | ||
263 | 321 | UbuntuNumberAnimation { target: splashLoader; property: "opacity"; | ||
264 | 322 | from: 0.0; to: 1.0 | ||
265 | 323 | duration: UbuntuAnimation.BriskDuration } | ||
266 | 324 | PropertyAction { target: surfaceContainer | ||
267 | 325 | property: "visible"; value: false } | ||
268 | 326 | } | ||
269 | 327 | }, | ||
270 | 328 | Transition { | ||
271 | 329 | from: "surface"; to: "screenshot" | ||
272 | 330 | SequentialAnimation { | ||
273 | 331 | ScriptAction { script: { | ||
274 | 332 | surfaceIsOldTimer.stop(); | ||
275 | 333 | d.surfaceOldEnoughToBeResized = false; | ||
276 | 334 | screenshotImage.visible = true; | ||
277 | 335 | } } | ||
278 | 336 | UbuntuNumberAnimation { target: screenshotImage; property: "opacity"; | ||
279 | 337 | from: 0.0; to: 1.0 | ||
280 | 338 | duration: UbuntuAnimation.BriskDuration } | ||
281 | 339 | ScriptAction { script: { | ||
282 | 340 | surfaceContainer.visible = false; | ||
283 | 341 | surfaceContainer.surface = null; | ||
284 | 342 | d.hadSurface = true; | ||
285 | 343 | } } | ||
286 | 344 | } | ||
287 | 345 | }, | ||
288 | 346 | Transition { | ||
289 | 347 | from: "screenshot"; to: "surface" | ||
290 | 348 | SequentialAnimation { | ||
291 | 349 | PropertyAction { target: surfaceContainer | ||
292 | 350 | property: "visible"; value: true } | ||
293 | 351 | UbuntuNumberAnimation { target: screenshotImage; property: "opacity"; | ||
294 | 352 | from: 1.0; to: 0.0 | ||
295 | 353 | duration: UbuntuAnimation.BriskDuration } | ||
296 | 354 | ScriptAction { script: { | ||
297 | 355 | screenshotImage.visible = false; | ||
298 | 356 | screenshotImage.source = ""; | ||
299 | 357 | surfaceIsOldTimer.start(); | ||
300 | 358 | } } | ||
301 | 359 | } | ||
302 | 360 | }, | ||
303 | 361 | Transition { | ||
304 | 362 | from: "splashScreen"; to: "screenshot" | ||
305 | 363 | SequentialAnimation { | ||
306 | 364 | PropertyAction { target: screenshotImage | ||
307 | 365 | property: "visible"; value: true } | ||
308 | 366 | UbuntuNumberAnimation { target: screenshotImage; property: "opacity"; | ||
309 | 367 | from: 0.0; to: 1.0 | ||
310 | 368 | duration: UbuntuAnimation.BriskDuration } | ||
311 | 369 | PropertyAction { target: splashLoader; property: "active"; value: false } | ||
312 | 370 | } | ||
313 | 371 | }, | ||
314 | 372 | Transition { | ||
315 | 373 | from: "surface"; to: "void" | ||
316 | 374 | ScriptAction { script: { | ||
317 | 375 | surfaceIsOldTimer.stop(); | ||
318 | 376 | d.surfaceOldEnoughToBeResized = false; | ||
319 | 377 | surfaceContainer.visible = false; | ||
320 | 378 | } } | ||
321 | 379 | }, | ||
322 | 380 | Transition { | ||
323 | 381 | from: "void"; to: "surface" | ||
324 | 382 | SequentialAnimation { | ||
325 | 383 | PropertyAction { target: surfaceContainer; property: "opacity"; value: 0.0 } | ||
326 | 384 | PropertyAction { target: surfaceContainer; property: "visible"; value: true } | ||
327 | 385 | UbuntuNumberAnimation { target: surfaceContainer; property: "opacity"; | ||
328 | 386 | from: 0.0; to: 1.0 | ||
329 | 387 | duration: UbuntuAnimation.BriskDuration } | ||
330 | 388 | ScriptAction { script: { | ||
331 | 389 | surfaceIsOldTimer.start(); | ||
332 | 390 | } } | ||
333 | 391 | } | ||
334 | 392 | }, | ||
335 | 393 | Transition { | ||
336 | 394 | to: "closed" | ||
337 | 395 | SequentialAnimation { | ||
338 | 396 | ScriptAction { script: { | ||
339 | 397 | surfaceContainer.visible = false; | ||
340 | 398 | surfaceContainer.surface = null; | ||
341 | 399 | d.hadSurface = true; | ||
342 | 400 | } } | ||
343 | 401 | } | ||
350 | 402 | } | 205 | } |
351 | 403 | ] | 206 | ] |
352 | 404 | } | 207 | } |
353 | 405 | 208 | ||
354 | === modified file 'qml/Stage/DecoratedWindow.qml' | |||
355 | --- qml/Stage/DecoratedWindow.qml 2017-04-06 12:58:36 +0000 | |||
356 | +++ qml/Stage/DecoratedWindow.qml 2017-04-06 12:58:37 +0000 | |||
357 | @@ -126,15 +126,15 @@ | |||
358 | 126 | name: "preview"; when: root.scaleToPreviewProgress > 0 | 126 | name: "preview"; when: root.scaleToPreviewProgress > 0 |
359 | 127 | PropertyChanges { | 127 | PropertyChanges { |
360 | 128 | target: root | 128 | target: root |
363 | 129 | implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress) | 129 | implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.requestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress) |
364 | 130 | implicitHeight: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, root.scaleToPreviewSize, root.scaleToPreviewProgress) | 130 | implicitHeight: MathUtils.linearAnimation(0, 1, applicationWindow.requestedHeight, root.scaleToPreviewSize, root.scaleToPreviewProgress) |
365 | 131 | } | 131 | } |
366 | 132 | PropertyChanges { | 132 | PropertyChanges { |
367 | 133 | target: applicationWindow; | 133 | target: applicationWindow; |
372 | 134 | requestedWidth: applicationWindow.oldRequestedWidth | 134 | // requestedWidth: applicationWindow.oldRequestedWidth |
373 | 135 | requestedHeight: applicationWindow.oldRequestedHeight | 135 | // requestedHeight: applicationWindow.oldRequestedHeight |
374 | 136 | width: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, applicationWindow.minSize, root.scaleToPreviewProgress) | 136 | width: MathUtils.linearAnimation(0, 1, applicationWindow.requestedWidth, applicationWindow.minSize, root.scaleToPreviewProgress) |
375 | 137 | height: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress) | 137 | height: MathUtils.linearAnimation(0, 1, applicationWindow.requestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress) |
376 | 138 | itemScale: root.implicitWidth / width | 138 | itemScale: root.implicitWidth / width |
377 | 139 | } | 139 | } |
378 | 140 | } | 140 | } |
379 | @@ -173,10 +173,10 @@ | |||
380 | 173 | height: implicitHeight | 173 | height: implicitHeight |
381 | 174 | requestedHeight: !counterRotate ? root.requestedHeight - d.requestedDecorationHeight : root.requestedWidth | 174 | requestedHeight: !counterRotate ? root.requestedHeight - d.requestedDecorationHeight : root.requestedWidth |
382 | 175 | requestedWidth: !counterRotate ? root.requestedWidth : root.requestedHeight - d.requestedDecorationHeight | 175 | requestedWidth: !counterRotate ? root.requestedWidth : root.requestedHeight - d.requestedDecorationHeight |
387 | 176 | property int oldRequestedWidth: requestedWidth | 176 | // property int oldRequestedWidth: requestedWidth |
388 | 177 | property int oldRequestedHeight: requestedHeight | 177 | // property int oldRequestedHeight: requestedHeight |
389 | 178 | onRequestedWidthChanged: oldRequestedWidth = requestedWidth | 178 | // onRequestedWidthChanged: oldRequestedWidth = requestedWidth |
390 | 179 | onRequestedHeightChanged: oldRequestedHeight = requestedHeight | 179 | // onRequestedHeightChanged: oldRequestedHeight = requestedHeight |
391 | 180 | focus: true | 180 | focus: true |
392 | 181 | 181 | ||
393 | 182 | property real itemScale: 1 | 182 | property real itemScale: 1 |
394 | 183 | 183 | ||
395 | === added file 'qml/Stage/Spread/ScreensAndWorkspaces.qml' | |||
396 | --- qml/Stage/Spread/ScreensAndWorkspaces.qml 1970-01-01 00:00:00 +0000 | |||
397 | +++ qml/Stage/Spread/ScreensAndWorkspaces.qml 2017-04-06 12:58:37 +0000 | |||
398 | @@ -0,0 +1,261 @@ | |||
399 | 1 | import QtQuick 2.4 | ||
400 | 2 | import Ubuntu.Components 1.3 | ||
401 | 3 | import Ubuntu.Components.Popups 1.3 | ||
402 | 4 | import WindowManager 1.0 | ||
403 | 5 | import Unity.Application 0.1 | ||
404 | 6 | import ".." | ||
405 | 7 | |||
406 | 8 | Item { | ||
407 | 9 | id: root | ||
408 | 10 | |||
409 | 11 | property string background | ||
410 | 12 | |||
411 | 13 | property var screensProxy: Screens.createProxy(); | ||
412 | 14 | |||
413 | 15 | property QtObject activeWorkspace: null | ||
414 | 16 | |||
415 | 17 | signal closeSpread(); | ||
416 | 18 | |||
417 | 19 | Row { | ||
418 | 20 | id: row | ||
419 | 21 | anchors.bottom: parent.bottom | ||
420 | 22 | anchors.horizontalCenter: parent.horizontalCenter | ||
421 | 23 | Behavior on anchors.horizontalCenterOffset { NumberAnimation { duration: UbuntuAnimation.SlowDuration } } | ||
422 | 24 | spacing: units.gu(1) | ||
423 | 25 | |||
424 | 26 | property var selectedIndex: undefined | ||
425 | 27 | |||
426 | 28 | Repeater { | ||
427 | 29 | model: screensProxy | ||
428 | 30 | |||
429 | 31 | delegate: Item { | ||
430 | 32 | height: root.height - units.gu(6) | ||
431 | 33 | width: workspaces.width | ||
432 | 34 | |||
433 | 35 | Item { | ||
434 | 36 | id: header | ||
435 | 37 | anchors { left: parent.left; top: parent.top; right: parent.right } | ||
436 | 38 | height: units.gu(7) | ||
437 | 39 | z: 1 | ||
438 | 40 | |||
439 | 41 | property bool isCurrent: { | ||
440 | 42 | // another screen is selected. | ||
441 | 43 | if (row.selectedIndex != undefined && row.selectedIndex != index) return false; | ||
442 | 44 | |||
443 | 45 | // this screen is active. | ||
444 | 46 | if (WMScreen.active && WMScreen.isSameAs(model.screen) && WMScreen.currentWorkspace.isSameAs(activeWorkspace)) return true; | ||
445 | 47 | if (model.screen.workspaces.indexOf(activeWorkspace) >= 0) return true; | ||
446 | 48 | |||
447 | 49 | // not active. | ||
448 | 50 | return false; | ||
449 | 51 | } | ||
450 | 52 | |||
451 | 53 | property bool isSelected: screenMA.containsMouse | ||
452 | 54 | onIsSelectedChanged: { | ||
453 | 55 | if (isSelected) { | ||
454 | 56 | row.selectedIndex = Qt.binding(function() { return index; }); | ||
455 | 57 | } else if (row.selectedIndex === index) { | ||
456 | 58 | row.selectedIndex = undefined; | ||
457 | 59 | } | ||
458 | 60 | } | ||
459 | 61 | |||
460 | 62 | UbuntuShape { | ||
461 | 63 | anchors.fill: parent | ||
462 | 64 | backgroundColor: "white" | ||
463 | 65 | opacity: header.isCurrent || header.isSelected ? 1.0 : 0.5 | ||
464 | 66 | } | ||
465 | 67 | |||
466 | 68 | DropArea { | ||
467 | 69 | anchors.fill: parent | ||
468 | 70 | keys: ["workspace"] | ||
469 | 71 | |||
470 | 72 | onEntered: { | ||
471 | 73 | workspaces.workspaceModel.insert(workspaces.workspaceModel.count, {text: drag.source.text}) | ||
472 | 74 | drag.source.inDropArea = true; | ||
473 | 75 | } | ||
474 | 76 | |||
475 | 77 | onExited: { | ||
476 | 78 | workspaces.workspaceModel.remove(workspaces.workspaceModel.count - 1, 1) | ||
477 | 79 | drag.source.inDropArea = false; | ||
478 | 80 | } | ||
479 | 81 | |||
480 | 82 | onDropped: { | ||
481 | 83 | drag.source.inDropArea = false; | ||
482 | 84 | } | ||
483 | 85 | } | ||
484 | 86 | |||
485 | 87 | Column { | ||
486 | 88 | anchors.fill: parent | ||
487 | 89 | anchors.margins: units.gu(1) | ||
488 | 90 | |||
489 | 91 | Label { | ||
490 | 92 | text: model.screen.name | ||
491 | 93 | color: header.isCurrent || header.isSelected ? "black" : "white" | ||
492 | 94 | } | ||
493 | 95 | |||
494 | 96 | Label { | ||
495 | 97 | text: model.screen.outputTypeName | ||
496 | 98 | color: header.isCurrent || header.isSelected ? "black" : "white" | ||
497 | 99 | fontSize: "x-small" | ||
498 | 100 | } | ||
499 | 101 | |||
500 | 102 | Label { | ||
501 | 103 | text: screen.availableModes[screen.currentModeIndex].size.width + "x" + screen.availableModes[screen.currentModeIndex].size.height | ||
502 | 104 | color: header.isCurrent || header.isSelected ? "black" : "white" | ||
503 | 105 | fontSize: "x-small" | ||
504 | 106 | } | ||
505 | 107 | } | ||
506 | 108 | |||
507 | 109 | Icon { | ||
508 | 110 | anchors { | ||
509 | 111 | top: parent.top | ||
510 | 112 | right: parent.right | ||
511 | 113 | margins: units.gu(1) | ||
512 | 114 | } | ||
513 | 115 | width: units.gu(3) | ||
514 | 116 | height: width | ||
515 | 117 | source: "image://theme/select" | ||
516 | 118 | color: header.isCurrent || header.isSelected ? "black" : "white" | ||
517 | 119 | visible: model.screen.active | ||
518 | 120 | } | ||
519 | 121 | |||
520 | 122 | MouseArea { | ||
521 | 123 | id: screenMA | ||
522 | 124 | hoverEnabled: true | ||
523 | 125 | anchors.fill: parent | ||
524 | 126 | |||
525 | 127 | onClicked: { | ||
526 | 128 | var obj = screensMenuComponent.createObject(header) | ||
527 | 129 | obj.open(mouseX, mouseY) | ||
528 | 130 | } | ||
529 | 131 | } | ||
530 | 132 | |||
531 | 133 | Component { | ||
532 | 134 | id: screensMenuComponent | ||
533 | 135 | UbuntuShape { | ||
534 | 136 | id: screensMenu | ||
535 | 137 | width: units.gu(20) | ||
536 | 138 | height: contentColumn.childrenRect.height | ||
537 | 139 | backgroundColor: "white" | ||
538 | 140 | |||
539 | 141 | function open(mouseX, mouseY) { | ||
540 | 142 | x = Math.max(0, Math.min(mouseX - width / 2, parent.width - width)) | ||
541 | 143 | y = mouseY + units.gu(1) | ||
542 | 144 | } | ||
543 | 145 | |||
544 | 146 | InverseMouseArea { | ||
545 | 147 | anchors.fill: parent | ||
546 | 148 | onClicked: { | ||
547 | 149 | screensMenu.destroy() | ||
548 | 150 | } | ||
549 | 151 | } | ||
550 | 152 | |||
551 | 153 | Column { | ||
552 | 154 | id: contentColumn | ||
553 | 155 | width: parent.width | ||
554 | 156 | ListItem { | ||
555 | 157 | height: layout.height | ||
556 | 158 | highlightColor: "transparent" | ||
557 | 159 | ListItemLayout { | ||
558 | 160 | id: layout | ||
559 | 161 | title.text: qsTr("Add workspace") | ||
560 | 162 | title.color: "black" | ||
561 | 163 | } | ||
562 | 164 | onClicked: { | ||
563 | 165 | screen.workspaces.addWorkspace(); | ||
564 | 166 | Screens.sync(root.screensProxy); | ||
565 | 167 | screensMenu.destroy(); | ||
566 | 168 | } | ||
567 | 169 | } | ||
568 | 170 | } | ||
569 | 171 | } | ||
570 | 172 | } | ||
571 | 173 | } | ||
572 | 174 | |||
573 | 175 | Workspaces { | ||
574 | 176 | id: workspaces | ||
575 | 177 | height: parent.height - header.height - units.gu(2) | ||
576 | 178 | width: { | ||
577 | 179 | var width = 0; | ||
578 | 180 | if (screensProxy.count == 1) { | ||
579 | 181 | width = Math.min(implicitWidth, root.width - units.gu(8)); | ||
580 | 182 | } else { | ||
581 | 183 | width = Math.min(implicitWidth, model.screen.active ? root.width - units.gu(48) : units.gu(40)) | ||
582 | 184 | } | ||
583 | 185 | return Math.max(workspaces.minimumWidth, width); | ||
584 | 186 | } | ||
585 | 187 | |||
586 | 188 | Behavior on width { UbuntuNumberAnimation {} } | ||
587 | 189 | anchors.bottom: parent.bottom | ||
588 | 190 | anchors.bottomMargin: units.gu(1) | ||
589 | 191 | anchors.horizontalCenter: parent.horizontalCenter | ||
590 | 192 | screen: model.screen | ||
591 | 193 | background: root.background | ||
592 | 194 | |||
593 | 195 | workspaceModel: model.screen.workspaces | ||
594 | 196 | activeWorkspace: root.activeWorkspace | ||
595 | 197 | readOnly: false | ||
596 | 198 | |||
597 | 199 | onCommitScreenSetup: Screens.sync(root.screensProxy) | ||
598 | 200 | onCloseSpread: root.closeSpread(); | ||
599 | 201 | |||
600 | 202 | onClicked: { | ||
601 | 203 | root.activeWorkspace = workspace; | ||
602 | 204 | } | ||
603 | 205 | } | ||
604 | 206 | } | ||
605 | 207 | } | ||
606 | 208 | } | ||
607 | 209 | |||
608 | 210 | Rectangle { | ||
609 | 211 | anchors { left: parent.left; top: parent.top; bottom: parent.bottom; topMargin: units.gu(6); bottomMargin: units.gu(1) } | ||
610 | 212 | width: units.gu(5) | ||
611 | 213 | color: "#33000000" | ||
612 | 214 | visible: (row.width - root.width + units.gu(10)) / 2 - row.anchors.horizontalCenterOffset > units.gu(5) | ||
613 | 215 | MouseArea { | ||
614 | 216 | id: leftScrollArea | ||
615 | 217 | anchors.fill: parent | ||
616 | 218 | hoverEnabled: true | ||
617 | 219 | onPressed: mouse.accepted = false; | ||
618 | 220 | } | ||
619 | 221 | DropArea { | ||
620 | 222 | id: leftFakeDropArea | ||
621 | 223 | anchors.fill: parent | ||
622 | 224 | keys: ["application", "workspace"] | ||
623 | 225 | } | ||
624 | 226 | } | ||
625 | 227 | Rectangle { | ||
626 | 228 | anchors { right: parent.right; top: parent.top; bottom: parent.bottom; topMargin: units.gu(6); bottomMargin: units.gu(1) } | ||
627 | 229 | width: units.gu(5) | ||
628 | 230 | color: "#33000000" | ||
629 | 231 | visible: (row.width - root.width + units.gu(10)) / 2 + row.anchors.horizontalCenterOffset > units.gu(5) | ||
630 | 232 | MouseArea { | ||
631 | 233 | id: rightScrollArea | ||
632 | 234 | anchors.fill: parent | ||
633 | 235 | hoverEnabled: true | ||
634 | 236 | onPressed: mouse.accepted = false; | ||
635 | 237 | } | ||
636 | 238 | DropArea { | ||
637 | 239 | id: rightFakeDropArea | ||
638 | 240 | anchors.fill: parent | ||
639 | 241 | keys: ["application", "workspace"] | ||
640 | 242 | } | ||
641 | 243 | } | ||
642 | 244 | Timer { | ||
643 | 245 | repeat: true | ||
644 | 246 | running: leftScrollArea.containsMouse || rightScrollArea.containsMouse || leftFakeDropArea.containsDrag || rightFakeDropArea.containsDrag | ||
645 | 247 | interval: UbuntuAnimation.SlowDuration | ||
646 | 248 | triggeredOnStart: true | ||
647 | 249 | onTriggered: { | ||
648 | 250 | var newOffset = row.anchors.horizontalCenterOffset; | ||
649 | 251 | var maxOffset = Math.max((row.width - root.width + units.gu(10)) / 2, 0); | ||
650 | 252 | if (leftScrollArea.containsMouse || leftFakeDropArea.containsDrag) { | ||
651 | 253 | newOffset += units.gu(20) | ||
652 | 254 | } else { | ||
653 | 255 | newOffset -= units.gu(20) | ||
654 | 256 | } | ||
655 | 257 | newOffset = Math.max(-maxOffset, Math.min(maxOffset, newOffset)); | ||
656 | 258 | row.anchors.horizontalCenterOffset = newOffset; | ||
657 | 259 | } | ||
658 | 260 | } | ||
659 | 261 | } | ||
660 | 0 | 262 | ||
661 | === modified file 'qml/Stage/Spread/Spread.qml' | |||
662 | --- qml/Stage/Spread/Spread.qml 2017-03-09 09:31:43 +0000 | |||
663 | +++ qml/Stage/Spread/Spread.qml 2017-04-06 12:58:37 +0000 | |||
664 | @@ -28,10 +28,10 @@ | |||
665 | 28 | property var spreadFlickable | 28 | property var spreadFlickable |
666 | 29 | 29 | ||
667 | 30 | // some config options | 30 | // some config options |
672 | 31 | property real contentMargin: 0.16 * root.height | 31 | property real contentMargin: 0.1 * root.height |
673 | 32 | property real contentTopMargin: contentMargin | 32 | property real contentTopMargin: contentMargin + root.y + windowTitle.height |
674 | 33 | property real contentBottomMargin: 0.35 * contentMargin | 33 | property real contentBottomMargin: contentMargin |
675 | 34 | property real windowTitleTopMargin: 3/4 * (contentTopMargin - windowTitle.height) | 34 | property real windowTitleTopMargin: contentMargin - windowTitle.height |
676 | 35 | property int stackItemCount: 3 | 35 | property int stackItemCount: 3 |
677 | 36 | property real leftRotationAngle: 22 | 36 | property real leftRotationAngle: 22 |
678 | 37 | property real rightRotationAngle: 32 | 37 | property real rightRotationAngle: 32 |
679 | @@ -52,7 +52,7 @@ | |||
680 | 52 | 52 | ||
681 | 53 | readonly property real spreadWidth: rightStackXPos - leftStackXPos | 53 | readonly property real spreadWidth: rightStackXPos - leftStackXPos |
682 | 54 | readonly property real spreadHeight: root.height | 54 | readonly property real spreadHeight: root.height |
684 | 55 | readonly property real spreadItemHeight: spreadHeight - contentTopMargin - contentBottomMargin | 55 | readonly property real spreadItemHeight: spreadHeight - contentMargin * 2 |
685 | 56 | readonly property real spreadItemWidth: stackHeight | 56 | readonly property real spreadItemWidth: stackHeight |
686 | 57 | 57 | ||
687 | 58 | readonly property real dynamicLeftRotationAngle: leftRotationAngle * rotationAngleFactor | 58 | readonly property real dynamicLeftRotationAngle: leftRotationAngle * rotationAngleFactor |
688 | @@ -92,10 +92,9 @@ | |||
689 | 92 | 92 | ||
690 | 93 | readonly property real visibleItemCount: (spreadWidth / spreadItemWidth) / (1 - itemOverlap) | 93 | readonly property real visibleItemCount: (spreadWidth / spreadItemWidth) / (1 - itemOverlap) |
691 | 94 | 94 | ||
696 | 95 | readonly property real spreadTotalWidth: Math.max(2,totalItemCount) * spreadWidth / visibleItemCount | 95 | readonly property real spreadTotalWidth: totalItemCount * spreadWidth / visibleItemCount |
697 | 96 | 96 | ||
698 | 97 | readonly property real centeringOffset: Math.max(spreadWidth - spreadTotalWidth ,0) / (2 * spreadWidth) | 97 | readonly property real centeringOffset: Math.max(spreadWidth - spreadTotalWidth + (leftStackXPos - leftMargin) * 2, 0) / (2 * spreadWidth) |
695 | 98 | |||
699 | 99 | 98 | ||
700 | 100 | readonly property var curve: BezierCurve { | 99 | readonly property var curve: BezierCurve { |
701 | 101 | controlPoint2: {'x': 0.19, 'y': 0.00} | 100 | controlPoint2: {'x': 0.19, 'y': 0.00} |
702 | 102 | 101 | ||
703 | === modified file 'qml/Stage/Spread/SpreadDelegateInputArea.qml' | |||
704 | --- qml/Stage/Spread/SpreadDelegateInputArea.qml 2016-11-07 14:07:45 +0000 | |||
705 | +++ qml/Stage/Spread/SpreadDelegateInputArea.qml 2017-04-06 12:58:37 +0000 | |||
706 | @@ -28,6 +28,9 @@ | |||
707 | 28 | 28 | ||
708 | 29 | readonly property alias distance: d.distance | 29 | readonly property alias distance: d.distance |
709 | 30 | 30 | ||
710 | 31 | property var stage: null | ||
711 | 32 | property var dragDelegate: null | ||
712 | 33 | |||
713 | 31 | signal clicked() | 34 | signal clicked() |
714 | 32 | signal close() | 35 | signal close() |
715 | 33 | 36 | ||
716 | @@ -84,33 +87,27 @@ | |||
717 | 84 | } | 87 | } |
718 | 85 | } | 88 | } |
719 | 86 | 89 | ||
720 | 87 | // Event eater | ||
721 | 88 | MouseArea { | ||
722 | 89 | anchors.fill: parent | ||
723 | 90 | onClicked: root.clicked() | ||
724 | 91 | onWheel: wheel.accepted = true | ||
725 | 92 | } | ||
726 | 93 | |||
727 | 94 | MultiPointTouchArea { | 90 | MultiPointTouchArea { |
728 | 95 | anchors.fill: parent | 91 | anchors.fill: parent |
729 | 96 | mouseEnabled: false | ||
730 | 97 | maximumTouchPoints: 1 | 92 | maximumTouchPoints: 1 |
731 | 98 | property int offset: 0 | 93 | property int offset: 0 |
732 | 99 | 94 | ||
733 | 95 | // tp.startY seems to be broken for mouse interaction... lets track it ourselves | ||
734 | 96 | property int startY: 0 | ||
735 | 97 | |||
736 | 100 | touchPoints: [ | 98 | touchPoints: [ |
737 | 101 | TouchPoint { | 99 | TouchPoint { |
738 | 102 | id: tp | 100 | id: tp |
739 | 103 | } | 101 | } |
740 | 104 | ] | 102 | ] |
741 | 105 | 103 | ||
745 | 106 | onCanceled: { | 104 | onPressed: { |
746 | 107 | d.moving = false | 105 | startY = tp.y |
744 | 108 | animation.animate("center"); | ||
747 | 109 | } | 106 | } |
748 | 110 | 107 | ||
749 | 111 | onTouchUpdated: { | 108 | onTouchUpdated: { |
752 | 112 | if (!d.moving) { | 109 | if (!d.moving || !tp.pressed) { |
753 | 113 | if (Math.abs(tp.startY - tp.y) > d.threshold) { | 110 | if (Math.abs(startY - tp.y) > d.threshold) { |
754 | 114 | d.moving = true; | 111 | d.moving = true; |
755 | 115 | d.dragEvents = [] | 112 | d.dragEvents = [] |
756 | 116 | offset = tp.y - tp.startY; | 113 | offset = tp.y - tp.startY; |
757 | @@ -119,17 +116,32 @@ | |||
758 | 119 | } | 116 | } |
759 | 120 | } | 117 | } |
760 | 121 | 118 | ||
763 | 122 | if (root.closeable) { | 119 | |
764 | 123 | d.distance = tp.y - tp.startY - offset | 120 | var value = tp.y - tp.startY - offset; |
765 | 121 | if (value < 0) { | ||
766 | 122 | var coords = mapToItem(stage, tp.x, tp.y); | ||
767 | 123 | dragDelegate.Drag.hotSpot.x = dragDelegate.width / 2 | ||
768 | 124 | dragDelegate.Drag.hotSpot.y = units.gu(2) | ||
769 | 125 | dragDelegate.x = coords.x - dragDelegate.Drag.hotSpot.x | ||
770 | 126 | dragDelegate.y = coords.y - dragDelegate.Drag.hotSpot.y | ||
771 | 127 | dragDelegate.Drag.active = true; | ||
772 | 128 | dragDelegate.surface = model.window.surface; | ||
773 | 129 | |||
774 | 124 | } else { | 130 | } else { |
777 | 125 | var value = tp.y - tp.startY - offset; | 131 | if (root.closeable) { |
778 | 126 | d.distance = Math.sqrt(Math.abs(value)) * (value < 0 ? -1 : 1) * 3 | 132 | d.distance = value |
779 | 133 | } else { | ||
780 | 134 | d.distance = Math.sqrt(Math.abs(value)) * (value < 0 ? -1 : 1) * 3 | ||
781 | 135 | } | ||
782 | 127 | } | 136 | } |
783 | 128 | 137 | ||
784 | 129 | d.pushDragEvent(tp); | 138 | d.pushDragEvent(tp); |
785 | 130 | } | 139 | } |
786 | 131 | 140 | ||
787 | 132 | onReleased: { | 141 | onReleased: { |
788 | 142 | var result = dragDelegate.Drag.drop(); | ||
789 | 143 | dragDelegate.surface = null; | ||
790 | 144 | |||
791 | 133 | if (!d.moving) { | 145 | if (!d.moving) { |
792 | 134 | root.clicked() | 146 | root.clicked() |
793 | 135 | } | 147 | } |
794 | @@ -149,6 +161,13 @@ | |||
795 | 149 | animation.animate("center") | 161 | animation.animate("center") |
796 | 150 | } | 162 | } |
797 | 151 | } | 163 | } |
798 | 164 | |||
799 | 165 | onCanceled: { | ||
800 | 166 | dragDelegate.Drag.active = false; | ||
801 | 167 | dragDelegate.surface = null; | ||
802 | 168 | d.moving = false | ||
803 | 169 | animation.animate("center"); | ||
804 | 170 | } | ||
805 | 152 | } | 171 | } |
806 | 153 | 172 | ||
807 | 154 | UbuntuNumberAnimation { | 173 | UbuntuNumberAnimation { |
808 | 155 | 174 | ||
809 | === added file 'qml/Stage/Spread/WorkspacePreview.qml' | |||
810 | --- qml/Stage/Spread/WorkspacePreview.qml 1970-01-01 00:00:00 +0000 | |||
811 | +++ qml/Stage/Spread/WorkspacePreview.qml 2017-04-06 12:58:37 +0000 | |||
812 | @@ -0,0 +1,127 @@ | |||
813 | 1 | import QtQuick 2.4 | ||
814 | 2 | import Ubuntu.Components 1.3 | ||
815 | 3 | import Unity.Application 0.1 | ||
816 | 4 | import WindowManager 1.0 | ||
817 | 5 | import ".." | ||
818 | 6 | import "../../Components" | ||
819 | 7 | |||
820 | 8 | Item { | ||
821 | 9 | id: previewSpace | ||
822 | 10 | clip: true | ||
823 | 11 | |||
824 | 12 | property var workspace | ||
825 | 13 | |||
826 | 14 | property string background | ||
827 | 15 | property int screenHeight | ||
828 | 16 | |||
829 | 17 | property real previewScale: previewSpace.height / previewSpace.screenHeight | ||
830 | 18 | |||
831 | 19 | property bool containsDragLeft: false | ||
832 | 20 | property bool containsDragRight: false | ||
833 | 21 | property bool isActive: false | ||
834 | 22 | property bool isSelected: false | ||
835 | 23 | |||
836 | 24 | Image { | ||
837 | 25 | source: previewSpace.background | ||
838 | 26 | anchors.fill: parent | ||
839 | 27 | sourceSize.width: width | ||
840 | 28 | sourceSize.height: height | ||
841 | 29 | |||
842 | 30 | Repeater { | ||
843 | 31 | id: topLevelSurfaceRepeater | ||
844 | 32 | model: visible ? workspace.windowModel : null | ||
845 | 33 | delegate: Item { | ||
846 | 34 | width: surfaceItem.width | ||
847 | 35 | height: surfaceItem.height + decorationHeight * previewScale | ||
848 | 36 | x: model.window.position.x * previewScale | ||
849 | 37 | y: (model.window.position.y - decorationHeight) * previewScale | ||
850 | 38 | z: topLevelSurfaceRepeater.count - index | ||
851 | 39 | visible: model.window.state !== Mir.MinimizedState && model.window.state !== Mir.HiddenState | ||
852 | 40 | |||
853 | 41 | property int decorationHeight: units.gu(3) | ||
854 | 42 | |||
855 | 43 | WindowDecoration { | ||
856 | 44 | width: surfaceItem.implicitWidth | ||
857 | 45 | height: parent.decorationHeight | ||
858 | 46 | transform: Scale { | ||
859 | 47 | origin.x: 0 | ||
860 | 48 | origin.y: 0 | ||
861 | 49 | xScale: previewScale | ||
862 | 50 | yScale: previewScale | ||
863 | 51 | } | ||
864 | 52 | title: model.window && model.window.surface ? model.window.surface.name : "" | ||
865 | 53 | z: 3 | ||
866 | 54 | } | ||
867 | 55 | |||
868 | 56 | MirSurfaceItem { | ||
869 | 57 | id: surfaceItem | ||
870 | 58 | y: parent.decorationHeight * previewScale | ||
871 | 59 | width: implicitWidth * previewScale | ||
872 | 60 | height: implicitHeight * previewScale | ||
873 | 61 | surfaceWidth: -1 | ||
874 | 62 | surfaceHeight: -1 | ||
875 | 63 | surface: model.window.surface | ||
876 | 64 | } | ||
877 | 65 | } | ||
878 | 66 | } | ||
879 | 67 | |||
880 | 68 | } | ||
881 | 69 | |||
882 | 70 | Rectangle { | ||
883 | 71 | anchors.fill: parent | ||
884 | 72 | border.color: UbuntuColors.ash | ||
885 | 73 | border.width: units.gu(.5) | ||
886 | 74 | color: "transparent" | ||
887 | 75 | visible: previewSpace.isActive | ||
888 | 76 | } | ||
889 | 77 | |||
890 | 78 | Rectangle { | ||
891 | 79 | anchors.fill: parent | ||
892 | 80 | border.color: UbuntuColors.blue | ||
893 | 81 | border.width: units.gu(.5) | ||
894 | 82 | color: "transparent" | ||
895 | 83 | visible: previewSpace.isSelected | ||
896 | 84 | } | ||
897 | 85 | |||
898 | 86 | Rectangle { | ||
899 | 87 | anchors.fill: parent | ||
900 | 88 | anchors.rightMargin: parent.width / 2 | ||
901 | 89 | color: "#55000000" | ||
902 | 90 | visible: previewSpace.containsDragLeft | ||
903 | 91 | |||
904 | 92 | Column { | ||
905 | 93 | anchors.centerIn: parent | ||
906 | 94 | spacing: units.gu(1) | ||
907 | 95 | Icon { | ||
908 | 96 | source: "../graphics/multi-monitor_drop-here.png" | ||
909 | 97 | height: units.gu(4) | ||
910 | 98 | width: height | ||
911 | 99 | anchors.horizontalCenter: parent.horizontalCenter | ||
912 | 100 | } | ||
913 | 101 | Label { | ||
914 | 102 | text: qsTr("Drop here") | ||
915 | 103 | } | ||
916 | 104 | } | ||
917 | 105 | } | ||
918 | 106 | |||
919 | 107 | Rectangle { | ||
920 | 108 | anchors.fill: parent | ||
921 | 109 | anchors.leftMargin: parent.width / 2 | ||
922 | 110 | color: "#55000000" | ||
923 | 111 | visible: previewSpace.containsDragRight | ||
924 | 112 | |||
925 | 113 | Column { | ||
926 | 114 | anchors.centerIn: parent | ||
927 | 115 | spacing: units.gu(1) | ||
928 | 116 | Icon { | ||
929 | 117 | source: "../graphics/multi-monitor_leave.png" | ||
930 | 118 | height: units.gu(4) | ||
931 | 119 | width: height | ||
932 | 120 | anchors.horizontalCenter: parent.horizontalCenter | ||
933 | 121 | } | ||
934 | 122 | Label { | ||
935 | 123 | text: qsTr("Drop and go") | ||
936 | 124 | } | ||
937 | 125 | } | ||
938 | 126 | } | ||
939 | 127 | } | ||
940 | 0 | 128 | ||
941 | === added file 'qml/Stage/Spread/Workspaces.qml' | |||
942 | --- qml/Stage/Spread/Workspaces.qml 1970-01-01 00:00:00 +0000 | |||
943 | +++ qml/Stage/Spread/Workspaces.qml 2017-04-06 12:58:37 +0000 | |||
944 | @@ -0,0 +1,412 @@ | |||
945 | 1 | import QtQuick 2.4 | ||
946 | 2 | import Ubuntu.Components 1.3 | ||
947 | 3 | import WindowManager 1.0 | ||
948 | 4 | import "MathUtils.js" as MathUtils | ||
949 | 5 | import "../../Components" | ||
950 | 6 | |||
951 | 7 | Item { | ||
952 | 8 | id: root | ||
953 | 9 | implicitWidth: listView.contentWidth | ||
954 | 10 | readonly property int minimumWidth: { | ||
955 | 11 | var count = Math.min(3, listView.count); | ||
956 | 12 | return listView.itemWidth * count + listView.spacing * (count - 1) | ||
957 | 13 | } | ||
958 | 14 | |||
959 | 15 | property QtObject screen: null | ||
960 | 16 | property alias workspaceModel: listView.model | ||
961 | 17 | property var background // TODO: should be stored in the workspace data | ||
962 | 18 | property int selectedIndex: -1 | ||
963 | 19 | property bool readOnly: true | ||
964 | 20 | property var activeWorkspace: null | ||
965 | 21 | |||
966 | 22 | signal commitScreenSetup(); | ||
967 | 23 | signal closeSpread(); | ||
968 | 24 | signal clicked(var workspace); | ||
969 | 25 | |||
970 | 26 | DropArea { | ||
971 | 27 | anchors.fill: root | ||
972 | 28 | |||
973 | 29 | keys: ['workspace'] | ||
974 | 30 | |||
975 | 31 | onEntered: { | ||
976 | 32 | var index = listView.getDropIndex(drag); | ||
977 | 33 | drag.source.workspace.assign(workspaceModel, index) | ||
978 | 34 | drag.source.inDropArea = true; | ||
979 | 35 | } | ||
980 | 36 | |||
981 | 37 | onPositionChanged: { | ||
982 | 38 | var index = listView.getDropIndex(drag); | ||
983 | 39 | if (listView.dropItemIndex == index) return; | ||
984 | 40 | listView.model.move(listView.dropItemIndex, index, 1); | ||
985 | 41 | listView.dropItemIndex = index; | ||
986 | 42 | } | ||
987 | 43 | |||
988 | 44 | onExited: { | ||
989 | 45 | drag.source.workspace.unassign() | ||
990 | 46 | listView.dropItemIndex = -1; | ||
991 | 47 | listView.hoveredWorkspaceIndex = -1; | ||
992 | 48 | drag.source.inDropArea = false; | ||
993 | 49 | } | ||
994 | 50 | |||
995 | 51 | onDropped: { | ||
996 | 52 | drop.accept(Qt.MoveAction); | ||
997 | 53 | listView.dropItemIndex = -1; | ||
998 | 54 | drag.source.inDropArea = false; | ||
999 | 55 | } | ||
1000 | 56 | } | ||
1001 | 57 | DropArea { | ||
1002 | 58 | anchors.fill: parent | ||
1003 | 59 | keys: ["application"] | ||
1004 | 60 | |||
1005 | 61 | onPositionChanged: { | ||
1006 | 62 | listView.progressiveScroll(drag.x) | ||
1007 | 63 | listView.updateDropProperties(drag) | ||
1008 | 64 | } | ||
1009 | 65 | onExited: { | ||
1010 | 66 | listView.hoveredWorkspaceIndex = -1 | ||
1011 | 67 | } | ||
1012 | 68 | onDropped: { | ||
1013 | 69 | var surface = drag.source.surface; | ||
1014 | 70 | drag.source.surface = null; | ||
1015 | 71 | var workspace = listView.model.get(listView.hoveredWorkspaceIndex); | ||
1016 | 72 | WorkspaceManager.moveSurfaceToWorkspace(surface, workspace); | ||
1017 | 73 | drop.accept(Qt.MoveAction) | ||
1018 | 74 | if (listView.hoveredHalf == "right") { | ||
1019 | 75 | root.closeSpread(); | ||
1020 | 76 | workspace.activate(); | ||
1021 | 77 | } | ||
1022 | 78 | surface.activate(); | ||
1023 | 79 | listView.hoveredWorkspaceIndex = -1 | ||
1024 | 80 | } | ||
1025 | 81 | } | ||
1026 | 82 | |||
1027 | 83 | onSelectedIndexChanged: { | ||
1028 | 84 | listView.positionViewAtIndex(selectedIndex, ListView.Center); | ||
1029 | 85 | } | ||
1030 | 86 | |||
1031 | 87 | Item { | ||
1032 | 88 | // We need to clip the listview as it has left/right margins and it would | ||
1033 | 89 | // overlap with items next to it and eat mouse input. However, we can't | ||
1034 | 90 | // just clip at the actual bounds as the delegates have the close button | ||
1035 | 91 | // on hover which reaches a bit outside, so lets some margins for the clipping | ||
1036 | 92 | anchors.fill: parent | ||
1037 | 93 | anchors.margins: -units.gu(2) | ||
1038 | 94 | clip: true | ||
1039 | 95 | |||
1040 | 96 | |||
1041 | 97 | ListView { | ||
1042 | 98 | id: listView | ||
1043 | 99 | anchors { | ||
1044 | 100 | fill: parent | ||
1045 | 101 | topMargin: -parent.anchors.margins | ||
1046 | 102 | bottomMargin: -parent.anchors.margins | ||
1047 | 103 | leftMargin: -itemWidth - parent.anchors.margins | ||
1048 | 104 | rightMargin: -itemWidth - parent.anchors.margins | ||
1049 | 105 | } | ||
1050 | 106 | boundsBehavior: Flickable.StopAtBounds | ||
1051 | 107 | |||
1052 | 108 | Behavior on contentX { | ||
1053 | 109 | SmoothedAnimation { duration: 200 } | ||
1054 | 110 | } | ||
1055 | 111 | |||
1056 | 112 | property var clickedWorkspace: null | ||
1057 | 113 | |||
1058 | 114 | orientation: ListView.Horizontal | ||
1059 | 115 | spacing: units.gu(1) | ||
1060 | 116 | leftMargin: itemWidth | ||
1061 | 117 | rightMargin: itemWidth | ||
1062 | 118 | |||
1063 | 119 | property int screenWidth: screen.availableModes[screen.currentModeIndex].size.width | ||
1064 | 120 | property int screenHeight: screen.availableModes[screen.currentModeIndex].size.height | ||
1065 | 121 | property int itemWidth: height * screenWidth / screenHeight | ||
1066 | 122 | property int foldingAreaWidth: itemWidth / 2 | ||
1067 | 123 | property int maxAngle: 40 | ||
1068 | 124 | |||
1069 | 125 | property real realContentX: contentX - originX + leftMargin | ||
1070 | 126 | property int dropItemIndex: -1 | ||
1071 | 127 | property int hoveredWorkspaceIndex: -1 | ||
1072 | 128 | property string hoveredHalf: "" // left or right | ||
1073 | 129 | |||
1074 | 130 | function getDropIndex(drag) { | ||
1075 | 131 | var coords = mapToItem(listView.contentItem, drag.x, drag.y) | ||
1076 | 132 | var index = Math.floor((drag.x + listView.realContentX) / (listView.itemWidth + listView.spacing)); | ||
1077 | 133 | if (index < 0) index = 0; | ||
1078 | 134 | var upperLimit = dropItemIndex == -1 ? listView.count : listView.count - 1 | ||
1079 | 135 | if (index > upperLimit) index = upperLimit; | ||
1080 | 136 | return index; | ||
1081 | 137 | } | ||
1082 | 138 | |||
1083 | 139 | function updateDropProperties(drag) { | ||
1084 | 140 | var coords = mapToItem(listView.contentItem, drag.x, drag.y) | ||
1085 | 141 | var index = Math.floor(drag.x + listView.realContentX) / (listView.itemWidth + listView.spacing); | ||
1086 | 142 | if (index < 0) { | ||
1087 | 143 | listView.hoveredWorkspaceIndex = -1; | ||
1088 | 144 | listView.hoveredHalf = ""; | ||
1089 | 145 | return; | ||
1090 | 146 | } | ||
1091 | 147 | |||
1092 | 148 | var upperLimit = dropItemIndex == -1 ? listView.count : listView.count - 1 | ||
1093 | 149 | if (index > upperLimit) index = upperLimit; | ||
1094 | 150 | listView.hoveredWorkspaceIndex = index; | ||
1095 | 151 | var pixelsInTile = (drag.x + listView.realContentX) % (listView.itemWidth + listView.spacing); | ||
1096 | 152 | listView.hoveredHalf = (pixelsInTile / listView.itemWidth) < .5 ? "left" : "right"; | ||
1097 | 153 | } | ||
1098 | 154 | |||
1099 | 155 | function progressiveScroll(mouseX) { | ||
1100 | 156 | var progress = Math.max(0, Math.min(1, (mouseX - listView.itemWidth) / (width - listView.leftMargin * 2 - listView.itemWidth * 2))) | ||
1101 | 157 | listView.contentX = listView.originX + (listView.contentWidth - listView.width + listView.leftMargin + listView.rightMargin) * progress - listView.leftMargin | ||
1102 | 158 | } | ||
1103 | 159 | |||
1104 | 160 | displaced: Transition { UbuntuNumberAnimation { properties: "x" } } | ||
1105 | 161 | |||
1106 | 162 | delegate: Item { | ||
1107 | 163 | id: workspaceDelegate | ||
1108 | 164 | objectName: "delegate" + index | ||
1109 | 165 | height: parent.height | ||
1110 | 166 | width: listView.itemWidth | ||
1111 | 167 | Behavior on width { UbuntuNumberAnimation {} } | ||
1112 | 168 | visible: listView.dropItemIndex !== index | ||
1113 | 169 | |||
1114 | 170 | property int itemX: -listView.realContentX + index * (listView.itemWidth + listView.spacing) | ||
1115 | 171 | property int distanceFromLeft: itemX //- listView.leftMargin | ||
1116 | 172 | property int distanceFromRight: listView.width - listView.leftMargin - listView.rightMargin - itemX - listView.itemWidth | ||
1117 | 173 | |||
1118 | 174 | property int itemAngle: { | ||
1119 | 175 | if (index == 0) { | ||
1120 | 176 | if (distanceFromLeft < 0) { | ||
1121 | 177 | var progress = (distanceFromLeft + listView.foldingAreaWidth) / listView.foldingAreaWidth | ||
1122 | 178 | return MathUtils.linearAnimation(1, -1, 0, listView.maxAngle, Math.max(-1, Math.min(1, progress))); | ||
1123 | 179 | } | ||
1124 | 180 | return 0 | ||
1125 | 181 | } | ||
1126 | 182 | if (index == listView.count - 1) { | ||
1127 | 183 | if (distanceFromRight < 0) { | ||
1128 | 184 | var progress = (distanceFromRight + listView.foldingAreaWidth) / listView.foldingAreaWidth | ||
1129 | 185 | return MathUtils.linearAnimation(1, -1, 0, -listView.maxAngle, Math.max(-1, Math.min(1, progress))); | ||
1130 | 186 | } | ||
1131 | 187 | return 0 | ||
1132 | 188 | } | ||
1133 | 189 | |||
1134 | 190 | if (distanceFromLeft < listView.foldingAreaWidth) { | ||
1135 | 191 | // itemX : 10gu = p : 100 | ||
1136 | 192 | var progress = distanceFromLeft / listView.foldingAreaWidth | ||
1137 | 193 | return MathUtils.linearAnimation(1, -1, 0, listView.maxAngle, Math.max(-1, Math.min(1, progress))); | ||
1138 | 194 | } | ||
1139 | 195 | if (distanceFromRight < listView.foldingAreaWidth) { | ||
1140 | 196 | var progress = distanceFromRight / listView.foldingAreaWidth | ||
1141 | 197 | return MathUtils.linearAnimation(1, -1, 0, -listView.maxAngle, Math.max(-1, Math.min(1, progress))); | ||
1142 | 198 | } | ||
1143 | 199 | return 0 | ||
1144 | 200 | } | ||
1145 | 201 | |||
1146 | 202 | property int itemOffset: { | ||
1147 | 203 | if (index == 0) { | ||
1148 | 204 | if (distanceFromLeft < 0) { | ||
1149 | 205 | return -distanceFromLeft | ||
1150 | 206 | } | ||
1151 | 207 | return 0 | ||
1152 | 208 | } | ||
1153 | 209 | if (index == listView.count - 1) { | ||
1154 | 210 | if (distanceFromRight < 0) { | ||
1155 | 211 | return distanceFromRight | ||
1156 | 212 | } | ||
1157 | 213 | return 0 | ||
1158 | 214 | } | ||
1159 | 215 | |||
1160 | 216 | if (itemX < -listView.foldingAreaWidth) { | ||
1161 | 217 | return -itemX | ||
1162 | 218 | } | ||
1163 | 219 | if (distanceFromLeft < listView.foldingAreaWidth) { | ||
1164 | 220 | return (listView.foldingAreaWidth - distanceFromLeft) / 2 | ||
1165 | 221 | } | ||
1166 | 222 | |||
1167 | 223 | if (distanceFromRight < -listView.foldingAreaWidth) { | ||
1168 | 224 | return distanceFromRight | ||
1169 | 225 | } | ||
1170 | 226 | |||
1171 | 227 | if (distanceFromRight < listView.foldingAreaWidth) { | ||
1172 | 228 | return -(listView.foldingAreaWidth - distanceFromRight) / 2 | ||
1173 | 229 | } | ||
1174 | 230 | |||
1175 | 231 | return 0 | ||
1176 | 232 | } | ||
1177 | 233 | |||
1178 | 234 | z: itemOffset < 0 ? itemOffset : -itemOffset | ||
1179 | 235 | transform: [ | ||
1180 | 236 | Rotation { | ||
1181 | 237 | angle: itemAngle | ||
1182 | 238 | axis { x: 0; y: 1; z: 0 } | ||
1183 | 239 | origin { x: itemAngle < 0 ? listView.itemWidth : 0; y: height / 2 } | ||
1184 | 240 | }, | ||
1185 | 241 | Translate { | ||
1186 | 242 | x: itemOffset | ||
1187 | 243 | } | ||
1188 | 244 | ] | ||
1189 | 245 | |||
1190 | 246 | WorkspacePreview { | ||
1191 | 247 | id: workspacePreview | ||
1192 | 248 | height: listView.height | ||
1193 | 249 | width: listView.itemWidth | ||
1194 | 250 | background: root.background | ||
1195 | 251 | screenHeight: listView.screenHeight | ||
1196 | 252 | containsDragLeft: listView.hoveredWorkspaceIndex == index && listView.hoveredHalf == "left" | ||
1197 | 253 | containsDragRight: listView.hoveredWorkspaceIndex == index && listView.hoveredHalf == "right" | ||
1198 | 254 | isActive: workspace.isSameAs(root.activeWorkspace) | ||
1199 | 255 | isSelected: index === root.selectedIndex | ||
1200 | 256 | workspace: model.workspace | ||
1201 | 257 | } | ||
1202 | 258 | MouseArea { | ||
1203 | 259 | anchors.fill: parent | ||
1204 | 260 | onClicked: { | ||
1205 | 261 | root.clicked(model.workspace) | ||
1206 | 262 | } | ||
1207 | 263 | onDoubleClicked: { | ||
1208 | 264 | model.workspace.activate(); | ||
1209 | 265 | root.closeSpread(); | ||
1210 | 266 | } | ||
1211 | 267 | } | ||
1212 | 268 | |||
1213 | 269 | MouseArea { | ||
1214 | 270 | id: closeMouseArea | ||
1215 | 271 | objectName: "closeMouseArea" | ||
1216 | 272 | anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 } | ||
1217 | 273 | hoverEnabled: true | ||
1218 | 274 | height: units.gu(4) | ||
1219 | 275 | width: height | ||
1220 | 276 | visible: !root.readOnly && listView.count > 1 | ||
1221 | 277 | |||
1222 | 278 | onClicked: { | ||
1223 | 279 | model.workspace.unassign(); | ||
1224 | 280 | root.commitScreenSetup(); | ||
1225 | 281 | } | ||
1226 | 282 | Image { | ||
1227 | 283 | id: closeImage | ||
1228 | 284 | source: "../graphics/window-close.svg" | ||
1229 | 285 | anchors.fill: closeMouseArea | ||
1230 | 286 | anchors.margins: units.gu(1) | ||
1231 | 287 | sourceSize.width: width | ||
1232 | 288 | sourceSize.height: height | ||
1233 | 289 | readonly property var mousePos: hoverMouseArea.mapToItem(workspaceDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY) | ||
1234 | 290 | readonly property bool shown: (hoverMouseArea.containsMouse || parent.containsMouse) | ||
1235 | 291 | && mousePos.y < workspaceDelegate.width / 4 | ||
1236 | 292 | && mousePos.y > -units.gu(2) | ||
1237 | 293 | && mousePos.x > -units.gu(2) | ||
1238 | 294 | && mousePos.x < workspaceDelegate.height / 4 | ||
1239 | 295 | opacity: shown ? 1 : 0 | ||
1240 | 296 | visible: opacity > 0 | ||
1241 | 297 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | ||
1242 | 298 | |||
1243 | 299 | } | ||
1244 | 300 | } | ||
1245 | 301 | } | ||
1246 | 302 | |||
1247 | 303 | MouseArea { | ||
1248 | 304 | id: hoverMouseArea | ||
1249 | 305 | anchors.fill: parent | ||
1250 | 306 | hoverEnabled: true | ||
1251 | 307 | propagateComposedEvents: true | ||
1252 | 308 | anchors.leftMargin: listView.leftMargin | ||
1253 | 309 | anchors.rightMargin: listView.rightMargin | ||
1254 | 310 | enabled: !root.readOnly | ||
1255 | 311 | |||
1256 | 312 | property int draggedIndex: -1 | ||
1257 | 313 | |||
1258 | 314 | property int startX: 0 | ||
1259 | 315 | property int startY: 0 | ||
1260 | 316 | |||
1261 | 317 | onMouseXChanged: { | ||
1262 | 318 | if (!pressed || dragging) { | ||
1263 | 319 | listView.progressiveScroll(mouseX) | ||
1264 | 320 | } | ||
1265 | 321 | } | ||
1266 | 322 | onMouseYChanged: { | ||
1267 | 323 | if (Math.abs(mouseY - startY) > units.gu(3)) { | ||
1268 | 324 | drag.axis = Drag.XAndYAxis; | ||
1269 | 325 | } | ||
1270 | 326 | } | ||
1271 | 327 | |||
1272 | 328 | onReleased: { | ||
1273 | 329 | var result = fakeDragItem.Drag.drop(); | ||
1274 | 330 | // if (result == Qt.IgnoreAction) { | ||
1275 | 331 | // WorkspaceManager.destroyWorkspace(fakeDragItem.workspace); | ||
1276 | 332 | // } | ||
1277 | 333 | root.commitScreenSetup(); | ||
1278 | 334 | drag.target = null; | ||
1279 | 335 | } | ||
1280 | 336 | |||
1281 | 337 | property bool dragging: drag.active | ||
1282 | 338 | onDraggingChanged: { | ||
1283 | 339 | if (drag.active) { | ||
1284 | 340 | var ws = listView.model.get(draggedIndex); | ||
1285 | 341 | if (ws) ws.unassign(); | ||
1286 | 342 | } | ||
1287 | 343 | } | ||
1288 | 344 | |||
1289 | 345 | onPressed: { | ||
1290 | 346 | startX = mouseX; | ||
1291 | 347 | startY = mouseY; | ||
1292 | 348 | if (listView.model.count < 2) return; | ||
1293 | 349 | |||
1294 | 350 | var coords = mapToItem(listView.contentItem, mouseX, mouseY) | ||
1295 | 351 | draggedIndex = listView.indexAt(coords.x, coords.y) | ||
1296 | 352 | var clickedItem = listView.itemAt(coords.x, coords.y) | ||
1297 | 353 | |||
1298 | 354 | var itemCoords = clickedItem.mapToItem(listView, -listView.leftMargin, 0); | ||
1299 | 355 | fakeDragItem.x = itemCoords.x | ||
1300 | 356 | fakeDragItem.y = itemCoords.y | ||
1301 | 357 | fakeDragItem.workspace = listView.model.get(draggedIndex) | ||
1302 | 358 | |||
1303 | 359 | var mouseCoordsInItem = mapToItem(clickedItem, mouseX, mouseY); | ||
1304 | 360 | fakeDragItem.Drag.hotSpot.x = mouseCoordsInItem.x | ||
1305 | 361 | fakeDragItem.Drag.hotSpot.y = mouseCoordsInItem.y | ||
1306 | 362 | |||
1307 | 363 | drag.axis = Drag.YAxis; | ||
1308 | 364 | drag.target = fakeDragItem; | ||
1309 | 365 | } | ||
1310 | 366 | |||
1311 | 367 | WorkspacePreview { | ||
1312 | 368 | id: fakeDragItem | ||
1313 | 369 | height: listView.height | ||
1314 | 370 | width: listView.itemWidth | ||
1315 | 371 | background: root.background | ||
1316 | 372 | screenHeight: screen.availableModes[screen.currentModeIndex].size.height | ||
1317 | 373 | visible: Drag.active | ||
1318 | 374 | |||
1319 | 375 | Drag.active: hoverMouseArea.drag.active | ||
1320 | 376 | Drag.keys: ['workspace'] | ||
1321 | 377 | |||
1322 | 378 | property bool inDropArea: false | ||
1323 | 379 | |||
1324 | 380 | Rectangle { | ||
1325 | 381 | anchors.fill: parent | ||
1326 | 382 | color: "#33000000" | ||
1327 | 383 | opacity: parent.inDropArea ? 0 : 1 | ||
1328 | 384 | Behavior on opacity { UbuntuNumberAnimation { } } | ||
1329 | 385 | Rectangle { | ||
1330 | 386 | anchors.centerIn: parent | ||
1331 | 387 | width: units.gu(6) | ||
1332 | 388 | height: units.gu(6) | ||
1333 | 389 | radius: width / 2 | ||
1334 | 390 | color: "#aa000000" | ||
1335 | 391 | } | ||
1336 | 392 | |||
1337 | 393 | Icon { | ||
1338 | 394 | height: units.gu(3) | ||
1339 | 395 | width: height | ||
1340 | 396 | anchors.centerIn: parent | ||
1341 | 397 | name: "edit-delete" | ||
1342 | 398 | color: "white" | ||
1343 | 399 | } | ||
1344 | 400 | } | ||
1345 | 401 | |||
1346 | 402 | states: [ | ||
1347 | 403 | State { | ||
1348 | 404 | when: fakeDragItem.Drag.active | ||
1349 | 405 | ParentChange { target: fakeDragItem; parent: shell } | ||
1350 | 406 | } | ||
1351 | 407 | ] | ||
1352 | 408 | } | ||
1353 | 409 | } | ||
1354 | 410 | } | ||
1355 | 411 | } | ||
1356 | 412 | } | ||
1357 | 0 | 413 | ||
1358 | === modified file 'qml/Stage/Stage.qml' | |||
1359 | --- qml/Stage/Stage.qml 2017-04-06 12:58:36 +0000 | |||
1360 | +++ qml/Stage/Stage.qml 2017-04-06 12:58:37 +0000 | |||
1361 | @@ -50,6 +50,8 @@ | |||
1362 | 50 | property Item availableDesktopArea | 50 | property Item availableDesktopArea |
1363 | 51 | property PanelState panelState | 51 | property PanelState panelState |
1364 | 52 | 52 | ||
1365 | 53 | readonly property var temporarySelectedWorkspace: state == "spread" ? screensAndWorkspaces.activeWorkspace : null | ||
1366 | 54 | |||
1367 | 53 | // Configuration | 55 | // Configuration |
1368 | 54 | property string mode: "staged" | 56 | property string mode: "staged" |
1369 | 55 | 57 | ||
1370 | @@ -138,6 +140,7 @@ | |||
1371 | 138 | function updateFocusedAppOrientationAnimated() { /* TODO */} | 140 | function updateFocusedAppOrientationAnimated() { /* TODO */} |
1372 | 139 | 141 | ||
1373 | 140 | function closeSpread() { | 142 | function closeSpread() { |
1374 | 143 | spreadItem.highlightedIndex = -1; | ||
1375 | 141 | priv.goneToSpread = false; | 144 | priv.goneToSpread = false; |
1376 | 142 | } | 145 | } |
1377 | 143 | 146 | ||
1378 | @@ -244,6 +247,43 @@ | |||
1379 | 244 | } | 247 | } |
1380 | 245 | } | 248 | } |
1381 | 246 | 249 | ||
1382 | 250 | GlobalShortcut { | ||
1383 | 251 | id: showWorkspaceSwitcherShortcutLeft | ||
1384 | 252 | shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Left | ||
1385 | 253 | active: !workspaceSwitcher.active | ||
1386 | 254 | onTriggered: { | ||
1387 | 255 | root.focus = true; | ||
1388 | 256 | workspaceSwitcher.showLeft() | ||
1389 | 257 | } | ||
1390 | 258 | } | ||
1391 | 259 | GlobalShortcut { | ||
1392 | 260 | id: showWorkspaceSwitcherShortcutRight | ||
1393 | 261 | shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Right | ||
1394 | 262 | active: !workspaceSwitcher.active | ||
1395 | 263 | onTriggered: { | ||
1396 | 264 | root.focus = true; | ||
1397 | 265 | workspaceSwitcher.showRight() | ||
1398 | 266 | } | ||
1399 | 267 | } | ||
1400 | 268 | GlobalShortcut { | ||
1401 | 269 | id: showWorkspaceSwitcherShortcutUp | ||
1402 | 270 | shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Up | ||
1403 | 271 | active: !workspaceSwitcher.active | ||
1404 | 272 | onTriggered: { | ||
1405 | 273 | root.focus = true; | ||
1406 | 274 | workspaceSwitcher.showUp() | ||
1407 | 275 | } | ||
1408 | 276 | } | ||
1409 | 277 | GlobalShortcut { | ||
1410 | 278 | id: showWorkspaceSwitcherShortcutDown | ||
1411 | 279 | shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Down | ||
1412 | 280 | active: !workspaceSwitcher.active | ||
1413 | 281 | onTriggered: { | ||
1414 | 282 | root.focus = true; | ||
1415 | 283 | workspaceSwitcher.showDown() | ||
1416 | 284 | } | ||
1417 | 285 | } | ||
1418 | 286 | |||
1419 | 247 | QtObject { | 287 | QtObject { |
1420 | 248 | id: priv | 288 | id: priv |
1421 | 249 | objectName: "DesktopStagePrivate" | 289 | objectName: "DesktopStagePrivate" |
1422 | @@ -379,7 +419,7 @@ | |||
1423 | 379 | readonly property real windowDecorationHeight: units.gu(3) | 419 | readonly property real windowDecorationHeight: units.gu(3) |
1424 | 380 | } | 420 | } |
1425 | 381 | 421 | ||
1427 | 382 | Component.onCompleted: priv.updateMainAndSideStageIndexes(); | 422 | Component.onCompleted: priv.updateMainAndSideStageIndexes() |
1428 | 383 | 423 | ||
1429 | 384 | Connections { | 424 | Connections { |
1430 | 385 | target: panelState | 425 | target: panelState |
1431 | @@ -484,6 +524,7 @@ | |||
1432 | 484 | PropertyChanges { target: cancelSpreadMouseArea; enabled: true } | 524 | PropertyChanges { target: cancelSpreadMouseArea; enabled: true } |
1433 | 485 | PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 } | 525 | PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 } |
1434 | 486 | PropertyChanges { target: wallpaper; visible: false } | 526 | PropertyChanges { target: wallpaper; visible: false } |
1435 | 527 | PropertyChanges { target: screensAndWorkspaces; opacity: 1 } | ||
1436 | 487 | }, | 528 | }, |
1437 | 488 | State { | 529 | State { |
1438 | 489 | name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged" | 530 | name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged" |
1439 | @@ -531,11 +572,16 @@ | |||
1440 | 531 | Transition { | 572 | Transition { |
1441 | 532 | from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread" | 573 | from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread" |
1442 | 533 | PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 } | 574 | PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 } |
1443 | 575 | PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace } | ||
1444 | 534 | PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration } | 576 | PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration } |
1445 | 577 | UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration } | ||
1446 | 535 | }, | 578 | }, |
1447 | 536 | Transition { | 579 | Transition { |
1448 | 537 | to: "spread" | 580 | to: "spread" |
1449 | 581 | PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace } | ||
1450 | 538 | PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 } | 582 | PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 } |
1451 | 583 | PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 } | ||
1452 | 584 | UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration } | ||
1453 | 539 | }, | 585 | }, |
1454 | 540 | Transition { | 586 | Transition { |
1455 | 541 | from: "spread" | 587 | from: "spread" |
1456 | @@ -593,10 +639,20 @@ | |||
1457 | 593 | visible: false | 639 | visible: false |
1458 | 594 | } | 640 | } |
1459 | 595 | 641 | ||
1460 | 642 | ScreensAndWorkspaces { | ||
1461 | 643 | id: screensAndWorkspaces | ||
1462 | 644 | anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin } | ||
1463 | 645 | height: Math.max(units.gu(30), parent.height * .3) | ||
1464 | 646 | background: root.background | ||
1465 | 647 | opacity: 0 | ||
1466 | 648 | visible: opacity > 0 | ||
1467 | 649 | onCloseSpread: priv.goneToSpread = false; | ||
1468 | 650 | } | ||
1469 | 651 | |||
1470 | 596 | Spread { | 652 | Spread { |
1471 | 597 | id: spreadItem | 653 | id: spreadItem |
1472 | 598 | objectName: "spreadItem" | 654 | objectName: "spreadItem" |
1474 | 599 | anchors.fill: appContainer | 655 | anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom } |
1475 | 600 | leftMargin: root.availableDesktopArea.x | 656 | leftMargin: root.availableDesktopArea.x |
1476 | 601 | model: root.topLevelSurfaceList | 657 | model: root.topLevelSurfaceList |
1477 | 602 | spreadFlickable: floatingFlickable | 658 | spreadFlickable: floatingFlickable |
1478 | @@ -611,6 +667,83 @@ | |||
1479 | 611 | appRepeater.itemAt(highlightedIndex).close(); | 667 | appRepeater.itemAt(highlightedIndex).close(); |
1480 | 612 | } | 668 | } |
1481 | 613 | } | 669 | } |
1482 | 670 | |||
1483 | 671 | FloatingFlickable { | ||
1484 | 672 | id: floatingFlickable | ||
1485 | 673 | objectName: "spreadFlickable" | ||
1486 | 674 | anchors.fill: parent | ||
1487 | 675 | enabled: false | ||
1488 | 676 | contentWidth: spreadItem.spreadTotalWidth | ||
1489 | 677 | |||
1490 | 678 | function snap(toIndex) { | ||
1491 | 679 | var delegate = appRepeater.itemAt(toIndex) | ||
1492 | 680 | var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex; | ||
1493 | 681 | if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) { | ||
1494 | 682 | var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX) | ||
1495 | 683 | snapAnimation.to = floatingFlickable.contentX - offset; | ||
1496 | 684 | snapAnimation.start(); | ||
1497 | 685 | } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) { | ||
1498 | 686 | var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX); | ||
1499 | 687 | snapAnimation.to = floatingFlickable.contentX - offset; | ||
1500 | 688 | snapAnimation.start(); | ||
1501 | 689 | } | ||
1502 | 690 | } | ||
1503 | 691 | UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"} | ||
1504 | 692 | } | ||
1505 | 693 | |||
1506 | 694 | MouseArea { | ||
1507 | 695 | id: hoverMouseArea | ||
1508 | 696 | objectName: "hoverMouseArea" | ||
1509 | 697 | anchors.fill: parent | ||
1510 | 698 | propagateComposedEvents: true | ||
1511 | 699 | hoverEnabled: true | ||
1512 | 700 | enabled: false | ||
1513 | 701 | visible: enabled | ||
1514 | 702 | |||
1515 | 703 | property int scrollAreaWidth: width / 3 | ||
1516 | 704 | property bool progressiveScrollingEnabled: false | ||
1517 | 705 | |||
1518 | 706 | onPressed: mouse.accepted = false | ||
1519 | 707 | |||
1520 | 708 | onMouseXChanged: { | ||
1521 | 709 | mouse.accepted = false | ||
1522 | 710 | |||
1523 | 711 | if (hoverMouseArea.pressed) { | ||
1524 | 712 | return; | ||
1525 | 713 | } | ||
1526 | 714 | |||
1527 | 715 | // Find the hovered item and mark it active | ||
1528 | 716 | for (var i = appRepeater.count - 1; i >= 0; i--) { | ||
1529 | 717 | var appDelegate = appRepeater.itemAt(i); | ||
1530 | 718 | var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY) | ||
1531 | 719 | var itemUnder = appDelegate.childAt(mapped.x, mapped.y); | ||
1532 | 720 | if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) { | ||
1533 | 721 | spreadItem.highlightedIndex = i; | ||
1534 | 722 | break; | ||
1535 | 723 | } | ||
1536 | 724 | } | ||
1537 | 725 | |||
1538 | 726 | if (floatingFlickable.contentWidth > floatingFlickable.width) { | ||
1539 | 727 | var margins = floatingFlickable.width * 0.05; | ||
1540 | 728 | |||
1541 | 729 | if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) { | ||
1542 | 730 | progressiveScrollingEnabled = true | ||
1543 | 731 | } | ||
1544 | 732 | |||
1545 | 733 | // do we need to scroll? | ||
1546 | 734 | if (mouseX < scrollAreaWidth + margins) { | ||
1547 | 735 | var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins)); | ||
1548 | 736 | var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width) | ||
1549 | 737 | floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX)) | ||
1550 | 738 | } | ||
1551 | 739 | if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) { | ||
1552 | 740 | var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins)) | ||
1553 | 741 | var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width) | ||
1554 | 742 | floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX)) | ||
1555 | 743 | } | ||
1556 | 744 | } | ||
1557 | 745 | } | ||
1558 | 746 | } | ||
1559 | 614 | } | 747 | } |
1560 | 615 | 748 | ||
1561 | 616 | Connections { | 749 | Connections { |
1562 | @@ -705,6 +838,24 @@ | |||
1563 | 705 | } | 838 | } |
1564 | 706 | } | 839 | } |
1565 | 707 | 840 | ||
1566 | 841 | MirSurfaceItem { | ||
1567 | 842 | id: fakeDragItem | ||
1568 | 843 | property real previewScale: .5 | ||
1569 | 844 | height: (screensAndWorkspaces.height - units.gu(8)) / 2 | ||
1570 | 845 | // w : h = iw : ih | ||
1571 | 846 | width: implicitWidth * height / implicitHeight | ||
1572 | 847 | surfaceWidth: -1 | ||
1573 | 848 | surfaceHeight: -1 | ||
1574 | 849 | opacity: surface != null ? 1 : 0 | ||
1575 | 850 | Behavior on opacity { UbuntuNumberAnimation {} } | ||
1576 | 851 | visible: opacity > 0 | ||
1577 | 852 | |||
1578 | 853 | Drag.active: surface != null | ||
1579 | 854 | Drag.keys: ["application"] | ||
1580 | 855 | |||
1581 | 856 | z: 1000 | ||
1582 | 857 | } | ||
1583 | 858 | |||
1584 | 708 | Repeater { | 859 | Repeater { |
1585 | 709 | id: appRepeater | 860 | id: appRepeater |
1586 | 710 | model: topLevelSurfaceList | 861 | model: topLevelSurfaceList |
1587 | @@ -733,6 +884,9 @@ | |||
1588 | 733 | } | 884 | } |
1589 | 734 | z: normalZ | 885 | z: normalZ |
1590 | 735 | 886 | ||
1591 | 887 | opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1 | ||
1592 | 888 | Behavior on opacity { UbuntuNumberAnimation {} } | ||
1593 | 889 | |||
1594 | 736 | // Normally we want x/y where the surface thinks it is. Width/height of our delegate will | 890 | // Normally we want x/y where the surface thinks it is. Width/height of our delegate will |
1595 | 737 | // match what the actual surface size is. | 891 | // match what the actual surface size is. |
1596 | 738 | // Don't write to those, they will be set by states | 892 | // Don't write to those, they will be set by states |
1597 | @@ -913,7 +1067,6 @@ | |||
1598 | 913 | function claimFocus() { | 1067 | function claimFocus() { |
1599 | 914 | if (root.state == "spread") { | 1068 | if (root.state == "spread") { |
1600 | 915 | spreadItem.highlightedIndex = index | 1069 | spreadItem.highlightedIndex = index |
1601 | 916 | priv.goneToSpread = false; | ||
1602 | 917 | } | 1070 | } |
1603 | 918 | if (root.mode == "stagedWithSideStage") { | 1071 | if (root.mode == "stagedWithSideStage") { |
1604 | 919 | if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) { | 1072 | if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) { |
1605 | @@ -1247,8 +1400,6 @@ | |||
1606 | 1247 | y: spreadMaths.targetY | 1400 | y: spreadMaths.targetY |
1607 | 1248 | z: index | 1401 | z: index |
1608 | 1249 | height: spreadItem.spreadItemHeight | 1402 | height: spreadItem.spreadItemHeight |
1609 | 1250 | requestedWidth: decoratedWindow.oldRequestedWidth | ||
1610 | 1251 | requestedHeight: decoratedWindow.oldRequestedHeight | ||
1611 | 1252 | visible: spreadMaths.itemVisible | 1403 | visible: spreadMaths.itemVisible |
1612 | 1253 | } | 1404 | } |
1613 | 1254 | PropertyChanges { target: dragArea; enabled: true } | 1405 | PropertyChanges { target: dragArea; enabled: true } |
1614 | @@ -1268,8 +1419,6 @@ | |||
1615 | 1268 | y: stagedRightEdgeMaths.animatedY | 1419 | y: stagedRightEdgeMaths.animatedY |
1616 | 1269 | z: stagedRightEdgeMaths.animatedZ | 1420 | z: stagedRightEdgeMaths.animatedZ |
1617 | 1270 | height: stagedRightEdgeMaths.animatedHeight | 1421 | height: stagedRightEdgeMaths.animatedHeight |
1618 | 1271 | requestedWidth: decoratedWindow.oldRequestedWidth | ||
1619 | 1272 | requestedHeight: decoratedWindow.oldRequestedHeight | ||
1620 | 1273 | visible: appDelegate.x < root.width | 1422 | visible: appDelegate.x < root.width |
1621 | 1274 | } | 1423 | } |
1622 | 1275 | PropertyChanges { | 1424 | PropertyChanges { |
1623 | @@ -1299,8 +1448,6 @@ | |||
1624 | 1299 | y: windowedRightEdgeMaths.animatedY | 1448 | y: windowedRightEdgeMaths.animatedY |
1625 | 1300 | z: windowedRightEdgeMaths.animatedZ | 1449 | z: windowedRightEdgeMaths.animatedZ |
1626 | 1301 | height: stagedRightEdgeMaths.animatedHeight | 1450 | height: stagedRightEdgeMaths.animatedHeight |
1627 | 1302 | requestedWidth: decoratedWindow.oldRequestedWidth | ||
1628 | 1303 | requestedHeight: decoratedWindow.oldRequestedHeight | ||
1629 | 1304 | } | 1451 | } |
1630 | 1305 | PropertyChanges { | 1452 | PropertyChanges { |
1631 | 1306 | target: decoratedWindow | 1453 | target: decoratedWindow |
1632 | @@ -1323,10 +1470,14 @@ | |||
1633 | 1323 | target: appDelegate | 1470 | target: appDelegate |
1634 | 1324 | x: stageMaths.itemX | 1471 | x: stageMaths.itemX |
1635 | 1325 | y: root.availableDesktopArea.y | 1472 | y: root.availableDesktopArea.y |
1636 | 1473 | visuallyMaximized: true | ||
1637 | 1474 | visible: appDelegate.x < root.width | ||
1638 | 1475 | } | ||
1639 | 1476 | PropertyChanges { | ||
1640 | 1477 | target: appDelegate | ||
1641 | 1326 | requestedWidth: appContainer.width | 1478 | requestedWidth: appContainer.width |
1642 | 1327 | requestedHeight: root.availableDesktopArea.height | 1479 | requestedHeight: root.availableDesktopArea.height |
1645 | 1328 | visuallyMaximized: true | 1480 | restoreEntryValues: false |
1644 | 1329 | visible: appDelegate.x < root.width | ||
1646 | 1330 | } | 1481 | } |
1647 | 1331 | PropertyChanges { | 1482 | PropertyChanges { |
1648 | 1332 | target: decoratedWindow | 1483 | target: decoratedWindow |
1649 | @@ -1356,10 +1507,14 @@ | |||
1650 | 1356 | x: stageMaths.itemX | 1507 | x: stageMaths.itemX |
1651 | 1357 | y: root.availableDesktopArea.y | 1508 | y: root.availableDesktopArea.y |
1652 | 1358 | z: stageMaths.itemZ | 1509 | z: stageMaths.itemZ |
1653 | 1510 | visuallyMaximized: true | ||
1654 | 1511 | visible: appDelegate.x < root.width | ||
1655 | 1512 | } | ||
1656 | 1513 | PropertyChanges { | ||
1657 | 1514 | target: appDelegate | ||
1658 | 1359 | requestedWidth: stageMaths.itemWidth | 1515 | requestedWidth: stageMaths.itemWidth |
1659 | 1360 | requestedHeight: root.availableDesktopArea.height | 1516 | requestedHeight: root.availableDesktopArea.height |
1662 | 1361 | visuallyMaximized: true | 1517 | restoreEntryValues: false |
1661 | 1362 | visible: appDelegate.x < root.width | ||
1663 | 1363 | } | 1518 | } |
1664 | 1364 | PropertyChanges { | 1519 | PropertyChanges { |
1665 | 1365 | target: decoratedWindow | 1520 | target: decoratedWindow |
1666 | @@ -1382,8 +1537,12 @@ | |||
1667 | 1382 | requestedY: 0; | 1537 | requestedY: 0; |
1668 | 1383 | visuallyMinimized: false; | 1538 | visuallyMinimized: false; |
1669 | 1384 | visuallyMaximized: true | 1539 | visuallyMaximized: true |
1670 | 1540 | } | ||
1671 | 1541 | PropertyChanges { | ||
1672 | 1542 | target: appDelegate | ||
1673 | 1385 | requestedWidth: root.availableDesktopArea.width; | 1543 | requestedWidth: root.availableDesktopArea.width; |
1674 | 1386 | requestedHeight: appContainer.height; | 1544 | requestedHeight: appContainer.height; |
1675 | 1545 | restoreEntryValues: false | ||
1676 | 1387 | } | 1546 | } |
1677 | 1388 | PropertyChanges { target: touchControls; enabled: true } | 1547 | PropertyChanges { target: touchControls; enabled: true } |
1678 | 1389 | }, | 1548 | }, |
1679 | @@ -1393,8 +1552,12 @@ | |||
1680 | 1393 | target: appDelegate; | 1552 | target: appDelegate; |
1681 | 1394 | requestedX: 0 | 1553 | requestedX: 0 |
1682 | 1395 | requestedY: 0 | 1554 | requestedY: 0 |
1685 | 1396 | requestedWidth: appContainer.width; | 1555 | } |
1686 | 1397 | requestedHeight: appContainer.height; | 1556 | PropertyChanges { |
1687 | 1557 | target: appDelegate | ||
1688 | 1558 | requestedWidth: appContainer.width | ||
1689 | 1559 | requestedHeight: appContainer.height | ||
1690 | 1560 | restoreEntryValues: false | ||
1691 | 1398 | } | 1561 | } |
1692 | 1399 | PropertyChanges { target: decoratedWindow; hasDecoration: false } | 1562 | PropertyChanges { target: decoratedWindow; hasDecoration: false } |
1693 | 1400 | }, | 1563 | }, |
1694 | @@ -1409,6 +1572,12 @@ | |||
1695 | 1409 | PropertyChanges { target: touchControls; enabled: true } | 1572 | PropertyChanges { target: touchControls; enabled: true } |
1696 | 1410 | PropertyChanges { target: resizeArea; enabled: true } | 1573 | PropertyChanges { target: resizeArea; enabled: true } |
1697 | 1411 | PropertyChanges { target: decoratedWindow; shadowOpacity: .3} | 1574 | PropertyChanges { target: decoratedWindow; shadowOpacity: .3} |
1698 | 1575 | PropertyChanges { | ||
1699 | 1576 | target: appDelegate | ||
1700 | 1577 | requestedWidth: windowedWidth | ||
1701 | 1578 | requestedHeight: windowedHeight | ||
1702 | 1579 | restoreEntryValues: false | ||
1703 | 1580 | } | ||
1704 | 1412 | }, | 1581 | }, |
1705 | 1413 | State { | 1582 | State { |
1706 | 1414 | name: "restored"; | 1583 | name: "restored"; |
1707 | @@ -1509,6 +1678,7 @@ | |||
1708 | 1509 | } | 1678 | } |
1709 | 1510 | } | 1679 | } |
1710 | 1511 | ] | 1680 | ] |
1711 | 1681 | |||
1712 | 1512 | transitions: [ | 1682 | transitions: [ |
1713 | 1513 | Transition { | 1683 | Transition { |
1714 | 1514 | from: "staged,stagedWithSideStage" | 1684 | from: "staged,stagedWithSideStage" |
1715 | @@ -1522,6 +1692,7 @@ | |||
1716 | 1522 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration} | 1692 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration} |
1717 | 1523 | }, | 1693 | }, |
1718 | 1524 | Transition { | 1694 | Transition { |
1719 | 1695 | from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge"; | ||
1720 | 1525 | to: "spread" | 1696 | to: "spread" |
1721 | 1526 | // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview | 1697 | // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview |
1722 | 1527 | PropertyAction { target: appDelegate; properties: "z,visible" } | 1698 | PropertyAction { target: appDelegate; properties: "z,visible" } |
1723 | @@ -1628,6 +1799,7 @@ | |||
1724 | 1628 | borderThickness: units.gu(2) | 1799 | borderThickness: units.gu(2) |
1725 | 1629 | enabled: false | 1800 | enabled: false |
1726 | 1630 | visible: enabled | 1801 | visible: enabled |
1727 | 1802 | readyToAssesBounds: !appDelegate._constructing | ||
1728 | 1631 | 1803 | ||
1729 | 1632 | onPressed: { | 1804 | onPressed: { |
1730 | 1633 | appDelegate.activate(); | 1805 | appDelegate.activate(); |
1731 | @@ -1651,19 +1823,13 @@ | |||
1732 | 1651 | width: implicitWidth | 1823 | width: implicitWidth |
1733 | 1652 | height: implicitHeight | 1824 | height: implicitHeight |
1734 | 1653 | highlightSize: windowInfoItem.iconMargin / 2 | 1825 | highlightSize: windowInfoItem.iconMargin / 2 |
1735 | 1826 | boundsItem: root.availableDesktopArea | ||
1736 | 1827 | panelState: root.panelState | ||
1737 | 1654 | altDragEnabled: root.mode == "windowed" | 1828 | altDragEnabled: root.mode == "windowed" |
1738 | 1655 | boundsItem: root.availableDesktopArea | ||
1739 | 1656 | panelState: root.panelState | ||
1740 | 1657 | 1829 | ||
1741 | 1658 | requestedWidth: appDelegate.requestedWidth | 1830 | requestedWidth: appDelegate.requestedWidth |
1742 | 1659 | requestedHeight: appDelegate.requestedHeight | 1831 | requestedHeight: appDelegate.requestedHeight |
1743 | 1660 | 1832 | ||
1744 | 1661 | property int oldRequestedWidth: -1 | ||
1745 | 1662 | property int oldRequestedHeight: -1 | ||
1746 | 1663 | |||
1747 | 1664 | onRequestedWidthChanged: oldRequestedWidth = requestedWidth | ||
1748 | 1665 | onRequestedHeightChanged: oldRequestedHeight = requestedHeight | ||
1749 | 1666 | |||
1750 | 1667 | onCloseClicked: { appDelegate.close(); } | 1833 | onCloseClicked: { appDelegate.close(); } |
1751 | 1668 | onMaximizeClicked: { | 1834 | onMaximizeClicked: { |
1752 | 1669 | if (appDelegate.canBeMaximized) { | 1835 | if (appDelegate.canBeMaximized) { |
1753 | @@ -1744,6 +1910,8 @@ | |||
1754 | 1744 | anchors.fill: decoratedWindow | 1910 | anchors.fill: decoratedWindow |
1755 | 1745 | enabled: false | 1911 | enabled: false |
1756 | 1746 | closeable: !appDelegate.isDash | 1912 | closeable: !appDelegate.isDash |
1757 | 1913 | stage: root | ||
1758 | 1914 | dragDelegate: fakeDragItem | ||
1759 | 1747 | 1915 | ||
1760 | 1748 | onClicked: { | 1916 | onClicked: { |
1761 | 1749 | spreadItem.highlightedIndex = index; | 1917 | spreadItem.highlightedIndex = index; |
1762 | @@ -1786,12 +1954,15 @@ | |||
1763 | 1786 | objectName: "closeMouseArea" | 1954 | objectName: "closeMouseArea" |
1764 | 1787 | anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset } | 1955 | anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset } |
1765 | 1788 | readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY) | 1956 | readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY) |
1767 | 1789 | visible: !appDelegate.isDash && dragArea.distance == 0 | 1957 | readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0 |
1768 | 1790 | && index == spreadItem.highlightedIndex | 1958 | && index == spreadItem.highlightedIndex |
1769 | 1791 | && mousePos.y < (decoratedWindow.height / 3) | 1959 | && mousePos.y < (decoratedWindow.height / 3) |
1770 | 1792 | && mousePos.y > -units.gu(4) | 1960 | && mousePos.y > -units.gu(4) |
1771 | 1793 | && mousePos.x > -units.gu(4) | 1961 | && mousePos.x > -units.gu(4) |
1772 | 1794 | && mousePos.x < (decoratedWindow.width * 2 / 3) | 1962 | && mousePos.x < (decoratedWindow.width * 2 / 3) |
1773 | 1963 | opacity: shown ? 1 : 0 | ||
1774 | 1964 | visible: opacity > 0 | ||
1775 | 1965 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | ||
1776 | 1795 | height: units.gu(6) | 1966 | height: units.gu(6) |
1777 | 1796 | width: height | 1967 | width: height |
1778 | 1797 | 1968 | ||
1779 | @@ -1865,81 +2036,17 @@ | |||
1780 | 1865 | panelState: root.panelState | 2036 | panelState: root.panelState |
1781 | 1866 | } | 2037 | } |
1782 | 1867 | 2038 | ||
1858 | 1868 | MouseArea { | 2039 | WorkspaceSwitcher { |
1859 | 1869 | id: hoverMouseArea | 2040 | id: workspaceSwitcher |
1860 | 1870 | objectName: "hoverMouseArea" | 2041 | anchors.centerIn: parent |
1861 | 1871 | anchors.fill: appContainer | 2042 | height: units.gu(20) |
1862 | 1872 | propagateComposedEvents: true | 2043 | width: root.width - units.gu(8) |
1863 | 1873 | hoverEnabled: true | 2044 | background: root.background |
1864 | 1874 | enabled: false | 2045 | onActiveChanged: { |
1865 | 1875 | visible: enabled | 2046 | if (!active) { |
1866 | 1876 | 2047 | appContainer.focus = true; | |
1867 | 1877 | property int scrollAreaWidth: width / 3 | 2048 | } |
1868 | 1878 | property bool progressiveScrollingEnabled: false | 2049 | } |
1794 | 1879 | |||
1795 | 1880 | onMouseXChanged: { | ||
1796 | 1881 | mouse.accepted = false | ||
1797 | 1882 | |||
1798 | 1883 | if (hoverMouseArea.pressed) { | ||
1799 | 1884 | return; | ||
1800 | 1885 | } | ||
1801 | 1886 | |||
1802 | 1887 | // Find the hovered item and mark it active | ||
1803 | 1888 | for (var i = appRepeater.count - 1; i >= 0; i--) { | ||
1804 | 1889 | var appDelegate = appRepeater.itemAt(i); | ||
1805 | 1890 | var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY) | ||
1806 | 1891 | var itemUnder = appDelegate.childAt(mapped.x, mapped.y); | ||
1807 | 1892 | if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) { | ||
1808 | 1893 | spreadItem.highlightedIndex = i; | ||
1809 | 1894 | break; | ||
1810 | 1895 | } | ||
1811 | 1896 | } | ||
1812 | 1897 | |||
1813 | 1898 | if (floatingFlickable.contentWidth > floatingFlickable.width) { | ||
1814 | 1899 | var margins = floatingFlickable.width * 0.05; | ||
1815 | 1900 | |||
1816 | 1901 | if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) { | ||
1817 | 1902 | progressiveScrollingEnabled = true | ||
1818 | 1903 | } | ||
1819 | 1904 | |||
1820 | 1905 | // do we need to scroll? | ||
1821 | 1906 | if (mouseX < scrollAreaWidth + margins) { | ||
1822 | 1907 | var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins)); | ||
1823 | 1908 | var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width) | ||
1824 | 1909 | floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX)) | ||
1825 | 1910 | } | ||
1826 | 1911 | if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) { | ||
1827 | 1912 | var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins)) | ||
1828 | 1913 | var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width) | ||
1829 | 1914 | floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX)) | ||
1830 | 1915 | } | ||
1831 | 1916 | } | ||
1832 | 1917 | } | ||
1833 | 1918 | |||
1834 | 1919 | onPressed: mouse.accepted = false | ||
1835 | 1920 | } | ||
1836 | 1921 | |||
1837 | 1922 | FloatingFlickable { | ||
1838 | 1923 | id: floatingFlickable | ||
1839 | 1924 | objectName: "spreadFlickable" | ||
1840 | 1925 | anchors.fill: appContainer | ||
1841 | 1926 | enabled: false | ||
1842 | 1927 | contentWidth: spreadItem.spreadTotalWidth | ||
1843 | 1928 | |||
1844 | 1929 | function snap(toIndex) { | ||
1845 | 1930 | var delegate = appRepeater.itemAt(toIndex) | ||
1846 | 1931 | var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex; | ||
1847 | 1932 | if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) { | ||
1848 | 1933 | var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX) | ||
1849 | 1934 | snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset); | ||
1850 | 1935 | snapAnimation.start(); | ||
1851 | 1936 | } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) { | ||
1852 | 1937 | var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX); | ||
1853 | 1938 | snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset); | ||
1854 | 1939 | snapAnimation.start(); | ||
1855 | 1940 | } | ||
1856 | 1941 | } | ||
1857 | 1942 | UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"} | ||
1869 | 1943 | } | 2050 | } |
1870 | 1944 | 2051 | ||
1871 | 1945 | PropertyAnimation { | 2052 | PropertyAnimation { |
1872 | 1946 | 2053 | ||
1873 | === modified file 'qml/Stage/WindowResizeArea.qml' | |||
1874 | --- qml/Stage/WindowResizeArea.qml 2017-02-21 15:19:01 +0000 | |||
1875 | +++ qml/Stage/WindowResizeArea.qml 2017-04-06 12:58:37 +0000 | |||
1876 | @@ -36,35 +36,58 @@ | |||
1877 | 36 | property int minWidth: 0 | 36 | property int minWidth: 0 |
1878 | 37 | property int minHeight: 0 | 37 | property int minHeight: 0 |
1879 | 38 | 38 | ||
1880 | 39 | property bool readyToAssesBounds: false | ||
1881 | 40 | onReadyToAssesBoundsChanged: d.reassesBounds() | ||
1882 | 41 | |||
1883 | 39 | QtObject { | 42 | QtObject { |
1884 | 40 | id: d | 43 | id: d |
1885 | 41 | 44 | ||
1886 | 42 | readonly property int maxSafeInt: 2147483647 | 45 | readonly property int maxSafeInt: 2147483647 |
1887 | 43 | readonly property int maxSizeIncrement: units.gu(40) | 46 | readonly property int maxSizeIncrement: units.gu(40) |
1888 | 44 | 47 | ||
1889 | 48 | function reassesBounds() { | ||
1890 | 49 | if (!readyToAssesBounds) return; | ||
1891 | 50 | |||
1892 | 51 | if (target.windowedWidth < minimumWidth) { | ||
1893 | 52 | target.windowedWidth = minimumWidth; | ||
1894 | 53 | } | ||
1895 | 54 | if (target.windowedHeight < minimumHeight) { | ||
1896 | 55 | target.windowedHeight = minimumHeight; | ||
1897 | 56 | } | ||
1898 | 57 | if (target.windowedHeight < minimumHeight) { | ||
1899 | 58 | target.windowedHeight = minimumHeight; | ||
1900 | 59 | } | ||
1901 | 60 | if (target.windowedWidth > maximumWidth) { | ||
1902 | 61 | target.windowedWidth = maximumWidth; | ||
1903 | 62 | } | ||
1904 | 63 | if (target.windowedHeight > maximumHeight) { | ||
1905 | 64 | target.windowedHeight = maximumHeight; | ||
1906 | 65 | } | ||
1907 | 66 | } | ||
1908 | 67 | |||
1909 | 45 | readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth | 68 | readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth |
1910 | 46 | onMinimumWidthChanged: { | 69 | onMinimumWidthChanged: { |
1912 | 47 | if (target.windowedWidth < minimumWidth) { | 70 | if (readyToAssesBounds && target.windowedWidth < minimumWidth) { |
1913 | 48 | target.windowedWidth = minimumWidth; | 71 | target.windowedWidth = minimumWidth; |
1914 | 49 | } | 72 | } |
1915 | 50 | } | 73 | } |
1916 | 51 | readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight | 74 | readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight |
1917 | 52 | onMinimumHeightChanged: { | 75 | onMinimumHeightChanged: { |
1919 | 53 | if (target.windowedHeight < minimumHeight) { | 76 | if (readyToAssesBounds && target.windowedHeight < minimumHeight) { |
1920 | 54 | target.windowedHeight = minimumHeight; | 77 | target.windowedHeight = minimumHeight; |
1921 | 55 | } | 78 | } |
1922 | 56 | } | 79 | } |
1923 | 57 | readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0 | 80 | readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0 |
1924 | 58 | ? root.target.maximumWidth : maxSafeInt | 81 | ? root.target.maximumWidth : maxSafeInt |
1925 | 59 | onMaximumWidthChanged: { | 82 | onMaximumWidthChanged: { |
1927 | 60 | if (target.windowedWidth > maximumWidth) { | 83 | if (readyToAssesBounds && target.windowedWidth > maximumWidth) { |
1928 | 61 | target.windowedWidth = maximumWidth; | 84 | target.windowedWidth = maximumWidth; |
1929 | 62 | } | 85 | } |
1930 | 63 | } | 86 | } |
1931 | 64 | readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0 | 87 | readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0 |
1932 | 65 | ? root.target.maximumHeight : maxSafeInt | 88 | ? root.target.maximumHeight : maxSafeInt |
1933 | 66 | onMaximumHeightChanged: { | 89 | onMaximumHeightChanged: { |
1935 | 67 | if (target.windowedHeight > maximumHeight) { | 90 | if (readyToAssesBounds && target.windowedHeight > maximumHeight) { |
1936 | 68 | target.windowedHeight = maximumHeight; | 91 | target.windowedHeight = maximumHeight; |
1937 | 69 | } | 92 | } |
1938 | 70 | } | 93 | } |
1939 | 71 | 94 | ||
1940 | === modified file 'qml/Stage/WindowStateSaver.qml' | |||
1941 | --- qml/Stage/WindowStateSaver.qml 2017-02-24 12:54:39 +0000 | |||
1942 | +++ qml/Stage/WindowStateSaver.qml 2017-04-06 12:58:37 +0000 | |||
1943 | @@ -43,7 +43,10 @@ | |||
1944 | 43 | (target.fullscreen ? 0 : root.leftMargin)); }); | 43 | (target.fullscreen ? 0 : root.leftMargin)); }); |
1945 | 44 | target.windowedY = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, screenHeight - target.windowedHeight), minimumY); }); | 44 | target.windowedY = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, screenHeight - target.windowedHeight), minimumY); }); |
1946 | 45 | 45 | ||
1948 | 46 | target.updateNormalGeometry(); | 46 | target.normalWidth = target.windowedWidth; |
1949 | 47 | target.normalHeight = target.windowedHeight; | ||
1950 | 48 | target.normalX = target.windowedX; | ||
1951 | 49 | target.normalY = target.windowedY; | ||
1952 | 47 | 50 | ||
1953 | 48 | // initialize the x/y to restore to | 51 | // initialize the x/y to restore to |
1954 | 49 | target.restoredX = target.normalX; | 52 | target.restoredX = target.normalX; |
1955 | 50 | 53 | ||
1956 | === added file 'qml/Stage/WorkspaceSwitcher.qml' | |||
1957 | --- qml/Stage/WorkspaceSwitcher.qml 1970-01-01 00:00:00 +0000 | |||
1958 | +++ qml/Stage/WorkspaceSwitcher.qml 2017-04-06 12:58:37 +0000 | |||
1959 | @@ -0,0 +1,196 @@ | |||
1960 | 1 | /* | ||
1961 | 2 | * Copyright (C) 2014-2016 Canonical, Ltd. | ||
1962 | 3 | * | ||
1963 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1964 | 5 | * it under the terms of the GNU General Public License as published by | ||
1965 | 6 | * the Free Software Foundation; version 3. | ||
1966 | 7 | * | ||
1967 | 8 | * This program is distributed in the hope that it will be useful, | ||
1968 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1969 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1970 | 11 | * GNU General Public License for more details. | ||
1971 | 12 | * | ||
1972 | 13 | * You should have received a copy of the GNU General Public License | ||
1973 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1974 | 15 | */ | ||
1975 | 16 | |||
1976 | 17 | import QtQuick 2.4 | ||
1977 | 18 | import Ubuntu.Components 1.3 | ||
1978 | 19 | import "Spread" | ||
1979 | 20 | import WindowManager 1.0 | ||
1980 | 21 | import Unity.Application 0.1 | ||
1981 | 22 | |||
1982 | 23 | Item { | ||
1983 | 24 | id: root | ||
1984 | 25 | |||
1985 | 26 | opacity: d.shown ? 1 : 0 | ||
1986 | 27 | visible: opacity > 0 | ||
1987 | 28 | Behavior on opacity { UbuntuNumberAnimation {} } | ||
1988 | 29 | |||
1989 | 30 | property var screensProxy: Screens.createProxy(); | ||
1990 | 31 | property string background | ||
1991 | 32 | |||
1992 | 33 | readonly property alias active: d.active | ||
1993 | 34 | |||
1994 | 35 | function showLeft() { | ||
1995 | 36 | show(); | ||
1996 | 37 | d.previousWorkspace(); | ||
1997 | 38 | } | ||
1998 | 39 | function showRight() { | ||
1999 | 40 | show(); | ||
2000 | 41 | d.nextWorkspace(); | ||
2001 | 42 | } | ||
2002 | 43 | function showUp() { | ||
2003 | 44 | show(); | ||
2004 | 45 | d.previousScreen(); | ||
2005 | 46 | } | ||
2006 | 47 | function showDown() { | ||
2007 | 48 | show(); | ||
2008 | 49 | d.nextScreen(); | ||
2009 | 50 | } | ||
2010 | 51 | |||
2011 | 52 | function show() { | ||
2012 | 53 | hideTimer.stop(); | ||
2013 | 54 | d.altPressed = true; | ||
2014 | 55 | d.ctrlPressed = true; | ||
2015 | 56 | d.active = true; | ||
2016 | 57 | d.shown = true; | ||
2017 | 58 | focus = true; | ||
2018 | 59 | |||
2019 | 60 | d.highlightedScreenIndex = screensProxy.activeScreen; | ||
2020 | 61 | var activeScreen = screensProxy.get(screensProxy.activeScreen); | ||
2021 | 62 | d.highlightedWorkspaceIndex = activeScreen.workspaces.indexOf(activeScreen.currentWorkspace) | ||
2022 | 63 | } | ||
2023 | 64 | |||
2024 | 65 | QtObject { | ||
2025 | 66 | id: d | ||
2026 | 67 | |||
2027 | 68 | property bool active: false | ||
2028 | 69 | property bool shown: false | ||
2029 | 70 | property bool altPressed: false | ||
2030 | 71 | property bool ctrlPressed: false | ||
2031 | 72 | |||
2032 | 73 | property int rowHeight: root.height - units.gu(4) | ||
2033 | 74 | |||
2034 | 75 | property int highlightedScreenIndex: -1 | ||
2035 | 76 | property int highlightedWorkspaceIndex: -1 | ||
2036 | 77 | |||
2037 | 78 | function previousWorkspace() { | ||
2038 | 79 | highlightedWorkspaceIndex = Math.max(highlightedWorkspaceIndex - 1, 0); | ||
2039 | 80 | } | ||
2040 | 81 | function nextWorkspace() { | ||
2041 | 82 | var screen = screensProxy.get(highlightedScreenIndex); | ||
2042 | 83 | highlightedWorkspaceIndex = Math.min(highlightedWorkspaceIndex + 1, screen.workspaces.count - 1); | ||
2043 | 84 | } | ||
2044 | 85 | function previousScreen() { | ||
2045 | 86 | highlightedScreenIndex = Math.max(highlightedScreenIndex - 1, 0); | ||
2046 | 87 | var screen = screensProxy.get(highlightedScreenIndex); | ||
2047 | 88 | highlightedWorkspaceIndex = Math.min(highlightedWorkspaceIndex, screen.workspaces.count - 1) | ||
2048 | 89 | } | ||
2049 | 90 | function nextScreen() { | ||
2050 | 91 | highlightedScreenIndex = Math.min(highlightedScreenIndex + 1, screensProxy.count - 1); | ||
2051 | 92 | var screen = screensProxy.get(highlightedScreenIndex); | ||
2052 | 93 | highlightedWorkspaceIndex = Math.min(highlightedWorkspaceIndex, screen.workspaces.count - 1) | ||
2053 | 94 | } | ||
2054 | 95 | } | ||
2055 | 96 | |||
2056 | 97 | Timer { | ||
2057 | 98 | id: hideTimer | ||
2058 | 99 | interval: 300 | ||
2059 | 100 | onTriggered: d.shown = false; | ||
2060 | 101 | } | ||
2061 | 102 | |||
2062 | 103 | Keys.onPressed: { | ||
2063 | 104 | switch (event.key) { | ||
2064 | 105 | case Qt.Key_Left: | ||
2065 | 106 | d.previousWorkspace(); | ||
2066 | 107 | break; | ||
2067 | 108 | case Qt.Key_Right: | ||
2068 | 109 | d.nextWorkspace() | ||
2069 | 110 | break; | ||
2070 | 111 | case Qt.Key_Up: | ||
2071 | 112 | d.previousScreen(); | ||
2072 | 113 | break; | ||
2073 | 114 | case Qt.Key_Down: | ||
2074 | 115 | d.nextScreen(); | ||
2075 | 116 | } | ||
2076 | 117 | } | ||
2077 | 118 | Keys.onReleased: { | ||
2078 | 119 | switch (event.key) { | ||
2079 | 120 | case Qt.Key_Alt: | ||
2080 | 121 | d.altPressed = false; | ||
2081 | 122 | break; | ||
2082 | 123 | case Qt.Key_Control: | ||
2083 | 124 | d.ctrlPressed = false; | ||
2084 | 125 | break; | ||
2085 | 126 | } | ||
2086 | 127 | |||
2087 | 128 | if (!d.altPressed && !d.ctrlPressed) { | ||
2088 | 129 | d.active = false; | ||
2089 | 130 | hideTimer.start(); | ||
2090 | 131 | focus = false; | ||
2091 | 132 | screensProxy.get(d.highlightedScreenIndex).workspaces.get(d.highlightedWorkspaceIndex).activate(); | ||
2092 | 133 | } | ||
2093 | 134 | } | ||
2094 | 135 | |||
2095 | 136 | UbuntuShape { | ||
2096 | 137 | backgroundColor: "#F2111111" | ||
2097 | 138 | clip: true | ||
2098 | 139 | width: Math.min(parent.width, screensColumn.width + units.gu(4)) | ||
2099 | 140 | anchors.horizontalCenter: parent.horizontalCenter | ||
2100 | 141 | height: parent.height | ||
2101 | 142 | |||
2102 | 143 | Column { | ||
2103 | 144 | id: screensColumn | ||
2104 | 145 | anchors { | ||
2105 | 146 | top: parent.top; topMargin: units.gu(2) - d.highlightedScreenIndex * (d.rowHeight + screensColumn.spacing) | ||
2106 | 147 | left: parent.left; leftMargin: units.gu(2) | ||
2107 | 148 | } | ||
2108 | 149 | width: screensRepeater.itemAt(d.highlightedScreenIndex).width | ||
2109 | 150 | spacing: units.gu(2) | ||
2110 | 151 | Behavior on anchors.topMargin { UbuntuNumberAnimation {} } | ||
2111 | 152 | Behavior on width { UbuntuNumberAnimation {} } | ||
2112 | 153 | |||
2113 | 154 | Repeater { | ||
2114 | 155 | id: screensRepeater | ||
2115 | 156 | model: screensProxy | ||
2116 | 157 | |||
2117 | 158 | delegate: Item { | ||
2118 | 159 | height: d.rowHeight | ||
2119 | 160 | width: workspaces.width | ||
2120 | 161 | anchors.horizontalCenter: parent.horizontalCenter | ||
2121 | 162 | opacity: d.highlightedScreenIndex == index ? 1 : 0 | ||
2122 | 163 | Behavior on opacity { UbuntuNumberAnimation {} } | ||
2123 | 164 | |||
2124 | 165 | UbuntuShape { | ||
2125 | 166 | id: header | ||
2126 | 167 | anchors { left: parent.left; top: parent.top; right: parent.right } | ||
2127 | 168 | height: units.gu(4) | ||
2128 | 169 | backgroundColor: "white" | ||
2129 | 170 | |||
2130 | 171 | Label { | ||
2131 | 172 | anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(1) } | ||
2132 | 173 | text: model.screen.name | ||
2133 | 174 | color: UbuntuColors.ash | ||
2134 | 175 | } | ||
2135 | 176 | } | ||
2136 | 177 | |||
2137 | 178 | Workspaces { | ||
2138 | 179 | id: workspaces | ||
2139 | 180 | height: parent.height - header.height - units.gu(2) | ||
2140 | 181 | width: Math.min(implicitWidth, root.width - units.gu(4)) | ||
2141 | 182 | |||
2142 | 183 | anchors.bottom: parent.bottom | ||
2143 | 184 | anchors.bottomMargin: units.gu(1) | ||
2144 | 185 | anchors.horizontalCenter: parent.horizontalCenter | ||
2145 | 186 | screen: model.screen | ||
2146 | 187 | background: root.background | ||
2147 | 188 | selectedIndex: d.highlightedScreenIndex == index ? d.highlightedWorkspaceIndex : -1 | ||
2148 | 189 | |||
2149 | 190 | workspaceModel: model.screen.workspaces | ||
2150 | 191 | } | ||
2151 | 192 | } | ||
2152 | 193 | } | ||
2153 | 194 | } | ||
2154 | 195 | } | ||
2155 | 196 | } | ||
2156 | 0 | 197 | ||
2157 | === added file 'qml/Stage/graphics/multi-monitor_drop-here.png' | |||
2158 | 1 | Binary files qml/Stage/graphics/multi-monitor_drop-here.png 1970-01-01 00:00:00 +0000 and qml/Stage/graphics/multi-monitor_drop-here.png 2017-04-06 12:58:37 +0000 differ | 198 | Binary files qml/Stage/graphics/multi-monitor_drop-here.png 1970-01-01 00:00:00 +0000 and qml/Stage/graphics/multi-monitor_drop-here.png 2017-04-06 12:58:37 +0000 differ |
2159 | === added file 'qml/Stage/graphics/multi-monitor_leave.png' | |||
2160 | 2 | Binary files qml/Stage/graphics/multi-monitor_leave.png 1970-01-01 00:00:00 +0000 and qml/Stage/graphics/multi-monitor_leave.png 2017-04-06 12:58:37 +0000 differ | 199 | Binary files qml/Stage/graphics/multi-monitor_leave.png 1970-01-01 00:00:00 +0000 and qml/Stage/graphics/multi-monitor_leave.png 2017-04-06 12:58:37 +0000 differ |
2161 | === modified file 'tests/mocks/Unity/Application/MirSurfaceItem.cpp' | |||
2162 | --- tests/mocks/Unity/Application/MirSurfaceItem.cpp 2017-01-26 11:10:01 +0000 | |||
2163 | +++ tests/mocks/Unity/Application/MirSurfaceItem.cpp 2017-04-06 12:58:37 +0000 | |||
2164 | @@ -189,11 +189,13 @@ | |||
2165 | 189 | m_qmlItem = qobject_cast<QQuickItem*>(m_qmlContentComponent->create()); | 189 | m_qmlItem = qobject_cast<QQuickItem*>(m_qmlContentComponent->create()); |
2166 | 190 | m_qmlItem->setParentItem(this); | 190 | m_qmlItem->setParentItem(this); |
2167 | 191 | 191 | ||
2173 | 192 | m_qmlItem->setWidth(m_surfaceWidth); | 192 | if (m_fillMode == FillMode::Stretch && width() != 0 && height() != 0) { |
2174 | 193 | m_qmlItem->setHeight(m_surfaceHeight); | 193 | m_qmlItem->setSize(QSize(this->width(), this->height())); |
2175 | 194 | 194 | } else { | |
2176 | 195 | setImplicitWidth(m_qmlItem->implicitWidth()); | 195 | m_qmlItem->setSize(m_qmlSurface->size()); |
2177 | 196 | setImplicitHeight(m_qmlItem->implicitHeight()); | 196 | } |
2178 | 197 | setImplicitWidth(m_qmlItem->width()); | ||
2179 | 198 | setImplicitHeight(m_qmlItem->height()); | ||
2180 | 197 | 199 | ||
2181 | 198 | { | 200 | { |
2182 | 199 | QQmlProperty screenshotSource(m_qmlItem, "screenshotSource"); | 201 | QQmlProperty screenshotSource(m_qmlItem, "screenshotSource"); |
2183 | @@ -308,6 +310,16 @@ | |||
2184 | 308 | connect(m_qmlSurface, &MirSurface::screenshotUrlChanged, this, &MirSurfaceItem::updateScreenshot); | 310 | connect(m_qmlSurface, &MirSurface::screenshotUrlChanged, this, &MirSurfaceItem::updateScreenshot); |
2185 | 309 | connect(m_qmlSurface, &MirSurface::liveChanged, this, &MirSurfaceItem::liveChanged); | 311 | connect(m_qmlSurface, &MirSurface::liveChanged, this, &MirSurfaceItem::liveChanged); |
2186 | 310 | connect(m_qmlSurface, &MirSurface::stateChanged, this, &MirSurfaceItem::surfaceStateChanged); | 312 | connect(m_qmlSurface, &MirSurface::stateChanged, this, &MirSurfaceItem::surfaceStateChanged); |
2187 | 313 | connect(m_qmlSurface, &MirSurface::sizeChanged, this, [this] () { | ||
2188 | 314 | setImplicitSize(m_qmlSurface->width(), m_qmlSurface->height()); | ||
2189 | 315 | if (m_fillMode == FillMode::Stretch) { | ||
2190 | 316 | m_qmlItem->setSize(QSize(this->width(), this->height())); | ||
2191 | 317 | } else { | ||
2192 | 318 | m_qmlItem->setSize(m_qmlSurface->size()); | ||
2193 | 319 | } | ||
2194 | 320 | }); | ||
2195 | 321 | m_surfaceWidth = surface->size().width(); | ||
2196 | 322 | m_surfaceHeight = surface->size().height(); | ||
2197 | 311 | 323 | ||
2198 | 312 | QUrl qmlComponentFilePath; | 324 | QUrl qmlComponentFilePath; |
2199 | 313 | if (!m_qmlSurface->qmlFilePath().isEmpty()) { | 325 | if (!m_qmlSurface->qmlFilePath().isEmpty()) { |
2200 | @@ -321,6 +333,7 @@ | |||
2201 | 321 | switch (m_qmlContentComponent->status()) { | 333 | switch (m_qmlContentComponent->status()) { |
2202 | 322 | case QQmlComponent::Ready: | 334 | case QQmlComponent::Ready: |
2203 | 323 | createQmlContentItem(); | 335 | createQmlContentItem(); |
2204 | 336 | qDebug() << "content created" << m_surfaceWidth << implicitWidth() << width(); | ||
2205 | 324 | break; | 337 | break; |
2206 | 325 | case QQmlComponent::Loading: | 338 | case QQmlComponent::Loading: |
2207 | 326 | connect(m_qmlContentComponent, &QQmlComponent::statusChanged, | 339 | connect(m_qmlContentComponent, &QQmlComponent::statusChanged, |
2208 | @@ -399,9 +412,15 @@ | |||
2209 | 399 | if (m_qmlSurface && m_surfaceWidth > 0 && m_surfaceHeight > 0) { | 412 | if (m_qmlSurface && m_surfaceWidth > 0 && m_surfaceHeight > 0) { |
2210 | 400 | m_qmlSurface->resize(m_surfaceWidth, m_surfaceHeight); | 413 | m_qmlSurface->resize(m_surfaceWidth, m_surfaceHeight); |
2211 | 401 | if (m_qmlItem) { | 414 | if (m_qmlItem) { |
2214 | 402 | m_qmlItem->setWidth(m_surfaceWidth); | 415 | if (m_fillMode == FillMode::Stretch) { |
2215 | 403 | m_qmlItem->setHeight(m_surfaceHeight); | 416 | m_qmlItem->setWidth(width()); |
2216 | 417 | m_qmlItem->setHeight(height()); | ||
2217 | 418 | } else { | ||
2218 | 419 | m_qmlItem->setWidth(m_surfaceWidth); | ||
2219 | 420 | m_qmlItem->setHeight(m_surfaceHeight); | ||
2220 | 421 | } | ||
2221 | 404 | } | 422 | } |
2222 | 423 | qDebug() << this << "setting implicitsize" << m_surfaceWidth << m_surfaceHeight; | ||
2223 | 405 | setImplicitSize(m_surfaceWidth, m_surfaceHeight); | 424 | setImplicitSize(m_surfaceWidth, m_surfaceHeight); |
2224 | 406 | } | 425 | } |
2225 | 407 | } | 426 | } |
2226 | 408 | 427 | ||
2227 | === modified file 'tests/mocks/Unity/Application/resources/MirSurfaceItem.qml' | |||
2228 | --- tests/mocks/Unity/Application/resources/MirSurfaceItem.qml 2016-07-01 15:32:37 +0000 | |||
2229 | +++ tests/mocks/Unity/Application/resources/MirSurfaceItem.qml 2017-04-06 12:58:37 +0000 | |||
2230 | @@ -20,9 +20,6 @@ | |||
2231 | 20 | id: root | 20 | id: root |
2232 | 21 | color: "pink" | 21 | color: "pink" |
2233 | 22 | 22 | ||
2234 | 23 | implicitWidth: width | ||
2235 | 24 | implicitHeight: height | ||
2236 | 25 | |||
2237 | 26 | property alias screenshotSource: screenshotImage.source | 23 | property alias screenshotSource: screenshotImage.source |
2238 | 27 | property int orientationAngle | 24 | property int orientationAngle |
2239 | 28 | 25 | ||
2240 | 29 | 26 | ||
2241 | === modified file 'tests/mocks/WindowManager/MockScreens.cpp' | |||
2242 | --- tests/mocks/WindowManager/MockScreens.cpp 2017-04-06 12:58:36 +0000 | |||
2243 | +++ tests/mocks/WindowManager/MockScreens.cpp 2017-04-06 12:58:37 +0000 | |||
2244 | @@ -31,10 +31,11 @@ | |||
2245 | 31 | class MockScreen : public qtmir::Screen | 31 | class MockScreen : public qtmir::Screen |
2246 | 32 | { | 32 | { |
2247 | 33 | Q_OBJECT | 33 | Q_OBJECT |
2248 | 34 | Q_PROPERTY(QString outputTypeName READ outputTypeName NOTIFY outputTypeNameChanged) | ||
2249 | 34 | public: | 35 | public: |
2250 | 35 | MockScreen() | 36 | MockScreen() |
2251 | 36 | { | 37 | { |
2253 | 37 | m_sizes.append(new qtmir::ScreenMode(50, QSize(640,480))); | 38 | m_sizes.append(new qtmir::ScreenMode(50, QSize(800,568))); |
2254 | 38 | m_sizes.append(new qtmir::ScreenMode(60, QSize(1280,1024))); | 39 | m_sizes.append(new qtmir::ScreenMode(60, QSize(1280,1024))); |
2255 | 39 | m_sizes.append(new qtmir::ScreenMode(60, QSize(1440,900))); | 40 | m_sizes.append(new qtmir::ScreenMode(60, QSize(1440,900))); |
2256 | 40 | m_sizes.append(new qtmir::ScreenMode(60, QSize(1920,1080))); | 41 | m_sizes.append(new qtmir::ScreenMode(60, QSize(1920,1080))); |
2257 | @@ -51,7 +52,6 @@ | |||
2258 | 51 | 52 | ||
2259 | 52 | if (m_connectedWindow) { | 53 | if (m_connectedWindow) { |
2260 | 53 | disconnect(m_connectedWindow.data()); | 54 | disconnect(m_connectedWindow.data()); |
2261 | 54 | m_sizes.takeFirst()->deleteLater(); | ||
2262 | 55 | } | 55 | } |
2263 | 56 | 56 | ||
2264 | 57 | m_connectedWindow = w; | 57 | m_connectedWindow = w; |
2265 | @@ -77,7 +77,6 @@ | |||
2266 | 77 | }); | 77 | }); |
2267 | 78 | if (w->isActive()) setActive(true); | 78 | if (w->isActive()) setActive(true); |
2268 | 79 | 79 | ||
2269 | 80 | m_sizes.push_front(new qtmir::ScreenMode(50, w->size())); | ||
2270 | 81 | Q_EMIT availableModesChanged(); | 80 | Q_EMIT availableModesChanged(); |
2271 | 82 | 81 | ||
2272 | 83 | } | 82 | } |
2273 | @@ -90,6 +89,7 @@ | |||
2274 | 90 | QSizeF physicalSize() const override { return m_physicalSize; } | 89 | QSizeF physicalSize() const override { return m_physicalSize; } |
2275 | 91 | qtmir::FormFactor formFactor() const override { return m_formFactor; } | 90 | qtmir::FormFactor formFactor() const override { return m_formFactor; } |
2276 | 92 | qtmir::OutputTypes outputType() const override { return m_outputType; } | 91 | qtmir::OutputTypes outputType() const override { return m_outputType; } |
2277 | 92 | QString outputTypeName() const { return QStringLiteral("Internal"); } | ||
2278 | 93 | MirPowerMode powerMode() const override { return m_powerMode; } | 93 | MirPowerMode powerMode() const override { return m_powerMode; } |
2279 | 94 | Qt::ScreenOrientation orientation() const override { return m_orientation; } | 94 | Qt::ScreenOrientation orientation() const override { return m_orientation; } |
2280 | 95 | QPoint position() const override { return m_position; } | 95 | QPoint position() const override { return m_position; } |
2281 | @@ -137,6 +137,9 @@ | |||
2282 | 137 | return true; | 137 | return true; |
2283 | 138 | } | 138 | } |
2284 | 139 | 139 | ||
2285 | 140 | Q_SIGNALS: | ||
2286 | 141 | void outputTypeNameChanged(); | ||
2287 | 142 | |||
2288 | 140 | public: | 143 | public: |
2289 | 141 | miral::DisplayId m_id; | 144 | miral::DisplayId m_id; |
2290 | 142 | bool m_active{false}; | 145 | bool m_active{false}; |
2291 | @@ -168,7 +171,7 @@ | |||
2292 | 168 | screen->m_active = i == 0; | 171 | screen->m_active = i == 0; |
2293 | 169 | screen->m_name = QString("Monitor %1").arg(i); | 172 | screen->m_name = QString("Monitor %1").arg(i); |
2294 | 170 | screen->m_position = QPoint(lastPoint.x(), lastPoint.y()); | 173 | screen->m_position = QPoint(lastPoint.x(), lastPoint.y()); |
2296 | 171 | screen->m_currentModeIndex = 3; | 174 | screen->m_currentModeIndex = 0; |
2297 | 172 | m_mocks.append(screen); | 175 | m_mocks.append(screen); |
2298 | 173 | 176 | ||
2299 | 174 | lastPoint.rx() += screen->m_sizes[screen->m_currentModeIndex]->size.width(); | 177 | lastPoint.rx() += screen->m_sizes[screen->m_currentModeIndex]->size.width(); |
2300 | 175 | 178 | ||
2301 | === modified file 'tests/qmltests/Stage/tst_ApplicationWindow.qml' | |||
2302 | --- tests/qmltests/Stage/tst_ApplicationWindow.qml 2017-04-06 12:58:36 +0000 | |||
2303 | +++ tests/qmltests/Stage/tst_ApplicationWindow.qml 2017-04-06 12:58:37 +0000 | |||
2304 | @@ -245,13 +245,12 @@ | |||
2305 | 245 | function test_showSplashUntilAppFullyInit_data() { | 245 | function test_showSplashUntilAppFullyInit_data() { |
2306 | 246 | return [ | 246 | return [ |
2307 | 247 | {tag: "state=Running then create surface", swapInitOrder: false}, | 247 | {tag: "state=Running then create surface", swapInitOrder: false}, |
2308 | 248 | |||
2309 | 249 | {tag: "create surface then state=Running", swapInitOrder: true}, | 248 | {tag: "create surface then state=Running", swapInitOrder: true}, |
2310 | 250 | ] | 249 | ] |
2311 | 251 | } | 250 | } |
2312 | 252 | 251 | ||
2313 | 253 | function test_showSplashUntilAppFullyInit() { | 252 | function test_showSplashUntilAppFullyInit() { |
2315 | 254 | verify(stateGroup.state === "splashScreen"); | 253 | verify(stateGroup.state === "splash"); |
2316 | 255 | 254 | ||
2317 | 256 | if (data.swapInitOrder) { | 255 | if (data.swapInitOrder) { |
2318 | 257 | surfaceCheckbox.checked = true; | 256 | surfaceCheckbox.checked = true; |
2319 | @@ -259,7 +258,7 @@ | |||
2320 | 259 | setApplicationState(appRunning); | 258 | setApplicationState(appRunning); |
2321 | 260 | } | 259 | } |
2322 | 261 | 260 | ||
2324 | 262 | verify(stateGroup.state === "splashScreen"); | 261 | verify(stateGroup.state === "splash"); |
2325 | 263 | 262 | ||
2326 | 264 | if (data.swapInitOrder) { | 263 | if (data.swapInitOrder) { |
2327 | 265 | setApplicationState(appRunning); | 264 | setApplicationState(appRunning); |
2328 | @@ -284,27 +283,8 @@ | |||
2329 | 284 | waitUntilTransitionsEnd(stateGroup); | 283 | waitUntilTransitionsEnd(stateGroup); |
2330 | 285 | } | 284 | } |
2331 | 286 | 285 | ||
2332 | 287 | function test_killedAppShowsScreenshot() { | ||
2333 | 288 | surfaceCheckbox.checked = true; | ||
2334 | 289 | setApplicationState(appRunning); | ||
2335 | 290 | tryCompare(stateGroup, "state", "surface"); | ||
2336 | 291 | |||
2337 | 292 | setApplicationState(appSuspended); | ||
2338 | 293 | |||
2339 | 294 | verify(stateGroup.state === "surface"); | ||
2340 | 295 | verify(fakeApplication.surface !== null); | ||
2341 | 296 | |||
2342 | 297 | // kill it! | ||
2343 | 298 | surfaceCheckbox.checked = false; | ||
2344 | 299 | setApplicationState(appStopped); | ||
2345 | 300 | |||
2346 | 301 | tryCompare(stateGroup, "state", "screenshot"); | ||
2347 | 302 | tryCompare(fakeApplication.surfaceList, "count", 0); | ||
2348 | 303 | } | ||
2349 | 304 | |||
2350 | 305 | function test_restartApp() { | 286 | function test_restartApp() { |
2353 | 306 | var screenshotImage = findChild(applicationWindow, "screenshotImage"); | 287 | tryCompare(stateGroup, "state", "splash"); |
2352 | 307 | |||
2354 | 308 | surfaceCheckbox.checked = true; | 288 | surfaceCheckbox.checked = true; |
2355 | 309 | setApplicationState(appRunning); | 289 | setApplicationState(appRunning); |
2356 | 310 | tryCompare(stateGroup, "state", "surface"); | 290 | tryCompare(stateGroup, "state", "surface"); |
2357 | @@ -316,26 +296,23 @@ | |||
2358 | 316 | surfaceCheckbox.checked = false; | 296 | surfaceCheckbox.checked = false; |
2359 | 317 | setApplicationState(appStopped); | 297 | setApplicationState(appStopped); |
2360 | 318 | 298 | ||
2361 | 319 | tryCompare(stateGroup, "state", "screenshot"); | ||
2362 | 320 | waitUntilTransitionsEnd(stateGroup); | 299 | waitUntilTransitionsEnd(stateGroup); |
2364 | 321 | tryCompare(applicationWindow, "surface", null); | 300 | tryCompare(stateGroup, "state", "surface"); |
2365 | 322 | 301 | ||
2366 | 323 | // and restart it | 302 | // and restart it |
2367 | 324 | setApplicationState(appStarting); | 303 | setApplicationState(appStarting); |
2368 | 325 | 304 | ||
2369 | 326 | waitUntilTransitionsEnd(stateGroup); | 305 | waitUntilTransitionsEnd(stateGroup); |
2372 | 327 | verify(stateGroup.state === "screenshot"); | 306 | verify(stateGroup.state === "surface"); |
2371 | 328 | verify(applicationWindow.surface === null); | ||
2373 | 329 | 307 | ||
2374 | 330 | setApplicationState(appRunning); | 308 | setApplicationState(appRunning); |
2375 | 331 | 309 | ||
2376 | 332 | waitUntilTransitionsEnd(stateGroup); | 310 | waitUntilTransitionsEnd(stateGroup); |
2378 | 333 | verify(stateGroup.state === "screenshot"); | 311 | verify(stateGroup.state === "surface"); |
2379 | 334 | 312 | ||
2380 | 335 | surfaceCheckbox.checked = true; | 313 | surfaceCheckbox.checked = true; |
2381 | 336 | 314 | ||
2382 | 337 | tryCompare(stateGroup, "state", "surface"); | 315 | tryCompare(stateGroup, "state", "surface"); |
2383 | 338 | tryCompare(screenshotImage, "status", Image.Null); | ||
2384 | 339 | } | 316 | } |
2385 | 340 | 317 | ||
2386 | 341 | function test_appCrashed() { | 318 | function test_appCrashed() { |
2387 | @@ -343,13 +320,15 @@ | |||
2388 | 343 | setApplicationState(appRunning); | 320 | setApplicationState(appRunning); |
2389 | 344 | tryCompare(stateGroup, "state", "surface"); | 321 | tryCompare(stateGroup, "state", "surface"); |
2390 | 345 | waitUntilTransitionsEnd(stateGroup); | 322 | waitUntilTransitionsEnd(stateGroup); |
2391 | 323 | var surface = applicationWindow.surface; | ||
2392 | 346 | 324 | ||
2393 | 347 | // oh, it crashed... | 325 | // oh, it crashed... |
2394 | 348 | surfaceCheckbox.checked = false; | 326 | surfaceCheckbox.checked = false; |
2395 | 349 | setApplicationState(appStopped); | 327 | setApplicationState(appStopped); |
2396 | 350 | 328 | ||
2399 | 351 | tryCompare(stateGroup, "state", "screenshot"); | 329 | waitUntilTransitionsEnd(stateGroup); |
2400 | 352 | tryCompare(applicationWindow, "surface", null); | 330 | tryCompare(stateGroup, "state", "surface"); |
2401 | 331 | tryCompare(applicationWindow, "surface", surface); | ||
2402 | 353 | } | 332 | } |
2403 | 354 | 333 | ||
2404 | 355 | function test_keepSurfaceWhileInvisible() { | 334 | function test_keepSurfaceWhileInvisible() { |
2405 | @@ -393,17 +372,6 @@ | |||
2406 | 393 | verify(surfaceItem.touchReleaseCount === 1); | 372 | verify(surfaceItem.touchReleaseCount === 1); |
2407 | 394 | } | 373 | } |
2408 | 395 | 374 | ||
2409 | 396 | function test_showNothingOnSuddenSurfaceLoss() { | ||
2410 | 397 | surfaceCheckbox.checked = true; | ||
2411 | 398 | setApplicationState(appRunning); | ||
2412 | 399 | tryCompare(stateGroup, "state", "surface"); | ||
2413 | 400 | waitUntilTransitionsEnd(stateGroup); | ||
2414 | 401 | |||
2415 | 402 | applicationWindow.surface = null; | ||
2416 | 403 | |||
2417 | 404 | tryCompare(stateGroup, "state", "void"); | ||
2418 | 405 | } | ||
2419 | 406 | |||
2420 | 407 | function test_surfaceActiveFocusFollowsAppWindowInterative() { | 375 | function test_surfaceActiveFocusFollowsAppWindowInterative() { |
2421 | 408 | applicationWindow.interactive = false; | 376 | applicationWindow.interactive = false; |
2422 | 409 | applicationWindow.interactive = true; | 377 | applicationWindow.interactive = true; |
2423 | 410 | 378 | ||
2424 | === modified file 'tests/qmltests/Stage/tst_DesktopStage.qml' | |||
2425 | --- tests/qmltests/Stage/tst_DesktopStage.qml 2017-04-06 12:58:36 +0000 | |||
2426 | +++ tests/qmltests/Stage/tst_DesktopStage.qml 2017-04-06 12:58:37 +0000 | |||
2427 | @@ -558,8 +558,6 @@ | |||
2428 | 558 | var gmailDelegate = startApplication("gmail-webapp"); | 558 | var gmailDelegate = startApplication("gmail-webapp"); |
2429 | 559 | verify(gmailDelegate); | 559 | verify(gmailDelegate); |
2430 | 560 | 560 | ||
2431 | 561 | wait(2000) | ||
2432 | 562 | |||
2433 | 563 | var gmailMaximizeButton = findChild(gmailDelegate, "maximizeWindowButton"); | 561 | var gmailMaximizeButton = findChild(gmailDelegate, "maximizeWindowButton"); |
2434 | 564 | verify(gmailMaximizeButton); | 562 | verify(gmailMaximizeButton); |
2435 | 565 | mouseClick(gmailMaximizeButton); | 563 | mouseClick(gmailMaximizeButton); |
2436 | 566 | 564 | ||
2437 | === modified file 'tests/qmltests/Stage/tst_PhoneStage.qml' | |||
2438 | --- tests/qmltests/Stage/tst_PhoneStage.qml 2017-04-06 12:58:36 +0000 | |||
2439 | +++ tests/qmltests/Stage/tst_PhoneStage.qml 2017-04-06 12:58:37 +0000 | |||
2440 | @@ -304,7 +304,6 @@ | |||
2441 | 304 | 304 | ||
2442 | 305 | performEdgeSwipeToShowAppSpread(); | 305 | performEdgeSwipeToShowAppSpread(); |
2443 | 306 | 306 | ||
2444 | 307 | print("tapping", selectedAppDeleage.appId, selectedAppDeleage.visible) | ||
2445 | 308 | if (selectedAppDeleage.x > stage.width - units.gu(5)) { | 307 | if (selectedAppDeleage.x > stage.width - units.gu(5)) { |
2446 | 309 | touchFlick(stage, stage.width - units.gu(2), stage.height / 2, units.gu(2), stage.height / 2, true, true, units.gu(2), 10) | 308 | touchFlick(stage, stage.width - units.gu(2), stage.height / 2, units.gu(2), stage.height / 2, true, true, units.gu(2), 10) |
2447 | 310 | } | 309 | } |
2448 | 311 | 310 | ||
2449 | === modified file 'tests/qmltests/Stage/tst_TabletStage.qml' | |||
2450 | --- tests/qmltests/Stage/tst_TabletStage.qml 2017-04-06 12:58:36 +0000 | |||
2451 | +++ tests/qmltests/Stage/tst_TabletStage.qml 2017-04-06 12:58:37 +0000 | |||
2452 | @@ -66,7 +66,6 @@ | |||
2453 | 66 | } | 66 | } |
2454 | 67 | 67 | ||
2455 | 68 | Component.onCompleted: { | 68 | Component.onCompleted: { |
2456 | 69 | print("starting dash") | ||
2457 | 70 | ApplicationManager.startApplication("unity8-dash"); | 69 | ApplicationManager.startApplication("unity8-dash"); |
2458 | 71 | } | 70 | } |
2459 | 72 | } | 71 | } |
2460 | @@ -138,7 +137,6 @@ | |||
2461 | 138 | name: "TabletStage" | 137 | name: "TabletStage" |
2462 | 139 | when: windowShown | 138 | when: windowShown |
2463 | 140 | 139 | ||
2464 | 141 | readonly property alias topLevelSurfaceList: root.topLevelSurfaceList | ||
2465 | 142 | property Item sideStage: stage ? findChild(stage, "sideStage") : null | 140 | property Item sideStage: stage ? findChild(stage, "sideStage") : null |
2466 | 143 | 141 | ||
2467 | 144 | function init() { | 142 | function init() { |
2468 | @@ -167,6 +165,7 @@ | |||
2469 | 167 | waitUntilAppSurfaceShowsUp(topLevelSurfaceList.idAt(0)); | 165 | waitUntilAppSurfaceShowsUp(topLevelSurfaceList.idAt(0)); |
2470 | 168 | sideStage.hideNow() | 166 | sideStage.hideNow() |
2471 | 169 | tryCompare(sideStage, "x", stage.width) | 167 | tryCompare(sideStage, "x", stage.width) |
2472 | 168 | |||
2473 | 170 | } | 169 | } |
2474 | 171 | 170 | ||
2475 | 172 | function cleanup() { | 171 | function cleanup() { |
2476 | @@ -228,7 +227,7 @@ | |||
2477 | 228 | tryCompare(stage, "state", "spread"); | 227 | tryCompare(stage, "state", "spread"); |
2478 | 229 | } | 228 | } |
2479 | 230 | 229 | ||
2481 | 231 | function swipeSurfaceUpwards(surfaceId) { | 230 | function swipeSurfaceDownwards(surfaceId) { |
2482 | 232 | var appWindow = findAppWindowForSurfaceId(surfaceId); | 231 | var appWindow = findAppWindowForSurfaceId(surfaceId); |
2483 | 233 | verify(appWindow); | 232 | verify(appWindow); |
2484 | 234 | 233 | ||
2485 | @@ -236,7 +235,7 @@ | |||
2486 | 236 | // to not be covered by other surfaces when they're all being shown in the spread | 235 | // to not be covered by other surfaces when they're all being shown in the spread |
2487 | 237 | touchFlick(appWindow, | 236 | touchFlick(appWindow, |
2488 | 238 | appWindow.width * 0.1, appWindow.height / 2, | 237 | appWindow.width * 0.1, appWindow.height / 2, |
2490 | 239 | appWindow.width * 0.1, -appWindow.height / 2); | 238 | appWindow.width * 0.1, appWindow.height * 1.5); |
2491 | 240 | } | 239 | } |
2492 | 241 | 240 | ||
2493 | 242 | function dragToSideStage(surfaceId) { | 241 | function dragToSideStage(surfaceId) { |
2494 | @@ -334,7 +333,7 @@ | |||
2495 | 334 | compare(appDelegate.stage, ApplicationInfoInterface.SideStage); | 333 | compare(appDelegate.stage, ApplicationInfoInterface.SideStage); |
2496 | 335 | tryCompare(dragArea, "closeable", true); | 334 | tryCompare(dragArea, "closeable", true); |
2497 | 336 | 335 | ||
2499 | 337 | swipeSurfaceUpwards(dialerSurfaceId); | 336 | swipeSurfaceDownwards(dialerSurfaceId); |
2500 | 338 | 337 | ||
2501 | 339 | // Check that dialer-app has been closed | 338 | // Check that dialer-app has been closed |
2502 | 340 | 339 | ||
2503 | @@ -345,6 +344,8 @@ | |||
2504 | 345 | tryCompareFunction(function() { | 344 | tryCompareFunction(function() { |
2505 | 346 | return ApplicationManager.findApplication(dialerCheckBox.appId); | 345 | return ApplicationManager.findApplication(dialerCheckBox.appId); |
2506 | 347 | }, null); | 346 | }, null); |
2507 | 347 | |||
2508 | 348 | stage.closeSpread(); | ||
2509 | 348 | } | 349 | } |
2510 | 349 | 350 | ||
2511 | 350 | function test_suspendsAndResumesAppsInMainStage() { | 351 | function test_suspendsAndResumesAppsInMainStage() { |
2512 | @@ -597,7 +598,6 @@ | |||
2513 | 597 | 598 | ||
2514 | 598 | function test_loadSideStageByDraggingFromMainStage() { | 599 | function test_loadSideStageByDraggingFromMainStage() { |
2515 | 599 | sideStage.showNow(); | 600 | sideStage.showNow(); |
2516 | 600 | print("sidestage now shown. launching browser") | ||
2517 | 601 | var webbrowserSurfaceId = topLevelSurfaceList.nextId; | 601 | var webbrowserSurfaceId = topLevelSurfaceList.nextId; |
2518 | 602 | webbrowserCheckBox.checked = true; | 602 | webbrowserCheckBox.checked = true; |
2519 | 603 | waitUntilAppSurfaceShowsUp(webbrowserSurfaceId); | 603 | waitUntilAppSurfaceShowsUp(webbrowserSurfaceId); |
2520 | @@ -662,10 +662,6 @@ | |||
2521 | 662 | // simulate the suspended app being killed by the out-of-memory daemon | 662 | // simulate the suspended app being killed by the out-of-memory daemon |
2522 | 663 | webbrowserApp.surfaceList.get(0).setLive(false); | 663 | webbrowserApp.surfaceList.get(0).setLive(false); |
2523 | 664 | 664 | ||
2524 | 665 | // wait until the surface is gone | ||
2525 | 666 | tryCompare(webbrowserApp.surfaceList, "count", 0); | ||
2526 | 667 | compare(topLevelSurfaceList.surfaceAt(topLevelSurfaceList.indexForId(webbrowserSurfaceId)), null); | ||
2527 | 668 | |||
2528 | 669 | switchToSurface(webbrowserSurfaceId); | 665 | switchToSurface(webbrowserSurfaceId); |
2529 | 670 | 666 | ||
2530 | 671 | // webbrowser should have been brought to front | 667 | // webbrowser should have been brought to front |
2531 | 672 | 668 | ||
2532 | === modified file 'tests/qmltests/tst_OrientedShell.qml' | |||
2533 | --- tests/qmltests/tst_OrientedShell.qml 2017-04-06 12:58:36 +0000 | |||
2534 | +++ tests/qmltests/tst_OrientedShell.qml 2017-04-06 12:58:37 +0000 | |||
2535 | @@ -1521,7 +1521,6 @@ | |||
2536 | 1521 | } | 1521 | } |
2537 | 1522 | var point = surfaceItem.mapToItem(orientedShell, 0, 0); | 1522 | var point = surfaceItem.mapToItem(orientedShell, 0, 0); |
2538 | 1523 | 1523 | ||
2539 | 1524 | print("exptectedAngle", expectedAngle, point.x, point.y) | ||
2540 | 1525 | switch (expectedAngle) { | 1524 | switch (expectedAngle) { |
2541 | 1526 | case 0: | 1525 | case 0: |
2542 | 1527 | return point.x === 0 && point.y === panelState.panelHeight; | 1526 | return point.x === 0 && point.y === panelState.panelHeight; |
2543 | 1528 | 1527 | ||
2544 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
2545 | --- tests/qmltests/tst_Shell.qml 2017-04-06 12:58:36 +0000 | |||
2546 | +++ tests/qmltests/tst_Shell.qml 2017-04-06 12:58:37 +0000 | |||
2547 | @@ -265,6 +265,7 @@ | |||
2548 | 265 | anchors { left: parent.left; right: parent.right } | 265 | anchors { left: parent.left; right: parent.right } |
2549 | 266 | activeFocusOnPress: false | 266 | activeFocusOnPress: false |
2550 | 267 | model: ["phone", "tablet", "desktop"] | 267 | model: ["phone", "tablet", "desktop"] |
2551 | 268 | selectedIndex: 2 | ||
2552 | 268 | onSelectedIndexChanged: { | 269 | onSelectedIndexChanged: { |
2553 | 269 | shellLoader.state = model[selectedIndex]; | 270 | shellLoader.state = model[selectedIndex]; |
2554 | 270 | } | 271 | } |
2555 | @@ -278,6 +279,7 @@ | |||
2556 | 278 | anchors { left: parent.left; right: parent.right } | 279 | anchors { left: parent.left; right: parent.right } |
2557 | 279 | activeFocusOnPress: false | 280 | activeFocusOnPress: false |
2558 | 280 | model: ["phone", "tablet", "desktop"] | 281 | model: ["phone", "tablet", "desktop"] |
2559 | 282 | selectedIndex: 0 | ||
2560 | 281 | } | 283 | } |
2561 | 282 | MouseTouchEmulationCheckbox { | 284 | MouseTouchEmulationCheckbox { |
2562 | 283 | id: mouseEmulation | 285 | id: mouseEmulation |
2563 | @@ -1710,9 +1712,9 @@ | |||
2564 | 1710 | var spreadDelegate2 = appRepeater.itemAt(2); | 1712 | var spreadDelegate2 = appRepeater.itemAt(2); |
2565 | 1711 | var closeMouseArea = findChild(spreadDelegate2, "closeMouseArea"); | 1713 | var closeMouseArea = findChild(spreadDelegate2, "closeMouseArea"); |
2566 | 1712 | 1714 | ||
2568 | 1713 | // Move the mosue over tile 2 and verify the close button becomes visible | 1715 | // Move the mouse over tile 2 and verify the close button becomes visible |
2569 | 1714 | var x = 0; | 1716 | var x = 0; |
2571 | 1715 | var y = shell.height * .5; | 1717 | var y = shell.height * .6; |
2572 | 1716 | mouseMove(shell, x, y) | 1718 | mouseMove(shell, x, y) |
2573 | 1717 | while (spreadItem.highlightedIndex !== 2 && x <= 4000) { | 1719 | while (spreadItem.highlightedIndex !== 2 && x <= 4000) { |
2574 | 1718 | x+=10; | 1720 | x+=10; |
2575 | @@ -1720,6 +1722,7 @@ | |||
2576 | 1720 | wait(0); // spin the loop so bindings get evaluated | 1722 | wait(0); // spin the loop so bindings get evaluated |
2577 | 1721 | } | 1723 | } |
2578 | 1722 | tryCompare(closeMouseArea, "enabled", true) | 1724 | tryCompare(closeMouseArea, "enabled", true) |
2579 | 1725 | waitForRendering(shell) | ||
2580 | 1723 | 1726 | ||
2581 | 1724 | var countBeforeClickingCloseButton = topLevelSurfaceList.count; | 1727 | var countBeforeClickingCloseButton = topLevelSurfaceList.count; |
2582 | 1725 | verify(topLevelSurfaceList.indexForId(surfaceId) === 2); | 1728 | verify(topLevelSurfaceList.indexForId(surfaceId) === 2); |
2583 | @@ -1761,7 +1764,7 @@ | |||
2584 | 1761 | 1764 | ||
2585 | 1762 | // Move the mouse over tile 2 and verify the highlight becomes visible | 1765 | // Move the mouse over tile 2 and verify the highlight becomes visible |
2586 | 1763 | var x = 0; | 1766 | var x = 0; |
2588 | 1764 | var y = shell.height * (data.tileInfo ? .9 : 0.5) | 1767 | var y = shell.height * (data.tileInfo ? .9 : 0.7) |
2589 | 1765 | mouseMove(shell, x, y) | 1768 | mouseMove(shell, x, y) |
2590 | 1766 | while (spreadItem.highlightedIndex !== 2 && x <= 4000) { | 1769 | while (spreadItem.highlightedIndex !== 2 && x <= 4000) { |
2591 | 1767 | x+=10; | 1770 | x+=10; |
2592 | @@ -1783,6 +1786,15 @@ | |||
2593 | 1783 | function test_progressiveAutoScrolling() { | 1786 | function test_progressiveAutoScrolling() { |
2594 | 1784 | loadDesktopShellWithApps() | 1787 | loadDesktopShellWithApps() |
2595 | 1785 | 1788 | ||
2596 | 1789 | // load some more apps | ||
2597 | 1790 | ApplicationManager.startApplication("twitter-webapp") | ||
2598 | 1791 | ApplicationManager.startApplication("ubuntu-weather-app") | ||
2599 | 1792 | ApplicationManager.startApplication("notes-app") | ||
2600 | 1793 | for (var i = 0; i < topLevelSurfaceList.count; ++i) { | ||
2601 | 1794 | waitUntilAppWindowIsFullyLoaded(topLevelSurfaceList.idAt(i)); | ||
2602 | 1795 | } | ||
2603 | 1796 | |||
2604 | 1797 | |||
2605 | 1786 | var appRepeater = findInvisibleChild(shell, "appRepeater"); | 1798 | var appRepeater = findInvisibleChild(shell, "appRepeater"); |
2606 | 1787 | verify(appRepeater !== null); | 1799 | verify(appRepeater !== null); |
2607 | 1788 | 1800 | ||
2608 | @@ -1795,7 +1807,7 @@ | |||
2609 | 1795 | 1807 | ||
2610 | 1796 | // Move the mouse to the right and make sure it scrolls the Flickable | 1808 | // Move the mouse to the right and make sure it scrolls the Flickable |
2611 | 1797 | var x = 0; | 1809 | var x = 0; |
2613 | 1798 | var y = shell.height * .5 | 1810 | var y = shell.height * .7 |
2614 | 1799 | mouseMove(shell, x, y) | 1811 | mouseMove(shell, x, y) |
2615 | 1800 | while (x <= shell.width) { | 1812 | while (x <= shell.width) { |
2616 | 1801 | x+=10; | 1813 | x+=10; |
2617 | @@ -2696,7 +2708,6 @@ | |||
2618 | 2696 | dashAppDelegate.windowedY = data.windowY; | 2708 | dashAppDelegate.windowedY = data.windowY; |
2619 | 2697 | topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0)); | 2709 | topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0)); |
2620 | 2698 | var initialY = dashAppDelegate.y; | 2710 | var initialY = dashAppDelegate.y; |
2621 | 2699 | print("intial", initialY, "panel", panelState.panelHeight); | ||
2622 | 2700 | verify(initialY > panelState.panelHeight); | 2711 | verify(initialY > panelState.panelHeight); |
2623 | 2701 | 2712 | ||
2624 | 2702 | topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2)); | 2713 | topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2)); |
FAILED: Continuous integration, rev:2762 /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/2901/ /unity8- jenkins. ubuntu. com/job/ build/3785/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/3813/ console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/2901/ rebuild
https:/