[gnome-maps/wip/mlundblad/cleanup-gtk-deprecations] transitLegRow: Stop using GtkContainer add method



commit bb16335f45de47232d9798d8cdc6bfa7ff15d02b
Author: Marcus Lundblad <ml update uu se>
Date:   Fri Mar 26 23:13:50 2021 +0100

    transitLegRow: Stop using GtkContainer add method
    
    In preparation for GTK 4 use class-specific methods
    to add and remove children when possible.

 src/transitLegRow.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/transitLegRow.js b/src/transitLegRow.js
index c4db72aa..46d0a31d 100644
--- a/src/transitLegRow.js
+++ b/src/transitLegRow.js
@@ -68,7 +68,7 @@ var TransitLegRow = GObject.registerClass({
                                     leg: this._leg,
                                  });
 
-            this._routeGrid.add(routeLabel);
+            this._routeGrid.attach(routeLabel, 0, 0, 1, 1);
 
             this._agencyLabel.visible = true;
 
@@ -106,7 +106,8 @@ var TransitLegRow = GObject.registerClass({
 
             headsignLabel.label = '<span size="small">%s</span>'.format(label);
             headsignLabel.get_style_context().add_class('dim-label');
-            this._routeGrid.add(headsignLabel);
+            this._routeGrid.attach(headsignLabel, this._leg.transit ? 1 : 0, 0,
+                                   1, 1);
         }
 
         this._timeLabel.label = this._leg.prettyPrintTime({ isStart: this._start });
@@ -186,7 +187,7 @@ var TransitLegRow = GObject.registerClass({
                         new TransitStopRow.TransitStopRow({ visible: true,
                                                             stop: stop,
                                                             final: index === stops.length - 1 });
-                    this._instructionList.add(row);
+                    this._instructionList.insert(row, -1);
                 }
             }
         } else {
@@ -201,7 +202,7 @@ var TransitLegRow = GObject.registerClass({
                     new InstructionRow.InstructionRow({ visible: true,
                                                         turnPoint: instruction });
 
-                this._instructionList.add(row);
+                this._instructionList.insert(row, -1);
             }
         }
     }


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