[gtk] filechooserwidget: Use a bin layout



commit 26b6d18563d47636e4f09191b3744e428466ee4a
Author: Timm Bäder <tbaeder redhat com>
Date:   Mon Apr 29 11:21:53 2019 +0200

    filechooserwidget: Use a bin layout
    
    Instead of implementing size_allocate and measure manually.

 gtk/gtkfilechooserwidget.c | 38 +++-----------------------------------
 1 file changed, 3 insertions(+), 35 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 42e3782c54..c66b23e856 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -83,6 +83,7 @@
 #include "gtkfilechoosererrorstackprivate.h"
 #include "gtkentryprivate.h"
 #include "gtkroot.h"
+#include "gtkbinlayout.h"
 
 #include <cairo-gobject.h>
 
@@ -7933,39 +7934,6 @@ add_normal_and_shifted_binding (GtkBindingSet   *binding_set,
                                 signal_name, 0);
 }
 
-static void
-gtk_file_chooser_widget_measure (GtkWidget       *widget,
-                                 GtkOrientation  orientation,
-                                 int             for_size,
-                                 int            *minimum,
-                                 int            *natural,
-                                 int            *minimum_baseline,
-                                 int            *natural_baseline)
-{
-  GtkFileChooserWidget *self = GTK_FILE_CHOOSER_WIDGET (widget);
-  GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (self);
-
-  gtk_widget_measure (priv->box, orientation, for_size,
-                      minimum, natural,
-                      minimum_baseline, natural_baseline);
-}
-
-static void
-gtk_file_chooser_widget_size_allocate (GtkWidget *widget,
-                                       int        width,
-                                       int        height,
-                                       int        baseline)
-{
-  GtkFileChooserWidget *self = GTK_FILE_CHOOSER_WIDGET (widget);
-  GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (self);
-
-  gtk_widget_size_allocate (priv->box,
-                            &(GtkAllocation) {
-                              0, 0,
-                              width, height
-                            },-1);
-}
-
 static void
 gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
 {
@@ -7990,8 +7958,6 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
   widget_class->unroot = gtk_file_chooser_widget_unroot;
   widget_class->style_updated = gtk_file_chooser_widget_style_updated;
   widget_class->display_changed = gtk_file_chooser_widget_display_changed;
-  widget_class->measure = gtk_file_chooser_widget_measure;
-  widget_class->size_allocate = gtk_file_chooser_widget_size_allocate;
 
   /*
    * Signals
@@ -8558,6 +8524,8 @@ gtk_file_chooser_widget_init (GtkFileChooserWidget *impl)
    */
   post_process_ui (impl);
 
+  gtk_widget_set_layout_manager (GTK_WIDGET (impl), gtk_bin_layout_new ());
+
   profile_end ("end", NULL);
 }
 


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