summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2019-04-08 17:38:04 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2019-04-08 17:44:55 +0100
commiteed5b6bdde7a4485699cceca5fe8f64d5ae349cc (patch)
tree34d91c3a93adff7f3ef05b3b4b35f77456ae6e7c
parent1a8c8b7878d68b6f29fa61289bd54558f3074fce (diff)
downloadgtk+-eed5b6bdde7a4485699cceca5fe8f64d5ae349cc.tar.gz
Port GtkFileChooserButton to GtkBinLayout
-rw-r--r--gtk/gtkfilechooserbutton.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index f7d4e3d49a..afe2aea507 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -30,6 +30,7 @@
#include <cairo-gobject.h>
#include "gtkintl.h"
+#include "gtkbinlayout.h"
#include "gtkbutton.h"
#include "gtkcelllayout.h"
#include "gtkcellrenderertext.h"
@@ -340,41 +341,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)
{
@@ -398,8 +364,6 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
widget_class->display_changed = gtk_file_chooser_button_display_changed;
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:
@@ -471,6 +435,8 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button)
gtk_widget_set_has_surface (GTK_WIDGET (button), FALSE);
+ gtk_widget_set_layout_manager (GTK_WIDGET (button), gtk_bin_layout_new ());
+
priv->button = gtk_button_new ();
g_signal_connect (priv->button, "clicked", G_CALLBACK (button_clicked_cb), button);
priv->image = gtk_image_new ();