[gtk/wip/baedert/for-master: 19/25] statusbar: Use a bin layout



commit cd43aa3e0c83763e0cb7133e7fbe0571e3d11078
Author: Timm Bäder <mail baedert org>
Date:   Sun Oct 6 14:03:57 2019 +0200

    statusbar: Use a bin layout

 gtk/gtkstatusbar.c | 35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)
---
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index c214015a73..cf140118e2 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -27,6 +27,7 @@
 
 #include "gtkstatusbar.h"
 
+#include "gtkbinlayout.h"
 #include "gtkframe.h"
 #include "gtklabel.h"
 #include "gtkmarshalers.h"
@@ -144,37 +145,6 @@ gtk_statusbar_dispose (GObject *object)
   G_OBJECT_CLASS (gtk_statusbar_parent_class)->dispose (object);
 }
 
-static void
-gtk_statusbar_measure (GtkWidget      *widget,
-                       GtkOrientation  orientation,
-                       int             for_size,
-                       int            *minimum,
-                       int            *natural,
-                       int            *minimum_baseline,
-                       int            *natural_baseline)
-{
-  GtkStatusbarPrivate *priv = gtk_statusbar_get_instance_private (GTK_STATUSBAR (widget));
-
-  gtk_widget_measure (priv->frame, orientation, for_size,
-                      minimum, natural,
-                      minimum_baseline, natural_baseline);
-}
-
-static void
-gtk_statusbar_size_allocate (GtkWidget *widget,
-                             int        width,
-                             int        height,
-                             int        baseline)
-{
-  GtkStatusbarPrivate *priv = gtk_statusbar_get_instance_private (GTK_STATUSBAR (widget));
-
-  gtk_widget_size_allocate (priv->frame,
-                            &(GtkAllocation) {
-                              0, 0,
-                              width, height
-                            }, baseline);
-}
-
 static void
 gtk_statusbar_class_init (GtkStatusbarClass *class)
 {
@@ -183,8 +153,6 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
 
   object_class->dispose = gtk_statusbar_dispose;
 
-  widget_class->measure = gtk_statusbar_measure;
-  widget_class->size_allocate = gtk_statusbar_size_allocate;
   widget_class->destroy = gtk_statusbar_destroy;
 
   class->text_pushed = gtk_statusbar_update;
@@ -236,6 +204,7 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
   gtk_widget_class_bind_template_child_private (widget_class, GtkStatusbar, label);
 
   gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_STATUSBAR_ACCESSIBLE);
+  gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
   gtk_widget_class_set_css_name (widget_class, I_("statusbar"));
 }
 


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