[gtk+] headerbar: use a more standard headerbar look for the close button



commit fb2bc06f50820a101824a5be7def0fdf0fce7ead
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Wed Aug 7 10:24:14 2013 +0200

    headerbar: use a more standard headerbar look for the close button
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705601

 gtk/gtkheaderbar.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 9aa55df..8cad9c8 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -222,12 +222,16 @@ add_close_button (GtkHeaderBar *bar)
   GIcon *icon;
   GtkWidget *image;
   GtkWidget *separator;
+  GtkStyleContext *context;
 
   priv = gtk_header_bar_get_instance_private (bar);
 
   button = gtk_button_new ();
+  gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
+  context = gtk_widget_get_style_context (button);
+  gtk_style_context_add_class (context, "image-button");
   icon = g_themed_icon_new ("window-close-symbolic");
-  image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON);
+  image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
   g_object_unref (icon);
   gtk_container_add (GTK_CONTAINER (button), image);
   gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]