~ci-train-bot/unity8/unity8-ubuntu-zesty-2663

« back to all changes in this revision

Viewing changes to qml/Stage/WindowStateSaver.qml

  • Committer: Nick Dedekind
  • Date: 2017-03-15 15:22:07 UTC
  • mfrom: (2868 unity8)
  • mto: This revision was merged to the branch mainline in revision 2892.
  • Revision ID: nick.dedekind@canonical.com-20170315152207-9ts6lyu1v2pruue2
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    property int leftMargin: 0
29
29
    property int minimumY: 0
30
30
 
 
31
    property int loadedState
 
32
 
31
33
    function load() {
32
34
        var defaultWidth = units.gu(60);
33
35
        var defaultHeight = units.gu(50);
41
43
                                                           (target.fullscreen ? 0 : root.leftMargin)); });
42
44
        target.windowedY = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, screenHeight - target.windowedHeight), minimumY); });
43
45
 
44
 
        var windowState = WindowStateStorage.getState(target.appId, WindowStateStorage.WindowStateNormal)
45
 
        target.restore(false /* animated */, windowState);
46
 
 
47
46
        target.updateNormalGeometry();
48
47
 
49
48
        // initialize the x/y to restore to
50
49
        target.restoredX = target.normalX;
51
50
        target.restoredY = target.normalY;
 
51
 
 
52
        loadedState = WindowStateStorage.getState(target.appId, WindowStateStorage.WindowStateNormal);
52
53
    }
53
54
 
54
55
    function save() {