[gtk+/client-side-decorations: 45/50] hide and show min/max buttons based on GdmWMDecorations value
- From: Cody Russell <bratsche src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+/client-side-decorations: 45/50] hide and show min/max buttons based on GdmWMDecorations value
- Date: Wed, 8 Jul 2009 15:31:56 +0000 (UTC)
commit c28fcab4ebb7832d77a8c193bc57621666bcc2a1
Author: Cody Russell <crussell canonical com>
Date: Sun Jul 5 23:26:27 2009 +0100
hide and show min/max buttons based on GdmWMDecorations value
gtk/gtkwindow.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 0bc2007..12aa066 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1482,6 +1482,36 @@ close_button_clicked (GtkWidget *widget, gpointer data)
}
static void
+update_window_buttons (GtkWindow *window)
+{
+ GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
+
+ if (is_client_side_decorated (window))
+ {
+ // XXX: should this be using GdkWMFunction instead?
+ if (priv->client_side_decorations & GDK_DECOR_MINIMIZE)
+ {
+ gtk_widget_show_all (priv->min_button);
+ }
+ else
+ {
+ gtk_widget_hide (priv->min_button);
+ }
+
+ if (priv->client_side_decorations & GDK_DECOR_MAXIMIZE)
+ {
+ gtk_widget_show_all (priv->max_button);
+ }
+ else
+ {
+ gtk_widget_hide (priv->max_button);
+ }
+
+ // close?
+ }
+}
+
+static void
ensure_title_box (GtkWindow *window)
{
GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
@@ -1528,6 +1558,8 @@ ensure_title_box (GtkWindow *window)
priv->button_box = hbox;
gtk_widget_show_all (priv->button_box);
+
+ update_window_buttons (window);
}
}
@@ -3219,6 +3251,8 @@ gtk_window_set_client_side_decorations (GtkWindow *window,
}
}
}
+
+ update_window_buttons (window);
}
GdkWMDecoration
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]