[gtk] filechooserbutton: Use a bin layout



commit c675d1c9e154dae9f1f87a7f8e0ed820f81bff88
Author: Timm Bäder <tbaeder redhat com>
Date:   Fri May 3 08:04:39 2019 +0200

    filechooserbutton: Use a bin layout

 gtk/gtkfilechooserbutton.c | 40 +++-------------------------------------
 1 file changed, 3 insertions(+), 37 deletions(-)
---
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index f6bc943746..ea9de54450 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -49,6 +49,7 @@
 #include "gtkfilechooserprivate.h"
 #include "gtkfilechooserutils.h"
 #include "gtkmarshalers.h"
+#include "gtkbinlayout.h"
 
 #include "gtkfilechooserbutton.h"
 
@@ -339,41 +340,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkFileChooserButton, gtk_file_chooser_button, GTK_TYPE
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_FILE_CHOOSER,
                                                 gtk_file_chooser_button_file_chooser_iface_init))
 
-
-
-static void
-gtk_file_chooser_button_measure (GtkWidget       *widget,
-                                 GtkOrientation  orientation,
-                                 int             for_size,
-                                 int            *minimum,
-                                 int            *natural,
-                                 int            *minimum_baseline,
-                                 int            *natural_baseline)
-{
-  GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
-  GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
-
-  gtk_widget_measure (priv->child, orientation, for_size,
-                      minimum, natural,
-                      minimum_baseline, natural_baseline);
-}
-
-static void
-gtk_file_chooser_button_size_allocate (GtkWidget *widget,
-                                       int        width,
-                                       int        height,
-                                       int        baseline)
-{
-  GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
-  GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
-
-  gtk_widget_size_allocate (priv->child,
-                            &(GtkAllocation) {
-                              0, 0,
-                              width, height
-                            }, baseline);
-}
-
 static void
 gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
 {
@@ -397,8 +363,6 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
   widget_class->root = gtk_file_chooser_button_root;
   widget_class->mnemonic_activate = gtk_file_chooser_button_mnemonic_activate;
   widget_class->state_flags_changed = gtk_file_chooser_button_state_flags_changed;
-  widget_class->measure = gtk_file_chooser_button_measure;
-  widget_class->size_allocate = gtk_file_chooser_button_size_allocate;
 
   /**
    * GtkFileChooserButton::file-set:
@@ -533,6 +497,8 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button)
                     target_list,
                     GDK_ACTION_COPY);
   gdk_content_formats_unref (target_list);
+
+  gtk_widget_set_layout_manager (GTK_WIDGET (button), gtk_bin_layout_new ());
 }
 
 


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