video: Use a bin layout
authorTimm Bäder <mail@baedert.org>
Sat, 21 Sep 2019 12:27:43 +0000 (14:27 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 25 Sep 2019 15:51:51 +0000 (17:51 +0200)
gtk/gtkvideo.c

index 3813d4e80cf7ced3baf0ae44336a98678118465c..1ae48bcddcdc19859a600931e1c1ed988980be7a 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "gtkvideo.h"
 
+#include "gtkbinlayout.h"
 #include "gtkeventcontrollermotion.h"
 #include "gtkimage.h"
 #include "gtkintl.h"
@@ -101,39 +102,6 @@ gtk_video_motion (GtkEventControllerMotion *motion,
                                               self);
 }
 
-static void
-gtk_video_measure (GtkWidget      *widget,
-                   GtkOrientation  orientation,
-                   int             for_size,
-                   int            *minimum,
-                   int            *natural,
-                   int            *minimum_baseline,
-                   int            *natural_baseline)
-{
-  GtkVideo *self = GTK_VIDEO (widget);
-
-  gtk_widget_measure (self->box,
-                      orientation,
-                      for_size,
-                      minimum, natural,
-                      minimum_baseline, natural_baseline);
-}
-
-static void
-gtk_video_size_allocate (GtkWidget *widget,
-                         int        width,
-                         int        height,
-                         int        baseline)
-{
-  GtkVideo *self = GTK_VIDEO (widget);
-
-  gtk_widget_size_allocate (self->box,
-                            &(GtkAllocation) {
-                              0, 0,
-                              width, height
-                            }, baseline);
-}
-
 static void
 gtk_video_realize (GtkWidget *widget)
 {
@@ -280,8 +248,6 @@ gtk_video_class_init (GtkVideoClass *klass)
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  widget_class->measure = gtk_video_measure;
-  widget_class->size_allocate = gtk_video_size_allocate;
   widget_class->realize = gtk_video_realize;
   widget_class->unrealize = gtk_video_unrealize;
   widget_class->map = gtk_video_map;
@@ -349,6 +315,7 @@ gtk_video_class_init (GtkVideoClass *klass)
   gtk_widget_class_bind_template_child (widget_class, GtkVideo, controls_revealer);
   gtk_widget_class_bind_template_callback (widget_class, gtk_video_motion);
 
+  gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
   gtk_widget_class_set_css_name (widget_class, I_("video"));
 }