changeset 29617:7ed0ddbdd2a8

Use an inline RC style to get rid of some other padding to make the small buttons even smaller, as suggested by Paradox on trac, and nicked from nautilus. Refs #8727.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 20 Mar 2010 06:22:53 +0000
parents 0d613fa75e5f
children 986a73d7ddd0
files pidgin/gtkutils.c
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkutils.c	Sat Mar 20 06:17:13 2010 +0000
+++ b/pidgin/gtkutils.c	Sat Mar 20 06:22:53 2010 +0000
@@ -156,7 +156,6 @@
 pidgin_create_small_button(GtkWidget *image)
 {
 	GtkWidget *button;
-	GtkRcStyle *rcstyle;
 
 	button = gtk_button_new();
 	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
@@ -164,11 +163,8 @@
 	/* don't allow focus on the close button */
 	gtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
 
-	/* make it as small as possible */
-	rcstyle = gtk_rc_style_new();
-	rcstyle->xthickness = rcstyle->ythickness = 0;
-	gtk_widget_modify_style(button, rcstyle);
-	gtk_rc_style_unref(rcstyle);
+	/* set style to make it as small as possible */
+	gtk_widget_set_name(button, "pidgin-small-close-button");
 
 	gtk_widget_show(image);
 
@@ -3473,6 +3469,16 @@
 	if (purple_running_gnome())
 		register_gnome_url_handlers();
 
+	/* Used to make small buttons */
+	gtk_rc_parse_string("style \"pidgin-small-close-button\"\n"
+	                    "{\n"
+	                    "GtkWidget::focus-padding = 0\n"
+	                    "GtkWidget::focus-line-width = 0\n"
+	                    "xthickness = 0\n"
+	                    "ythickness = 0\n"
+	                    "}\n"
+	                    "widget \"*.pidgin-small-close-button\" style \"pidgin-small-close-button\"");
+
 #ifdef _WIN32
 	winpidgin_register_win32_url_handlers();
 #endif