[gtk+/wip/baedert/drawing: 107/128] range: Snapshot slider in trough's snapshot impl



commit 650e67beb99a68e68c31f4b20f8846bbda7fb447
Author: Timm Bäder <mail baedert org>
Date:   Mon May 8 13:37:12 2017 +0200

    range: Snapshot slider in trough's snapshot impl

 gtk/gtkrange.c |   29 ++---------------------------
 1 files changed, 2 insertions(+), 27 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 4b33553..19b7dea 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -171,8 +171,6 @@ static void gtk_range_realize        (GtkWidget        *widget);
 static void gtk_range_unrealize      (GtkWidget        *widget);
 static void gtk_range_map            (GtkWidget        *widget);
 static void gtk_range_unmap          (GtkWidget        *widget);
-static void gtk_range_snapshot       (GtkWidget        *widget,
-                                      GtkSnapshot      *snapshot);
 
 static void gtk_range_multipress_gesture_pressed  (GtkGestureMultiPress *gesture,
                                                    guint                 n_press,
@@ -292,7 +290,6 @@ gtk_range_class_init (GtkRangeClass *class)
   widget_class->unrealize = gtk_range_unrealize;
   widget_class->map = gtk_range_map;
   widget_class->unmap = gtk_range_unmap;
-  widget_class->snapshot = gtk_range_snapshot;
   widget_class->event = gtk_range_event;
   widget_class->scroll_event = gtk_range_scroll_event;
   widget_class->key_press_event = gtk_range_key_press;
@@ -1811,31 +1808,9 @@ gtk_range_render_trough (GtkGizmo    *gizmo,
   if (priv->has_origin)
     gtk_widget_snapshot_child (GTK_WIDGET (gizmo), priv->highlight_widget, snapshot);
 
-  return gtk_widget_has_visible_focus (widget);
-}
+  gtk_widget_snapshot_child (GTK_WIDGET (gizmo), priv->slider_widget, snapshot);
 
-static void
-gtk_range_snapshot (GtkWidget   *widget,
-                    GtkSnapshot *snapshot)
-{
-  GtkRange *range = GTK_RANGE (widget);
-  GtkRangePrivate *priv = range->priv;
-  GtkAllocation range_allocation;
-  GtkAllocation trough_allocation;
-  int x, y;
-
-  gtk_widget_snapshot_child (widget, priv->trough_widget, snapshot);
-
-  /* Draw the slider last, so that e.g. the focus ring stays below it */
-  gtk_widget_get_allocation (widget, &range_allocation);
-  gtk_widget_get_content_allocation (priv->trough_widget, &trough_allocation);
-
-  x = trough_allocation.x - range_allocation.x;
-  y = trough_allocation.y - range_allocation.y;
-
-  gtk_snapshot_offset (snapshot, x, y);
-  gtk_widget_snapshot_child (priv->trough_widget, priv->slider_widget, snapshot);
-  gtk_snapshot_offset (snapshot, -x, -y);
+  return gtk_widget_has_visible_focus (widget);
 }
 
 static void


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