[gnome-builder] tree: use vertical-separator to extract extra padding



commit a9287e81023d5db9aeca507890d1a175f3999f00
Author: Christian Hergert <christian hergert me>
Date:   Sun Jun 14 11:29:03 2015 -0700

    tree: use vertical-separator to extract extra padding
    
    The extra row padding comes from the GtkTreeView vertical-separator
    style property. Use this rather than hard code the value.

 src/tree/gb-tree.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/tree/gb-tree.c b/src/tree/gb-tree.c
index a8e0082..5d4dfa2 100644
--- a/src/tree/gb-tree.c
+++ b/src/tree/gb-tree.c
@@ -168,22 +168,19 @@ gb_tree_select (GbTree     *tree,
 static guint
 gb_tree_get_row_height (GbTree *tree)
 {
-  const guint extra_padding = 2;
+  GbTreePrivate *priv = gb_tree_get_instance_private (tree);
+  guint extra_padding;
   gint pix_min_height;
   gint pix_nat_height;
   gint text_min_height;
   gint text_nat_height;
-  GbTreePrivate *priv = gb_tree_get_instance_private (tree);
-
-  /*
-   * TODO:
-   *
-   * Determine where extra_padding comes from.
-   * Current thought is somewhere in styling.
-   */
 
   g_assert (GB_IS_TREE (tree));
 
+  gtk_widget_style_get (GTK_WIDGET (tree),
+                        "vertical-separator", &extra_padding,
+                        NULL);
+
   gtk_cell_renderer_get_preferred_height (priv->cell_pixbuf,
                                           GTK_WIDGET (tree),
                                           &pix_min_height,


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