[gtk+/treeview-refactor] Do not enforce a minimum of expander_size in gtk_tree_view_get_row_height
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/treeview-refactor] Do not enforce a minimum of expander_size in gtk_tree_view_get_row_height
- Date: Sun, 12 Dec 2010 14:23:51 +0000 (UTC)
commit d142d8bb6c80e2aeffd15c15229050ff96df10ef
Author: Kristian Rietveld <kris gtk org>
Date: Sun Dec 12 14:34:26 2010 +0100
Do not enforce a minimum of expander_size in gtk_tree_view_get_row_height
Instead this is now enforced in gtk_tree_view_get_cell_area_height().
There are rows for which a height in between 0 and expander_size is
allowed, for example separator rows.
gtk/gtktreeview.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 04055d5..995c55e 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -13513,13 +13513,21 @@ gtk_tree_view_get_cell_area_height (GtkTreeView *tree_view,
GtkRBNode *node,
gint vertical_separator)
{
+ int height;
+
/* The "cell" areas are the cell_area passed in to gtk_cell_renderer_render(),
* i.e. just the cells, no spacing.
*
- * The cell area height is at least expander_size - vertical_separator;
+ * The cell area height is at least expander_size - vertical_separator.
+ * For regular nodes, the height is then at least expander_size. We should
+ * be able to enforce the expander_size minimum here, because this
+ * function will not be called for irregular (e.g. separator) rows.
*/
+ height = gtk_tree_view_get_row_height (tree_view, node);
+ if (height < tree_view->priv->expander_size)
+ height = tree_view->priv->expander_size;
- return gtk_tree_view_get_row_height (tree_view, node) - vertical_separator;
+ return height - vertical_separator;
}
static inline gint
@@ -13634,10 +13642,13 @@ gtk_tree_view_get_row_height (GtkTreeView *tree_view,
/* The "background" areas of all rows/cells add up to cover the entire tree.
* The background includes all inter-row and inter-cell spacing.
*
- * The height of a row is at least "expander_size".
+ * If the row pointed at by node does not have a height set, we default
+ * to expander_size, which is the minimum height for regular nodes.
+ * Non-regular nodes (e.g. separators) can have a height set smaller
+ * than expander_size and should not be overruled here.
*/
height = GTK_RBNODE_GET_HEIGHT (node);
- if (height < tree_view->priv->expander_size)
+ if (height <= 0)
height = tree_view->priv->expander_size;
return height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]