dateMenu: Replace EventsList with MessageList

Turn the existing EventsList into a MessageListSection and add the
message list to the calendar drop-down. The new events list only
displays events for the currently selected day, but in a more
structured and friendlier way than the old one.

https://bugzilla.gnome.org/show_bug.cgi?id=744817
This commit is contained in:
Florian Müllner
2014-12-11 18:29:17 +01:00
parent 464f552dd2
commit e850d9e29b
4 changed files with 109 additions and 213 deletions

View File

@ -104,7 +104,7 @@ const DateMenuButton = new Lang.Class({
this._calendar = new Calendar.Calendar();
this._calendar.connect('selected-date-changed',
Lang.bind(this, function(calendar, date) {
this._eventList.setDate(date);
this._messageList.setDate(date);
}));
// Whenever the menu is opened, select today
@ -117,8 +117,8 @@ const DateMenuButton = new Lang.Class({
}));
// Fill up the first column
this._eventList = new Calendar.EventsList();
hbox.add(this._eventList.actor, { expand: true, y_fill: false, y_align: St.Align.START });
this._messageList = new Calendar.MessageList();
hbox.add(this._messageList.actor, { expand: true, y_fill: false, y_align: St.Align.START });
// Fill up the second column
vbox = new St.BoxLayout({ style_class: 'datemenu-calendar-column',
@ -165,7 +165,7 @@ const DateMenuButton = new Lang.Class({
(this._getCalendarApp() != null);
this._openClocksItem.actor.visible = visible &&
(this._getClockApp() != null);
this._eventList.actor.visible = visible;
this._messageList.actor.visible = visible;
},
_getEventSource: function() {
@ -177,7 +177,7 @@ const DateMenuButton = new Lang.Class({
this._eventSource.destroy();
this._calendar.setEventSource(eventSource);
this._eventList.setEventSource(eventSource);
this._messageList.setEventSource(eventSource);
this._eventSource = eventSource;
this._eventSource.connect('notify::has-calendars', Lang.bind(this, function() {