[gtk+/wip/baedert/drawing] scale: Remove custom indicator drawing



commit b0c00a7a86caf7dc735e78e42b75799c99432949
Author: Timm Bäder <mail baedert org>
Date:   Fri Jun 30 13:08:00 2017 +0200

    scale: Remove custom indicator drawing
    
    it's a css node so we can simply use the background instead of the
    foreground color in the theme.

 gtk/gtkscale.c |   35 +----------------------------------
 1 files changed, 1 insertions(+), 34 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 4ee9411..ecdcf9a 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1596,39 +1596,6 @@ gtk_scale_measure (GtkWidget      *widget,
     }
 }
 
-static gboolean
-gtk_scale_render_mark_indicator (GtkGizmo    *gizmo,
-                                 GtkSnapshot *snapshot)
-{
-  GtkWidget *widget = GTK_WIDGET (gizmo);
-  GtkScale *scale = GTK_SCALE (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent 
(widget))));
-  GtkStyleContext *context;
-  GtkOrientation orientation;
-  GdkRGBA color;
-  GtkAllocation allocation;
-
-  gtk_widget_get_content_allocation (widget, &allocation);
-
-  orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (scale));
-  context = gtk_widget_get_style_context (widget);
-
-  gtk_style_context_get_color (context, &color);
-  if (orientation == GTK_ORIENTATION_HORIZONTAL)
-    gtk_snapshot_append_color (snapshot,
-                               &color,
-                               &GRAPHENE_RECT_INIT(allocation.width / 2,
-                                                   0, 1, allocation.height),
-                               "ScaleMark");
-  else
-    gtk_snapshot_append_color (snapshot,
-                               &color,
-                               &GRAPHENE_RECT_INIT(0, allocation.height / 2,
-                                                   allocation.width, 1),
-                               "ScaleMark");
-
-  return FALSE;
-}
-
 static void
 gtk_scale_snapshot (GtkWidget   *widget,
                     GtkSnapshot *snapshot)
@@ -1942,7 +1909,7 @@ gtk_scale_add_mark (GtkScale        *scale,
   mark->indicator_widget = gtk_gizmo_new ("indicator",
                                           NULL,
                                           NULL,
-                                          gtk_scale_render_mark_indicator);
+                                          NULL);
   gtk_widget_set_parent (mark->indicator_widget, mark->widget);
   if (mark->markup && *mark->markup)
     {


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