# HG changeset patch # User Will Thompson # Date 1194226779 0 # Node ID c972c9311221552d1e2ec598c57ba35420559fd1 # Parent ccceac5e19765e986281415bdad4622cfdd964d3 De-magic-number (and correct) the width request of PidginMiniDialog's labels. diff -r ccceac5e1976 -r c972c9311221 pidgin/minidialog.c --- a/pidgin/minidialog.c Mon Nov 05 01:32:25 2007 +0000 +++ b/pidgin/minidialog.c Mon Nov 05 01:39:39 2007 +0000 @@ -307,10 +307,16 @@ 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 @@ 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 @@ 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);