[gtk+/wip/baedert/drawing: 1/30] button: Remove baseline_align value



commit fba1f8af548f10162fc8357b45b6ee77e9bc2b93
Author: Timm Bäder <mail baedert org>
Date:   Tue May 2 19:11:53 2017 +0200

    button: Remove baseline_align value
    
    It's unused.

 gtk/gtkbuttonprivate.h |    3 ---
 gtk/gtkcheckbutton.c   |   11 -----------
 gtk/gtkmodelbutton.c   |   12 ------------
 3 files changed, 0 insertions(+), 26 deletions(-)
---
diff --git a/gtk/gtkbuttonprivate.h b/gtk/gtkbuttonprivate.h
index a9e93e0..075f855 100644
--- a/gtk/gtkbuttonprivate.h
+++ b/gtk/gtkbuttonprivate.h
@@ -36,9 +36,6 @@ struct _GtkButtonPrivate
 
   GtkGesture            *gesture;
 
-  /* This is only used by checkbox and subclasses */
-  gfloat                 baseline_align;
-
   guint                  activate_timeout;
 
   guint          button_down           : 1;
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index 66f597b..c0fd793 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -415,8 +415,6 @@ gtk_check_button_size_allocate (GtkWidget     *widget,
   GtkButton *button = GTK_BUTTON (widget);
   GtkCssGadget *gadget;
   GdkRectangle clip;
-  PangoContext *pango_context;
-  PangoFontMetrics *metrics;
 
   if (priv->draw_indicator)
     gadget = priv->gadget;
@@ -431,15 +429,6 @@ gtk_check_button_size_allocate (GtkWidget     *widget,
 
   gtk_widget_set_clip (widget, &clip);
 
-  pango_context = gtk_widget_get_pango_context (widget);
-  metrics = pango_context_get_metrics (pango_context,
-                                       pango_context_get_font_description (pango_context),
-                                       pango_context_get_language (pango_context));
-  button->priv->baseline_align =
-      (double)pango_font_metrics_get_ascent (metrics) /
-      (pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
-  pango_font_metrics_unref (metrics);
-
   if (gtk_widget_get_realized (widget))
     {
       GtkAllocation border_allocation;
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index baa568a..7c84725 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -807,8 +807,6 @@ gtk_model_button_allocate (GtkCssGadget        *gadget,
 {
   GtkWidget *widget;
   GtkModelButton *button;
-  PangoContext *pango_context;
-  PangoFontMetrics *metrics;
   GtkAllocation child_allocation;
   GtkWidget *child;
   gint check_min_width, check_nat_width;
@@ -874,16 +872,6 @@ gtk_model_button_allocate (GtkCssGadget        *gadget,
       gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline);
     }
 
-  pango_context = gtk_widget_get_pango_context (widget);
-  metrics = pango_context_get_metrics (pango_context,
-                                       pango_context_get_font_description (pango_context),
-                                       pango_context_get_language (pango_context));
-  GTK_BUTTON (button)->priv->baseline_align =
-    (double)pango_font_metrics_get_ascent (metrics) /
-    (pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
-  pango_font_metrics_unref (metrics);
-
-
   if (gtk_widget_get_realized (widget))
     {
       GtkAllocation border_allocation;


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