Show the panel above the screenshield when locked
Track locked status and use it to provide a reduced version of the panel in the locked screen. Accessibility, input sources and volume menus are preserved, without the link to the control center. Network, battery and user menu are reduced to pure indicators, with no menu. This is similar to the design but not exactly, because designers in IRC said that network needs more analysis before exposing, and because the design didn't account for a11y and IM (so the one menu metaphor is not really appropriate). https://bugzilla.gnome.org/show_bug.cgi?id=619955
This commit is contained in:
@ -467,6 +467,13 @@ const AppMenuButton = new Lang.Class({
|
||||
this._sync();
|
||||
},
|
||||
|
||||
setLockedState: function(locked) {
|
||||
if (locked)
|
||||
this.hide();
|
||||
else
|
||||
this._sync();
|
||||
},
|
||||
|
||||
_sync: function() {
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
let focusedApp = tracker.focus_app;
|
||||
@ -910,6 +917,8 @@ const Panel = new Lang.Class({
|
||||
this.actor.remove_style_class_name('in-overview');
|
||||
}));
|
||||
|
||||
Main.screenShield.connect('lock-status-changed', Lang.bind(this, this._onLockStateChanged));
|
||||
|
||||
this._menus = new PopupMenu.PopupMenuManager(this);
|
||||
|
||||
this._leftBox = new St.BoxLayout({ name: 'panelLeft' });
|
||||
@ -1135,7 +1144,7 @@ const Panel = new Lang.Class({
|
||||
|
||||
this._statusArea[role] = indicator;
|
||||
let destroyId = indicator.connect('destroy', Lang.bind(this, function(emitter) {
|
||||
this._statusArea[role] = null;
|
||||
delete this._statusArea[role];
|
||||
emitter.disconnect(destroyId);
|
||||
}));
|
||||
|
||||
@ -1165,4 +1174,16 @@ const Panel = new Lang.Class({
|
||||
if (box && box._delegate instanceof PanelMenu.ButtonBox)
|
||||
box.destroy();
|
||||
},
|
||||
|
||||
_onLockStateChanged: function(shield, locked) {
|
||||
if (this._activitiesButton)
|
||||
this._activitiesButton.setLockedState(locked);
|
||||
if (this._appMenu)
|
||||
this._appMenu.setLockedState(locked);
|
||||
if (this._dateMenu)
|
||||
this._dateMenu.setLockedState(locked);
|
||||
|
||||
for (let id in this._statusArea)
|
||||
this._statusArea[id].setLockedState(locked);
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user