Hide GtkTreeViewColumn buttons when header_window is not visible

This commit is contained in:
Kristian Rietveld 2010-12-23 18:19:11 +01:00
parent 26173c7864
commit 31536736ea
2 changed files with 8 additions and 4 deletions

View File

@ -2128,6 +2128,9 @@ gtk_tree_view_map_buttons (GtkTreeView *tree_view)
column = list->data;
button = gtk_tree_view_column_get_button (column);
if (gtk_tree_view_column_get_visible (column) && button)
gtk_widget_show_now (button);
if (gtk_widget_get_visible (button) &&
!gtk_widget_get_mapped (button))
gtk_widget_map (button);
@ -11631,6 +11634,8 @@ gtk_tree_view_set_headers_visible (GtkTreeView *tree_view,
{
column = list->data;
button = gtk_tree_view_column_get_button (column);
gtk_widget_hide (button);
gtk_widget_unmap (button);
}
gdk_window_hide (tree_view->priv->header_window);

View File

@ -987,7 +987,9 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
{
if (priv->visible)
{
gtk_widget_show_now (priv->button);
if (gdk_window_is_visible (_gtk_tree_view_get_header_window (GTK_TREE_VIEW (priv->tree_view))))
gtk_widget_show_now (priv->button);
if (priv->window)
{
if (priv->resizable)
@ -1327,9 +1329,6 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
g_return_if_fail (_gtk_tree_view_get_header_window (tree_view) != NULL);
gtk_widget_set_parent_window (priv->button, _gtk_tree_view_get_header_window (tree_view));
if (priv->visible)
gtk_widget_show (priv->button);
attr.window_type = GDK_WINDOW_CHILD;
attr.wclass = GDK_INPUT_ONLY;
attr.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));