diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2019-05-06 12:06:27 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2019-05-06 12:06:27 +0100 |
commit | 59c6862a0301d4c922f6adc36c81f859997555ba (patch) | |
tree | 431e2b8edce688ae96fab4afd6184a37f598462f /gtk/gtkoverlay.c | |
parent | c6b2184aa0cce3b1ac65d538495cd725db0f4770 (diff) | |
download | gtk+-59c6862a0301d4c922f6adc36c81f859997555ba.tar.gz |
Use gtk_widget_class_set_layout_manager_type()
Instead of manually creating the layout manager inside the instance
initialization function, we can let GtkWidget do that for us.
Diffstat (limited to 'gtk/gtkoverlay.c')
-rw-r--r-- | gtk/gtkoverlay.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c index 5195f9ac0a..13af196f40 100644 --- a/gtk/gtkoverlay.c +++ b/gtk/gtkoverlay.c @@ -302,6 +302,8 @@ gtk_overlay_class_init (GtkOverlayClass *klass) GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE); gtk_widget_class_set_css_name (widget_class, I_("overlay")); + + gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_OVERLAY_LAYOUT); } static void @@ -311,8 +313,7 @@ gtk_overlay_init (GtkOverlay *overlay) gtk_widget_set_has_surface (GTK_WIDGET (overlay), FALSE); - priv->layout = gtk_overlay_layout_new (); - gtk_widget_set_layout_manager (GTK_WIDGET (overlay), priv->layout); + priv->layout = gtk_widget_get_layout_manager (GTK_WIDGET (overlay)); } static GtkBuildableIface *parent_buildable_iface; |