calendar: Use Clutter.GridLayout

Clutter.TableLayout has been deprecated, so move to the recommended
replacement.
This commit is contained in:
Florian Müllner 2014-06-20 16:23:32 +02:00
parent 017c2468ee
commit e9f95ca605

View File

@ -409,7 +409,7 @@ const Calendar = new Lang.Class({
this._shouldDateGrabFocus = false; this._shouldDateGrabFocus = false;
this.actor = new St.Widget({ style_class: 'calendar', this.actor = new St.Widget({ style_class: 'calendar',
layout_manager: new Clutter.TableLayout(), layout_manager: new Clutter.GridLayout(),
reactive: true }); reactive: true });
this.actor.connect('scroll-event', this.actor.connect('scroll-event',
@ -447,8 +447,7 @@ const Calendar = new Lang.Class({
// Top line of the calendar '<| September 2009 |>' // Top line of the calendar '<| September 2009 |>'
this._topBox = new St.BoxLayout(); this._topBox = new St.BoxLayout();
layout.pack(this._topBox, 0, 0); layout.attach(this._topBox, 0, 0, offsetCols + 7, 1);
layout.set_span(this._topBox, offsetCols + 7, 1);
this._backButton = new St.Button({ style_class: 'calendar-change-month-back', this._backButton = new St.Button({ style_class: 'calendar-change-month-back',
accessible_name: _("Previous month"), accessible_name: _("Previous month"),
@ -485,7 +484,7 @@ const Calendar = new Lang.Class({
col = 6 - (7 + iter.getDay() - this._weekStart) % 7; col = 6 - (7 + iter.getDay() - this._weekStart) % 7;
else else
col = offsetCols + (7 + iter.getDay() - this._weekStart) % 7; col = offsetCols + (7 + iter.getDay() - this._weekStart) % 7;
layout.pack(label, col, 1); layout.attach(label, col, 1, 1, 1);
iter.setTime(iter.getTime() + MSECS_IN_DAY); iter.setTime(iter.getTime() + MSECS_IN_DAY);
} }
@ -657,14 +656,14 @@ const Calendar = new Lang.Class({
col = 6 - (7 + iter.getDay() - this._weekStart) % 7; col = 6 - (7 + iter.getDay() - this._weekStart) % 7;
else else
col = offsetCols + (7 + iter.getDay() - this._weekStart) % 7; col = offsetCols + (7 + iter.getDay() - this._weekStart) % 7;
layout.pack(button, col, row); layout.attach(button, col, row, 1, 1);
this._buttons.push(button); this._buttons.push(button);
if (this._useWeekdate && iter.getDay() == 4) { if (this._useWeekdate && iter.getDay() == 4) {
let label = new St.Label({ text: _getCalendarWeekForDate(iter).toString(), let label = new St.Label({ text: _getCalendarWeekForDate(iter).toString(),
style_class: 'calendar-day-base calendar-week-number'}); style_class: 'calendar-day-base calendar-week-number'});
layout.pack(label, rtl ? 7 : 0, row); layout.attach(label, rtl ? 7 : 0, row, 1, 1);
} }
iter.setTime(iter.getTime() + MSECS_IN_DAY); iter.setTime(iter.getTime() + MSECS_IN_DAY);