[gnome-shell] calendar: Use Clutter.GridLayout



commit e9f95ca605c225b97963b7a0d5df3dfc6b4702da
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jun 20 16:23:32 2014 +0200

    calendar: Use Clutter.GridLayout
    
    Clutter.TableLayout has been deprecated, so move to the recommended
    replacement.

 js/ui/calendar.js |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 35e35e9..4649c03 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -409,7 +409,7 @@ const Calendar = new Lang.Class({
         this._shouldDateGrabFocus = false;
 
         this.actor = new St.Widget({ style_class: 'calendar',
-                                     layout_manager: new Clutter.TableLayout(),
+                                     layout_manager: new Clutter.GridLayout(),
                                      reactive: true });
 
         this.actor.connect('scroll-event',
@@ -447,8 +447,7 @@ const Calendar = new Lang.Class({
 
         // Top line of the calendar '<| September 2009 |>'
         this._topBox = new St.BoxLayout();
-        layout.pack(this._topBox, 0, 0);
-        layout.set_span(this._topBox, offsetCols + 7, 1);
+        layout.attach(this._topBox, 0, 0, offsetCols + 7, 1);
 
         this._backButton = new St.Button({ style_class: 'calendar-change-month-back',
                                            accessible_name: _("Previous month"),
@@ -485,7 +484,7 @@ const Calendar = new Lang.Class({
                 col = 6 - (7 + iter.getDay() - this._weekStart) % 7;
             else
                 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);
         }
 
@@ -657,14 +656,14 @@ const Calendar = new Lang.Class({
                 col = 6 - (7 + iter.getDay() - this._weekStart) % 7;
             else
                 col = offsetCols + (7 + iter.getDay() - this._weekStart) % 7;
-            layout.pack(button, col, row);
+            layout.attach(button, col, row, 1, 1);
 
             this._buttons.push(button);
 
             if (this._useWeekdate && iter.getDay() == 4) {
                 let label = new St.Label({ text: _getCalendarWeekForDate(iter).toString(),
                                            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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]