[gtk+] GtkTreeView: Don't short-circuit header-height calculation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkTreeView: Don't short-circuit header-height calculation
- Date: Fri, 10 Jun 2011 01:41:25 +0000 (UTC)
commit a081485269a94ddccbcb6ebeb9c79a94dc2ac253
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jun 9 21:40:08 2011 -0400
GtkTreeView: Don't short-circuit header-height calculation
The code was putting header_height at zero when there is
no model. That leads to temporary underallocation of header
buttons.
gtk/gtktreeview.c | 21 ++++++++-------------
1 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 969af40..60dee94 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2367,22 +2367,17 @@ gtk_tree_view_size_request_columns (GtkTreeView *tree_view)
tree_view->priv->header_height = 0;
- if (tree_view->priv->model)
+ for (list = tree_view->priv->columns; list; list = list->next)
{
- for (list = tree_view->priv->columns; list; list = list->next)
- {
- GtkRequisition requisition;
- GtkTreeViewColumn *column = list->data;
- GtkWidget *button = gtk_tree_view_column_get_button (column);
-
- if (button == NULL)
- continue;
+ GtkRequisition requisition;
+ GtkTreeViewColumn *column = list->data;
+ GtkWidget *button = gtk_tree_view_column_get_button (column);
- column = list->data;
+ if (button == NULL)
+ continue;
- gtk_widget_get_preferred_size (button, &requisition, NULL);
- tree_view->priv->header_height = MAX (tree_view->priv->header_height, requisition.height);
- }
+ gtk_widget_get_preferred_size (button, &requisition, NULL);
+ tree_view->priv->header_height = MAX (tree_view->priv->header_height, requisition.height);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]