diff pidgin/gtkutils.c @ 31155:2bdbf3fbd894

propagate from branch 'im.pidgin.pidgin' (head 25f95fb2f47b70980b79422c9a02be98eed376f7) to branch 'im.pidgin.cpw.qulogic.msnp16' (head 2047e8ca11ef3f4bd140cd8ab1bb4067eb531716)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 26 Mar 2010 00:43:51 +0000
parents 7ed0ddbdd2a8
children f988f25259c7 cfa57a2cd9d1
line wrap: on
line diff
--- a/pidgin/gtkutils.c	Sat Mar 13 08:18:25 2010 +0000
+++ b/pidgin/gtkutils.c	Fri Mar 26 00:43:51 2010 +0000
@@ -153,6 +153,27 @@
 }
 
 GtkWidget *
+pidgin_create_small_button(GtkWidget *image)
+{
+	GtkWidget *button;
+
+	button = gtk_button_new();
+	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
+
+	/* don't allow focus on the close button */
+	gtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
+
+	/* set style to make it as small as possible */
+	gtk_widget_set_name(button, "pidgin-small-close-button");
+
+	gtk_widget_show(image);
+
+	gtk_container_add(GTK_CONTAINER(button), image);
+
+	return button;
+}
+
+GtkWidget *
 pidgin_create_dialog(const char *title, guint border_width, const char *role, gboolean resizable)
 {
 	GtkWindow *wnd = NULL;
@@ -3448,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