~dandrader/unity8/miral

« back to all changes in this revision

Viewing changes to Shell.qml

  • Committer: Tarmac
  • Author(s): Michael Terry
  • Date: 2013-08-28 23:44:32 UTC
  • mfrom: (111.2.64 demo)
  • Revision ID: tarmac-20130828234432-n0nwrx635rfvk3bn
Implement edge demos on first boot.

Build-Depends: +dbus-test-runner, +qtbase5-dev-tools.

Approved by PS Jenkins bot, Michael Zanetti.

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
            available: !greeter.shown && !lockscreen.shown
196
196
            hides: [stages, launcher, panel.indicators]
197
197
            shown: disappearingAnimationProgress !== 1.0
198
 
            enabled: disappearingAnimationProgress === 0.0
 
198
            enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
199
199
            // FIXME: unfocus all applications when going back to the dash
200
200
            onEnabledChanged: {
201
201
                if (enabled) {
386
386
 
387
387
                width: shell.edgeSize
388
388
                direction: Direction.Leftwards
 
389
                enabled: edgeDemo.dashEnabled
389
390
                property bool haveApps: mainStage.applications.count > 0 || sideStage.applications.count > 0
390
391
 
391
392
                maxTotalDragDistance: haveApps ? parent.width : parent.width * 0.7
414
415
        Component.onCompleted: {
415
416
            if (LightDM.Users.count == 1) {
416
417
                LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
 
418
                greeter.selected(0)
417
419
            }
418
420
        }
419
421
    }
456
458
                // If there are more users, the Greeter will handle that
457
459
                if (LightDM.Users.count == 1) {
458
460
                    LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
 
461
                    greeter.selected(0);
459
462
                }
460
463
                greeter.forceActiveFocus();
461
464
            }
510
513
            } else if (status == Powerd.On) {
511
514
                powerConnection.setFocused(true);
512
515
            }
 
516
 
 
517
            // No reason to chew demo CPU when user isn't watching
 
518
            if (status == Powerd.Off) {
 
519
                edgeDemo.paused = true;
 
520
            } else if (status == Powerd.On) {
 
521
                edgeDemo.paused = false;
 
522
            }
513
523
        }
514
524
    }
515
525
 
524
534
            indicatorsMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
525
535
            indicators {
526
536
                hides: [launcher]
 
537
                available: edgeDemo.panelEnabled
 
538
                contentEnabled: edgeDemo.panelContentEnabled
527
539
            }
528
540
            fullscreenMode: shell.fullscreenMode
529
541
            searchVisible: !greeter.shown && !lockscreen.shown
540
552
            width: parent.width > units.gu(60) ? units.gu(40) : parent.width
541
553
            height: parent.height
542
554
 
543
 
            available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown
 
555
            available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown && edgeDemo.dashEnabled
544
556
            shown: false
545
557
            showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
546
558
            hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
598
610
            anchors.bottom: parent.bottom
599
611
            width: parent.width
600
612
            dragAreaWidth: shell.edgeSize
601
 
            available: !greeter.shown || greeter.narrowMode
 
613
            available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
602
614
            onDashItemSelected: {
603
615
                greeter.hide()
604
616
                // Animate if moving between application and dash
707
719
        rotation: -45
708
720
        scale: Math.min(parent.width, parent.height) / width
709
721
    }
 
722
 
 
723
    EdgeDemo {
 
724
        id: edgeDemo
 
725
        greeter: greeter
 
726
        launcher: launcher
 
727
        dash: dash
 
728
        indicators: panel.indicators
 
729
        underlay: underlay
 
730
    }
710
731
}