im.pidgin.cpw.resiak.disconnectreason: 6aa1321a3bc75ae00914b5d94f966471f077e17a

resiak at soc.pidgin.im resiak at soc.pidgin.im
Mon Nov 5 04:41:01 EST 2007


-----------------------------------------------------------------
Revision: 6aa1321a3bc75ae00914b5d94f966471f077e17a
Ancestor: f2980da25b620e0a6cafa4407ddc1a139a47381a
Author: resiak at soc.pidgin.im
Date: 2007-11-05T01:39:39
Branch: im.pidgin.cpw.resiak.disconnectreason

Modified files:
        pidgin/minidialog.c

ChangeLog: 

De-magic-number (and correct) the width request of PidginMiniDialog's labels.

-------------- next part --------------
============================================================
--- pidgin/minidialog.c	76ea23e765ea8fda5f8221132ac8a9e5436a1d66
+++ pidgin/minidialog.c	d2db74b74925b4cd15e973602b60fec5a591b888
@@ -307,10 +307,16 @@ pidgin_mini_dialog_class_init(PidginMini
 	g_object_class_install_property (object_class, PROP_ICON_NAME, param_spec);
 }
 
+/* 16 is the width of the icon, due to PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL */
+#define BLIST_WIDTH_OTHER_THAN_LABEL \
+	((PIDGIN_HIG_BOX_SPACE * 3) + 16)
+
 static void
 pidgin_mini_dialog_init(PidginMiniDialog *self)
 {
 	GtkBox *self_box = GTK_BOX(self);
+	guint blist_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width");
+	guint label_width = blist_width - BLIST_WIDTH_OTHER_THAN_LABEL;
 
 	PidginMiniDialogPrivate *priv = g_new0(PidginMiniDialogPrivate, 1);
 	self->priv = priv;
@@ -323,11 +329,8 @@ pidgin_mini_dialog_init(PidginMiniDialog
 	gtk_misc_set_alignment(GTK_MISC(priv->icon), 0, 0);
 
 	priv->title = GTK_LABEL(gtk_label_new(NULL));
-	/* TODO: update this request when /blist/width updates.  Also, 25 is
-	 * magic.
-	 */
-	gtk_widget_set_size_request(GTK_WIDGET(priv->title),
-		purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width")-25, -1);
+	/* TODO: update this request when /blist/width updates. */
+	gtk_widget_set_size_request(GTK_WIDGET(priv->title), label_width, -1);
 	gtk_label_set_line_wrap(priv->title, TRUE);
 	gtk_misc_set_alignment(GTK_MISC(priv->title), 0, 0);
 
@@ -335,11 +338,8 @@ pidgin_mini_dialog_init(PidginMiniDialog
 	gtk_box_pack_start(priv->title_box, GTK_WIDGET(priv->title), TRUE, TRUE, 0);
 
 	priv->desc = GTK_LABEL(gtk_label_new(NULL));
-	/* TODO: update this request when /blist/width updates.  Also, 25 is
-	 * magic.
-	 */
-	gtk_widget_set_size_request(GTK_WIDGET(priv->desc),
-		purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width")-25, -1);
+	/* TODO: update this request when /blist/width updates. */
+	gtk_widget_set_size_request(GTK_WIDGET(priv->desc), label_width, -1);
 	gtk_label_set_line_wrap(priv->desc, TRUE);
 	gtk_misc_set_alignment(GTK_MISC(priv->desc), 0, 0);
 


More information about the Commits mailing list