[gtk+/wip/otte/gtk4: 82/118] range: Remove min slider size setter/getter



commit 5423c66c80a2de3ffdb252b0761ee44812e6cb44
Author: Timm Bäder <mail baedert org>
Date:   Tue Oct 4 16:50:28 2016 +0200

    range: Remove min slider size setter/getter

 gtk/gtkrange.c        |   80 +-----------------------------------------------
 gtk/gtkrange.h        |    6 ----
 gtk/gtkrangeprivate.h |    2 -
 gtk/gtkscale.c        |    1 -
 gtk/gtkscrollbar.c    |    1 -
 5 files changed, 2 insertions(+), 88 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 282110f..acd42f7 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -109,7 +109,6 @@ struct _GtkRangePrivate
   gdouble *marks;
 
   gint *mark_pos;
-  gint  min_slider_size;
   gint  n_marks;
   gint  round_digits;                /* Round off value to this many digits, -1 for no rounding */
   gint  slide_initial_slider_position;
@@ -118,7 +117,6 @@ struct _GtkRangePrivate
   guint flippable              : 1;
   guint inverted               : 1;
   guint slider_size_fixed      : 1;
-  guint slider_use_min_size    : 1;
   guint trough_click_forward   : 1;  /* trough click was on the forward side of slider */
 
   /* Stepper sensitivity */
@@ -784,7 +782,6 @@ gtk_range_init (GtkRange *range)
   priv->adjustment = NULL;
   priv->inverted = FALSE;
   priv->flippable = FALSE;
-  priv->min_slider_size = 1;
   priv->round_digits = -1;
   priv->mouse_x = G_MININT;
   priv->mouse_y = G_MININT;
@@ -1146,19 +1143,6 @@ gtk_range_get_flippable (GtkRange *range)
   return range->priv->flippable;
 }
 
-void
-gtk_range_set_slider_use_min_size (GtkRange *range,
-                                   gboolean  use_min_size)
-{
-  GtkRangePrivate *priv = range->priv;
-
-  if (use_min_size != priv->slider_use_min_size)
-    {
-      priv->slider_use_min_size = use_min_size;
-      gtk_css_gadget_queue_resize (priv->slider_gadget);
-    }
-}
-
 /**
  * gtk_range_set_slider_size_fixed:
  * @range: a #GtkRange
@@ -1210,62 +1194,6 @@ gtk_range_get_slider_size_fixed (GtkRange *range)
   return range->priv->slider_size_fixed;
 }
 
-/**
- * gtk_range_set_min_slider_size:
- * @range: a #GtkRange
- * @min_size: The slider’s minimum size
- *
- * Sets the minimum size of the range’s slider.
- *
- * This function is useful mainly for #GtkRange subclasses.
- *
- * Since: 2.20
- *
- * Deprecated: 3.20: Use the min-height/min-width CSS properties on the slider
- *   node.
- **/
-void
-gtk_range_set_min_slider_size (GtkRange *range,
-                               gint      min_size)
-{
-  GtkRangePrivate *priv;
-
-  g_return_if_fail (GTK_IS_RANGE (range));
-  g_return_if_fail (min_size > 0);
-
-  priv = range->priv;
-
-  if (min_size != priv->min_slider_size)
-    {
-      priv->min_slider_size = min_size;
-
-      gtk_widget_queue_resize (GTK_WIDGET (range));
-    }
-}
-
-/**
- * gtk_range_get_min_slider_size:
- * @range: a #GtkRange
- *
- * This function is useful mainly for #GtkRange subclasses.
- *
- * See gtk_range_set_min_slider_size().
- *
- * Returns: The minimum size of the range’s slider.
- *
- * Since: 2.20
- *
- * Deprecated: 3.20: Use the min-height/min-width CSS properties on the slider
- *   node.
- **/
-gint
-gtk_range_get_min_slider_size (GtkRange *range)
-{
-  g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
-
-  return range->priv->min_slider_size;
-}
-
 static void
 measure_one_gadget (GtkCssGadget *gadget,
                     int          *width_out,
@@ -3512,8 +3440,6 @@ gtk_range_compute_slider_position (GtkRange     *range,
   measure_one_gadget (priv->slider_gadget, &slider_width, &slider_height);
   gtk_css_gadget_get_content_box (priv->trough_gadget, &trough_content_alloc);
 
-  min_slider_size = priv->min_slider_size;
-
   if (priv->orientation == GTK_ORIENTATION_VERTICAL)
     {
       gint y, bottom, top, height;
@@ -3524,8 +3450,7 @@ gtk_range_compute_slider_position (GtkRange     *range,
       slider_rect->x = trough_content_alloc.x + (int) floor ((trough_content_alloc.width - slider_width) / 
2);
       slider_rect->width = slider_width;
 
-      if (priv->slider_use_min_size)
-        min_slider_size = slider_height;
+      min_slider_size = slider_height;
 
       /* Compute slider position/length */
       top = trough_content_alloc.y;
@@ -3578,8 +3503,7 @@ gtk_range_compute_slider_position (GtkRange     *range,
       slider_rect->y = trough_content_alloc.y + (int) floor ((trough_content_alloc.height - slider_height) / 
2);
       slider_rect->height = slider_height;
 
-      if (priv->slider_use_min_size)
-        min_slider_size = slider_width;
+      min_slider_size = slider_width;
 
       /* Compute slider position/length */
       left = trough_content_alloc.x;
diff --git a/gtk/gtkrange.h b/gtk/gtkrange.h
index e78b3b5..161757d 100644
--- a/gtk/gtkrange.h
+++ b/gtk/gtkrange.h
@@ -117,12 +117,6 @@ void               gtk_range_set_slider_size_fixed         (GtkRange      *range
 GDK_AVAILABLE_IN_ALL
 gboolean           gtk_range_get_slider_size_fixed         (GtkRange      *range);
 
-GDK_DEPRECATED_IN_3_20
-void               gtk_range_set_min_slider_size           (GtkRange      *range,
-                                                            gint           min_size);
-GDK_DEPRECATED_IN_3_20
-gint               gtk_range_get_min_slider_size           (GtkRange      *range);
-
 GDK_AVAILABLE_IN_ALL
 void               gtk_range_get_range_rect                (GtkRange      *range,
                                                             GdkRectangle  *range_rect);
diff --git a/gtk/gtkrangeprivate.h b/gtk/gtkrangeprivate.h
index 1362845..98456a6 100644
--- a/gtk/gtkrangeprivate.h
+++ b/gtk/gtkrangeprivate.h
@@ -49,8 +49,6 @@ void               _gtk_range_set_steppers                 (GtkRange      *range
                                                             gboolean       has_c,
                                                             gboolean       has_d);
 
-void               gtk_range_set_slider_use_min_size       (GtkRange      *range,
-                                                            gboolean       use_min_size);
 GtkCssGadget      *gtk_range_get_slider_gadget             (GtkRange *range);
 GtkCssGadget      *gtk_range_get_gadget                    (GtkRange *range);
 
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 6ae1844..f14a29a 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -960,7 +960,6 @@ gtk_scale_init (GtkScale *scale)
   gtk_widget_set_can_focus (GTK_WIDGET (scale), TRUE);
 
   gtk_range_set_slider_size_fixed (range, TRUE);
-  gtk_range_set_slider_use_min_size (range, TRUE);
 
   _gtk_range_set_has_origin (range, TRUE);
 
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index 607a1a0..8af00d0 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -157,7 +157,6 @@ static void
 gtk_scrollbar_init (GtkScrollbar *scrollbar)
 {
   gtk_scrollbar_update_style (scrollbar);
-  gtk_range_set_slider_use_min_size (GTK_RANGE (scrollbar), TRUE);
 }
 
 static void


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