[gtk+] Hide GtkTreeViewColumn buttons when header_window is not visible
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Hide GtkTreeViewColumn buttons when header_window is not visible
- Date: Thu, 23 Dec 2010 17:20:41 +0000 (UTC)
commit 31536736ea0fe25056689b9b7ccd914910281b37
Author: Kristian Rietveld <kris gtk org>
Date: Thu Dec 23 18:19:11 2010 +0100
Hide GtkTreeViewColumn buttons when header_window is not visible
gtk/gtktreeview.c | 5 +++++
gtk/gtktreeviewcolumn.c | 7 +++----
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index bce916a..e9f64e2 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -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);
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 0147a4a..43f5921 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -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));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]