Reorganize overlay hiding/showing code
Rather than having main.js manage this, put it into overlay.js, and have the overlay object emit signals that other code can watch to do things when the overlay is showing/shown/hiding/hidden.
This commit is contained in:
@ -150,14 +150,8 @@ Panel.prototype = {
|
||||
// have the overlay act like a menu that allows the user to release the mouse on the activity the user wants
|
||||
// to switch to.
|
||||
this.button.button.connect('button-press-event',
|
||||
function(o, event) {
|
||||
if (Main.overlay.visible)
|
||||
Main.hideOverlay();
|
||||
else
|
||||
Main.showOverlay();
|
||||
|
||||
return true;
|
||||
});
|
||||
Lang.bind(Main.overlay, Main.overlay.toggle));
|
||||
Main.overlay.connect('hiding', Lang.bind(this.button, this.button.release));
|
||||
|
||||
this.actor.add_actor(box);
|
||||
|
||||
@ -217,9 +211,5 @@ Panel.prototype = {
|
||||
this._clock.set_text(displayDate.toLocaleFormat("%a %b %e, %l:%M %p"));
|
||||
Mainloop.timeout_add(msecRemaining, Lang.bind(this, this._updateClock));
|
||||
return false;
|
||||
},
|
||||
|
||||
overlayHidden: function() {
|
||||
this.button.release();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user