panel: remove some leftover code from the old calendar
This commit is contained in:
parent
294490f77b
commit
37d307c80e
@ -11,7 +11,6 @@ const Signals = imports.signals;
|
|||||||
const Gettext = imports.gettext.domain('gnome-shell');
|
const Gettext = imports.gettext.domain('gnome-shell');
|
||||||
const _ = Gettext.gettext;
|
const _ = Gettext.gettext;
|
||||||
|
|
||||||
const Calendar = imports.ui.calendar;
|
|
||||||
const Config = imports.misc.config;
|
const Config = imports.misc.config;
|
||||||
const Overview = imports.ui.overview;
|
const Overview = imports.ui.overview;
|
||||||
const PopupMenu = imports.ui.popupMenu;
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
@ -900,63 +899,3 @@ Panel.prototype = {
|
|||||||
this._hotCornerActivationTime = 0;
|
this._hotCornerActivationTime = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function CalendarPopup() {
|
|
||||||
this._init();
|
|
||||||
}
|
|
||||||
|
|
||||||
CalendarPopup.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
let panelActor = Main.panel.actor;
|
|
||||||
let alignConstraint = new Clutter.AlignConstraint({ source: panelActor,
|
|
||||||
align_axis: Clutter.AlignAxis.X_AXIS,
|
|
||||||
factor: 0.5 });
|
|
||||||
|
|
||||||
this.actor = new St.Bin({ name: 'calendarPopup' });
|
|
||||||
|
|
||||||
this.calendar = new Calendar.Calendar();
|
|
||||||
this.actor.set_child(this.calendar.actor);
|
|
||||||
|
|
||||||
this.isOpen = false;
|
|
||||||
|
|
||||||
Main.chrome.addActor(this.actor, { visibleInOverview: true,
|
|
||||||
affectsStruts: false });
|
|
||||||
this.actor.y = (panelActor.y + panelActor.height - this.actor.height);
|
|
||||||
this.actor.add_constraint(alignConstraint);
|
|
||||||
},
|
|
||||||
|
|
||||||
show: function() {
|
|
||||||
let panelActor = Main.panel.actor;
|
|
||||||
|
|
||||||
if (this.isOpen)
|
|
||||||
return;
|
|
||||||
this.isOpen = true;
|
|
||||||
|
|
||||||
// Reset the calendar to today's date
|
|
||||||
this.calendar.setDate(new Date());
|
|
||||||
|
|
||||||
this.actor.lower(panelActor);
|
|
||||||
this.actor.show();
|
|
||||||
Tweener.addTween(this.actor,
|
|
||||||
{ y: panelActor.y + panelActor.height,
|
|
||||||
time: 0.2,
|
|
||||||
transition: 'easeOutQuad'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
hide: function() {
|
|
||||||
let panelActor = Main.panel.actor;
|
|
||||||
|
|
||||||
if (!this.isOpen)
|
|
||||||
return;
|
|
||||||
this.isOpen = false;
|
|
||||||
|
|
||||||
Tweener.addTween(this.actor,
|
|
||||||
{ y: panelActor.y + panelActor.height - this.actor.height,
|
|
||||||
time: 0.2,
|
|
||||||
transition: 'easeOutQuad',
|
|
||||||
onComplete: function() { this.actor.hide(); },
|
|
||||||
onCompleteScope: this
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
Loading…
Reference in New Issue
Block a user