[gaim-migrate @ 11714]

Wed, 29 Dec 2004 23:42:54 +0000

author
Nathan Fredrickson <nathan@silverorange.com>
date
Wed, 29 Dec 2004 23:42:54 +0000
changeset 10449
4174c2957405
parent 10448
4415ffba12e9
child 10450
1757208151dc

[gaim-migrate @ 11714]
sf patch #1045370, from Nathan Fredrickson
Make the X on conversation tabs not get cut off with gtk 2.4.2 and newer

committer: Mark Doliner <markdoliner@pidgin.im>

src/gtkconv.c file | annotate | diff | comparison | revisions
--- a/src/gtkconv.c	Wed Dec 29 22:48:59 2004 +0000
+++ b/src/gtkconv.c	Wed Dec 29 23:42:54 2004 +0000
@@ -4268,6 +4268,7 @@
 	gboolean new_ui;
 	GaimConversationType conv_type;
 	const char *name;
+	gint close_button_width, close_button_height, focus_width, focus_pad;
 
 	name      = gaim_conversation_get_name(conv);
 	conv_type = gaim_conversation_get_type(conv);
@@ -4364,7 +4365,20 @@
 
 	/* Close button. */
 	gtkconv->close = gtk_button_new();
-	gtk_widget_set_size_request(GTK_WIDGET(gtkconv->close), 16, 16);
+	gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &close_button_width, &close_button_height);
+	if (gtk_check_version(2, 4, 2) == NULL)
+	{
+		/* Need to account for extra padding around the gtkbutton */
+		gtk_widget_style_get(GTK_WIDGET(gtkconv->close),
+							 "focus-line-width", &focus_width,
+							 "focus-padding", &focus_pad,
+							 NULL);
+		close_button_width += (focus_width + focus_pad) * 2;
+		close_button_height += (focus_width + focus_pad) * 2;
+	}
+	gtk_widget_set_size_request(GTK_WIDGET(gtkconv->close),
+								close_button_width, close_button_height);
+
 	gtk_button_set_relief(GTK_BUTTON(gtkconv->close), GTK_RELIEF_NONE);
 	close_image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
 	gtk_widget_show(close_image);

mercurial