~josharenson/unity8/slim_greeter_real_lightdm

« back to all changes in this revision

Viewing changes to qml/Stages/TabletStage.qml

  • Committer: Josh Arenson
  • Date: 2016-06-29 14:44:41 UTC
  • mfrom: (1789.412.85 unity8)
  • Revision ID: joshua.arenson@canonical.com-20160629144441-du2vd7vu97b2n8pc
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
            orientations |= Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation;
102
102
            if (priv.sideStageItemId && !spreadView.surfaceDragging) {
103
103
                // If we have a sidestage app, support Portrait orientation
104
 
                // so that it will switch the sidestage app to mainstage on rotate
 
104
                // so that it will switch the sidestage app to mainstage on rotate to portrait
105
105
                orientations |= Qt.PortraitOrientation|Qt.InvertedPortraitOrientation;
106
106
            }
107
107
            return orientations;
624
624
                enabled: priv.sideStageEnabled
625
625
 
626
626
                onDropped: {
627
 
                    drop.source.spreadDelegate.stage = ApplicationInfoInterface.MainStage;
 
627
                    drop.source.spreadDelegate.saveStage(ApplicationInfoInterface.MainStage);
628
628
                    drop.source.spreadDelegate.focus = true;
629
629
                }
630
630
                keys: "SideStage"
679
679
                    }
680
680
                    onDropped: {
681
681
                        if (drop.keys == "MainStage") {
682
 
                            drop.source.spreadDelegate.stage = ApplicationInfoInterface.SideStage;
 
682
                            drop.source.spreadDelegate.saveStage(ApplicationInfoInterface.SideStage);
683
683
                            drop.source.spreadDelegate.focus = true;
684
684
                        }
685
685
                    }
810
810
                        }
811
811
                    }
812
812
 
 
813
                    function saveStage(newStage) {
 
814
                        stage = newStage;
 
815
                        WindowStateStorage.saveStage(application.appId, newStage);
 
816
                    }
 
817
 
813
818
                    // FIXME: A regular binding doesn't update any more after closing an app.
814
819
                    // Using a Binding for now.
815
820
                    Binding {
843
848
                        refreshStage();
844
849
                        _constructing = false;
845
850
                    }
846
 
                    Component.onDestruction: {
847
 
                        WindowStateStorage.saveStage(application.appId, stage);
848
 
                    }
849
851
 
850
852
                    function refreshStage() {
851
853
                        var newStage = ApplicationInfoInterface.MainStage;
852
 
                        if (priv.sideStageEnabled) {
853
 
                            if (application && application.supportedOrientations & (Qt.PortraitOrientation|Qt.InvertedPortraitOrientation)) {
854
 
                                newStage = WindowStateStorage.getStage(application.appId);
 
854
                        if (priv.sideStageEnabled) { // we're in lanscape rotation.
 
855
                            if (!isDash && application && application.supportedOrientations & (Qt.PortraitOrientation|Qt.InvertedPortraitOrientation)) {
 
856
                                var defaultStage = ApplicationInfoInterface.SideStage; // if application supports portrait, it defaults to sidestage.
 
857
                                if (application.supportedOrientations & (Qt.LandscapeOrientation|Qt.InvertedLandscapeOrientation)) {
 
858
                                    // if it supports lanscape, it defaults to mainstage.
 
859
                                    defaultStage = ApplicationInfoInterface.MainStage;
 
860
                                }
 
861
                                newStage = WindowStateStorage.getStage(application.appId, defaultStage);
855
862
                            }
856
863
                        }
857
864
 
1085
1092
                // only accept opposite stage.
1086
1093
                Drag.keys: {
1087
1094
                    if (!surface) return "Disabled";
 
1095
                    if (spreadDelegate.isDash) return "Disabled";
1088
1096
 
1089
1097
                    if (spreadDelegate.stage === ApplicationInfo.MainStage) {
1090
1098
                        if (spreadDelegate.application.supportedOrientations