[gtk/wip/matthiasc/popup5: 92/108] places sidebar: Allocate popovers



commit 553551c091530575b7ac2e86109e5b058f4588bb
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 4 18:44:51 2019 +0000

    places sidebar: Allocate popovers

 gtk/gtkplacessidebar.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index c71d5a43ca..8a6cdae7cd 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -64,6 +64,7 @@
 #include "gtkeventcontrollerkey.h"
 #include "gtkgesturemultipress.h"
 #include "gtkgesturedrag.h"
+#include "gtknative.h"
 
 /*< private >
  * SECTION:gtkplacessidebar
@@ -4420,6 +4421,20 @@ gtk_places_sidebar_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_places_sidebar_parent_class)->finalize (object);
 }
 
+static void
+gtk_places_sidebar_size_allocate (GtkWidget *widget,
+                                  int        width,
+                                  int        height,
+                                  int        baseline)
+{
+  GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (widget);
+
+  GTK_WIDGET_CLASS (gtk_places_sidebar_parent_class)->size_allocate (widget, width, height, baseline);
+
+  if (sidebar->rename_popover)
+    gtk_native_check_resize (GTK_NATIVE (sidebar->rename_popover));
+}
+
 static void
 gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class)
 {
@@ -4432,6 +4447,8 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class)
   gobject_class->set_property = gtk_places_sidebar_set_property;
   gobject_class->get_property = gtk_places_sidebar_get_property;
 
+  widget_class->size_allocate = gtk_places_sidebar_size_allocate;
+
   /*
    * GtkPlacesSidebar::open-location:
    * @sidebar: the object which received the signal.


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