]> git.0d.be Git - empathy.git/commitdiff
chat-window: stop using GeditCloseButton
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 24 May 2012 10:38:31 +0000 (12:38 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 24 May 2012 10:57:07 +0000 (12:57 +0200)
The CSS magic is done automatically now.

src/empathy-chat-window.c

index 10210915eb66093e16f4197d3cf8305d6c2ef382..990640ede40326db36a395d5fcc1034d3d12e443 100644 (file)
@@ -60,7 +60,6 @@
 #include "empathy-chat-window.h"
 #include "empathy-about-dialog.h"
 #include "empathy-invite-participant-dialog.h"
-#include "gedit-close-button.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CHAT
 #include <libempathy/empathy-debug.h>
@@ -412,6 +411,33 @@ chat_tab_style_updated_cb (GtkWidget *hbox,
        gtk_widget_set_size_request (button, w, h);
 }
 
+static GtkWidget *
+create_close_button (void)
+{
+       GtkWidget *button, *image;
+
+       button = gtk_button_new ();
+
+       gtk_widget_set_name (button, "empathy-tab-close-button");
+
+       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+       gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+
+       /* We don't want focus/keynav for the button to avoid clutter, and
+        * Ctrl-W works anyway.
+        */
+       gtk_widget_set_can_focus (button, FALSE);
+       gtk_widget_set_can_default (button, FALSE);
+
+       image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
+                                         GTK_ICON_SIZE_MENU);
+       gtk_widget_show (image);
+
+       gtk_container_add (GTK_CONTAINER (button), image);
+
+       return button;
+}
+
 static GtkWidget *
 chat_window_create_label (EmpathyChatWindow *window,
                          EmpathyChat       *chat,
@@ -479,15 +505,9 @@ chat_window_create_label (EmpathyChatWindow *window,
                        "chat-window-tab-sending-spinner",
                        sending_spinner);
 
-               close_button = gedit_close_button_new ();
+               close_button = create_close_button ();
                g_object_set_data (G_OBJECT (chat), "chat-window-tab-close-button", close_button);
 
-               /* We don't want focus/keynav for the button to avoid clutter, and
-                * Ctrl-W works anyway.
-                */
-               gtk_widget_set_can_focus (close_button, FALSE);
-               gtk_widget_set_can_default (close_button, FALSE);
-
                gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
 
                g_signal_connect (close_button,