[libgd/wip/ernestask/gtk4: 11/16] notification: remove draw vfunc override



commit fd42a42de319489510bf4054b4f3d98ffe764261
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sun Mar 11 09:48:19 2018 +0200

    notification: remove draw vfunc override
    
    The applied style classes look identical and don’t suffer from bugs when
    using gtk_snapshot_render_background().

 libgd/gd-notification.c |   31 -------------------------------
 1 files changed, 0 insertions(+), 31 deletions(-)
---
diff --git a/libgd/gd-notification.c b/libgd/gd-notification.c
index a93b321..30232e4 100644
--- a/libgd/gd-notification.c
+++ b/libgd/gd-notification.c
@@ -74,8 +74,6 @@ enum {
 
 static guint notification_signals[LAST_SIGNAL] = { 0 };
 
-static gboolean gd_notification_draw                           (GtkWidget       *widget,
-                                                                 cairo_t         *cr);
 static void     gd_notification_get_preferred_width            (GtkWidget       *widget,
                                                                  gint            *minimum_size,
                                                                  gint            *natural_size);
@@ -489,7 +487,6 @@ gd_notification_class_init (GdNotificationClass *klass)
   widget_class->get_preferred_height = gd_notification_get_preferred_height;
   widget_class->get_preferred_width_for_height = gd_notification_get_preferred_width_for_height;
   widget_class->size_allocate = gd_notification_size_allocate;
-  widget_class->draw = gd_notification_draw;
   widget_class->realize = gd_notification_realize;
   widget_class->unrealize = gd_notification_unrealize;
   widget_class->visibility_notify_event = gd_notification_visibility_notify_event;
@@ -551,34 +548,6 @@ get_padding_and_border (GdNotification *notification,
   border->left += tmp.left;
 }
 
-static gboolean
-gd_notification_draw (GtkWidget *widget, cairo_t *cr)
-{
-  GdNotification *notification = GD_NOTIFICATION (widget);
-  GdNotificationPrivate *priv = notification->priv;
-  GtkStyleContext *context;
-
-  if (gtk_cairo_should_draw_window (cr, priv->bin_window))
-    {
-      context = gtk_widget_get_style_context (widget);
-
-      gtk_render_background (context,  cr,
-                             0, 0,
-                             gtk_widget_get_allocated_width (widget),
-                             gtk_widget_get_allocated_height (widget));
-      gtk_render_frame (context,cr,
-                        0, 0,
-                        gtk_widget_get_allocated_width (widget),
-                        gtk_widget_get_allocated_height (widget));
-
-
-      if (GTK_WIDGET_CLASS (gd_notification_parent_class)->draw)
-        GTK_WIDGET_CLASS (gd_notification_parent_class)->draw(widget, cr);
-    }
-
-  return FALSE;
-}
-
 static void
 gd_notification_add (GtkContainer *container,
                       GtkWidget    *child)


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