[gtk+] treeview: Pass height to allocate as argument
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] treeview: Pass height to allocate as argument
- Date: Mon, 13 Nov 2017 02:54:37 +0000 (UTC)
commit f31a51a1c83d091f8a891e2d89d3177070729819
Author: Benjamin Otte <otte redhat com>
Date: Mon Nov 13 01:23:16 2017 +0100
treeview: Pass height to allocate as argument
Instead of exporting a function to query it.
gtk/gtktreeprivate.h | 4 ++--
gtk/gtktreeview.c | 16 +++++-----------
gtk/gtktreeviewcolumn.c | 5 +++--
3 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtktreeprivate.h b/gtk/gtktreeprivate.h
index bac7d80..0fc888e 100644
--- a/gtk/gtktreeprivate.h
+++ b/gtk/gtktreeprivate.h
@@ -69,7 +69,6 @@ void _gtk_tree_view_install_mark_rows_col_dirty (GtkTreeView *tree_view,
gboolean install_handler);
void _gtk_tree_view_column_autosize (GtkTreeView *tree_view,
GtkTreeViewColumn *column);
-gint _gtk_tree_view_get_header_height (GtkTreeView *tree_view);
void _gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view,
GtkTreeViewRowSeparatorFunc *func,
@@ -99,7 +98,8 @@ void _gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
gint _gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column);
void _gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
int x_offset,
- int width);
+ int width,
+ int height);
void _gtk_tree_view_column_unset_model (GtkTreeViewColumn *column,
GtkTreeModel *old_model);
void _gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index d8e78bb..7f8f3e5 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2509,9 +2509,9 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget)
column_width += extra_for_last;
if (rtl)
- _gtk_tree_view_column_allocate (column, widget_width - width - column_width, column_width);
+ _gtk_tree_view_column_allocate (column, widget_width - width - column_width, column_width,
tree_view->priv->header_height);
else
- _gtk_tree_view_column_allocate (column, width, column_width);
+ _gtk_tree_view_column_allocate (column, width, column_width, tree_view->priv->header_height);
width += column_width;
}
@@ -9723,14 +9723,8 @@ gtk_tree_view_get_effective_header_height (GtkTreeView *tree_view)
{
if (tree_view->priv->headers_visible)
return tree_view->priv->header_height;
- /* else */
- return 0;
-}
-
-gint
-_gtk_tree_view_get_header_height (GtkTreeView *tree_view)
-{
- return tree_view->priv->header_height;
+ else
+ return 0;
}
void
@@ -15769,7 +15763,7 @@ static gboolean
gtk_tree_view_get_border (GtkScrollable *scrollable,
GtkBorder *border)
{
- border->top = _gtk_tree_view_get_header_height (GTK_TREE_VIEW (scrollable));
+ border->top = gtk_tree_view_get_effective_header_height (GTK_TREE_VIEW (scrollable));
return TRUE;
}
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 34a6032..872e8df 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -2013,7 +2013,8 @@ _gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column)
void
_gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
int x_offset,
- int width)
+ int width,
+ int height)
{
GtkTreeViewColumnPrivate *priv;
GtkAllocation allocation = { 0, 0, 0, 0 };
@@ -2039,7 +2040,7 @@ _gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
allocation.x = x_offset;
allocation.y = 0;
allocation.width = width;
- allocation.height = _gtk_tree_view_get_header_height (GTK_TREE_VIEW (priv->tree_view));
+ allocation.height = height;
gtk_widget_size_allocate (priv->button, &allocation, -1, &clip);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]