[empathy] Define a style class for the tab close button



commit 92114b41642489ed58079ba0fe0cbb456f5e6e38
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri May 25 09:32:32 2012 +0200

    Define a style class for the tab close button
    
    Seems that's the proper way to do it.

 data/empathy.css          |    2 +-
 src/empathy-chat-window.c |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/data/empathy.css b/data/empathy.css
index d0c1368..6288002 100644
--- a/data/empathy.css
+++ b/data/empathy.css
@@ -1,4 +1,4 @@
-#empathy-tab-close-button {
+.empathy-tab-close-button {
   -GtkButton-default-border : 0;
   -GtkButton-default-outside-border : 0;
   -GtkButton-inner-border: 0;
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 990640e..f9c1d20 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -415,10 +415,12 @@ static GtkWidget *
 create_close_button (void)
 {
 	GtkWidget *button, *image;
+	GtkStyleContext *context;
 
 	button = gtk_button_new ();
 
-	gtk_widget_set_name (button, "empathy-tab-close-button");
+	context = gtk_widget_get_style_context (button);
+	gtk_style_context_add_class (context, "empathy-tab-close-button");
 
 	gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
 	gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);



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