diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-12-20 13:24:12 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-12-20 13:31:08 -0500 |
commit | 18d439ee40d77cea07875b6dfff3cfe40b91e5a0 (patch) | |
tree | a6f0f59c6e9c61320dcf03bad25626425e38c962 /gtk | |
parent | f200eebfd65886a535898aab0fd2a34661925680 (diff) | |
download | gtk+-18d439ee40d77cea07875b6dfff3cfe40b91e5a0.tar.gz |
Allow close buttons on dialogs
It was a long-standing problem for some users of GtkDialog that
there is no guaranted way to close it. So, lets show a close
button.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkheaderbar.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index 3b49cb0033..1d8dac68b3 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -356,7 +356,8 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) GtkWidget *image = NULL; AtkObject *accessible; - if (strcmp (t[j], "icon") == 0) + if (strcmp (t[j], "icon") == 0 && + gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL) { button = gtk_image_new (); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); @@ -371,7 +372,9 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) button = NULL; } } - else if (strcmp (t[j], "menu") == 0 && menu != NULL) + else if (strcmp (t[j], "menu") == 0 && + menu != NULL && + gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL) { button = gtk_menu_button_new (); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); @@ -431,8 +434,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) priv->titlebar_max_button = button; } else if (strcmp (t[j], "close") == 0 && - gtk_window_get_deletable (window) && - gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL) + gtk_window_get_deletable (window)) { button = gtk_button_new (); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); |