[gtk+] spinbutton: Convert to indirect rendering



commit f483d931ecec9e6b91cd74c864775b7c67a25d08
Author: Timm Bäder <mail baedert org>
Date:   Sat Nov 5 09:51:14 2016 +0100

    spinbutton: Convert to indirect rendering

 gtk/gtkspinbutton.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 9f0444f..0965cbb 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -262,8 +262,6 @@ static void gtk_spin_button_measure (GtkWidget      *widget,
                                      int            *natural_baseline);
 static void gtk_spin_button_size_allocate  (GtkWidget          *widget,
                                             GtkAllocation      *allocation);
-static gint gtk_spin_button_draw           (GtkWidget          *widget,
-                                            cairo_t            *cr);
 static gint gtk_spin_button_button_press   (GtkWidget          *widget,
                                             GdkEventButton     *event);
 static gint gtk_spin_button_button_release (GtkWidget          *widget,
@@ -323,6 +321,15 @@ G_DEFINE_TYPE_WITH_CODE (GtkSpinButton, gtk_spin_button, GTK_TYPE_ENTRY,
                                 "change-value", 1,                     \
                                 GTK_TYPE_SCROLL_TYPE, scroll)
 
+static GskRenderNode *
+gtk_spin_button_get_render_node (GtkWidget *widget, GskRenderer *renderer)
+{
+  GtkSpinButtonPrivate *priv = GTK_SPIN_BUTTON (widget)->priv;
+  GskRenderNode *node = gtk_css_gadget_get_render_node (priv->gadget, renderer, FALSE);
+
+  return node;
+}
+
 static void
 gtk_spin_button_class_init (GtkSpinButtonClass *class)
 {
@@ -342,7 +349,6 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
   widget_class->unrealize = gtk_spin_button_unrealize;
   widget_class->measure = gtk_spin_button_measure;
   widget_class->size_allocate = gtk_spin_button_size_allocate;
-  widget_class->draw = gtk_spin_button_draw;
   widget_class->scroll_event = gtk_spin_button_scroll;
   widget_class->button_press_event = gtk_spin_button_button_press;
   widget_class->button_release_event = gtk_spin_button_button_release;
@@ -354,6 +360,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
   widget_class->grab_notify = gtk_spin_button_grab_notify;
   widget_class->state_flags_changed = gtk_spin_button_state_flags_changed;
   widget_class->direction_changed = gtk_spin_button_direction_changed;
+  widget_class->get_render_node = gtk_spin_button_get_render_node;
 
   entry_class->activate = gtk_spin_button_activate;
 
@@ -1183,15 +1190,6 @@ gtk_spin_button_size_allocate (GtkWidget     *widget,
 }
 
 static gint
-gtk_spin_button_draw (GtkWidget *widget,
-                      cairo_t   *cr)
-{
-  gtk_css_gadget_draw (GTK_SPIN_BUTTON(widget)->priv->gadget, cr);
-
-  return GDK_EVENT_PROPAGATE;
-}
-
-static gint
 gtk_spin_button_enter_notify (GtkWidget        *widget,
                               GdkEventCrossing *event)
 {


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