Mercurial > pidgin.yaz
comparison finch/gntnotify.c @ 18068:0b3d6ea61760
propagate from branch 'im.pidgin.pidgin' (head 4b50880d8517570eaa67d4cd9d88c5934bb832f1)
to branch 'im.pidgin.pidgin.2.1.0' (head fefd59692d4177b91d52f6d71b1565b76c88725d)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 07 Jun 2007 14:48:33 +0000 |
parents | 7f652ef12ed6 |
children | b8572b937c09 |
comparison
equal
deleted
inserted
replaced
17782:5eebb9b24e30 | 18068:0b3d6ea61760 |
---|---|
67 window = gnt_box_new(FALSE, TRUE); | 67 window = gnt_box_new(FALSE, TRUE); |
68 gnt_box_set_toplevel(GNT_BOX(window), TRUE); | 68 gnt_box_set_toplevel(GNT_BOX(window), TRUE); |
69 gnt_box_set_title(GNT_BOX(window), title); | 69 gnt_box_set_title(GNT_BOX(window), title); |
70 gnt_box_set_fill(GNT_BOX(window), FALSE); | 70 gnt_box_set_fill(GNT_BOX(window), FALSE); |
71 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); | 71 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); |
72 gnt_box_set_pad(GNT_BOX(window), 0); | |
72 | 73 |
73 if (primary) | 74 if (primary) |
74 gnt_box_add_widget(GNT_BOX(window), | 75 gnt_box_add_widget(GNT_BOX(window), |
75 gnt_label_new_with_format(primary, pf)); | 76 gnt_label_new_with_format(primary, pf)); |
76 | 77 |
166 | 167 |
167 gnt_box_add_widget(GNT_BOX(box), | 168 gnt_box_add_widget(GNT_BOX(box), |
168 gnt_label_new_with_format(_("You have mail!"), GNT_TEXT_FLAG_BOLD)); | 169 gnt_label_new_with_format(_("You have mail!"), GNT_TEXT_FLAG_BOLD)); |
169 | 170 |
170 emaildialog.tree = tree = gnt_tree_new_with_columns(3); | 171 emaildialog.tree = tree = gnt_tree_new_with_columns(3); |
171 gnt_tree_set_column_titles(GNT_TREE(tree), _("Account"), _("From"), _("Subject")); | 172 gnt_tree_set_column_titles(GNT_TREE(tree), _("Account"), _("Sender"), _("Subject")); |
172 gnt_tree_set_show_title(GNT_TREE(tree), TRUE); | 173 gnt_tree_set_show_title(GNT_TREE(tree), TRUE); |
173 gnt_tree_set_col_width(GNT_TREE(tree), 0, 15); | 174 gnt_tree_set_col_width(GNT_TREE(tree), 0, 15); |
174 gnt_tree_set_col_width(GNT_TREE(tree), 1, 25); | 175 gnt_tree_set_col_width(GNT_TREE(tree), 1, 25); |
175 gnt_tree_set_col_width(GNT_TREE(tree), 2, 25); | 176 gnt_tree_set_col_width(GNT_TREE(tree), 2, 25); |
176 | 177 |
266 if (ui_handle != NULL) { | 267 if (ui_handle != NULL) { |
267 GntTextView *msg = GNT_TEXT_VIEW(g_object_get_data(G_OBJECT(ui_handle), "info-widget")); | 268 GntTextView *msg = GNT_TEXT_VIEW(g_object_get_data(G_OBJECT(ui_handle), "info-widget")); |
268 char *strip = purple_markup_strip_html(info); | 269 char *strip = purple_markup_strip_html(info); |
269 int tvw, tvh, width, height, ntvw, ntvh; | 270 int tvw, tvh, width, height, ntvw, ntvh; |
270 | 271 |
272 while (GNT_WIDGET(ui_handle)->parent) | |
273 ui_handle = GNT_WIDGET(ui_handle)->parent; | |
271 gnt_widget_get_size(GNT_WIDGET(ui_handle), &width, &height); | 274 gnt_widget_get_size(GNT_WIDGET(ui_handle), &width, &height); |
272 gnt_widget_get_size(GNT_WIDGET(msg), &tvw, &tvh); | 275 gnt_widget_get_size(GNT_WIDGET(msg), &tvw, &tvh); |
273 | 276 |
274 /* Ideally, I would replace the information in "info". But replacing tagged text is a | |
275 * bit nasty right now. So clear the view and add the new stuff instead. */ | |
276 gnt_text_view_clear(msg); | 277 gnt_text_view_clear(msg); |
277 gnt_text_view_append_text_with_flags(msg, strip, GNT_TEXT_FLAG_NORMAL); | 278 gnt_text_view_append_text_with_flags(msg, strip, GNT_TEXT_FLAG_NORMAL); |
278 gnt_text_view_scroll(msg, 0); | 279 gnt_text_view_scroll(msg, 0); |
279 gnt_util_get_text_bound(strip, &ntvw, &ntvh); | 280 gnt_util_get_text_bound(strip, &ntvw, &ntvh); |
280 ntvw += 3; | 281 ntvw += 3; |
281 ntvh++; | 282 ntvh++; |
282 | 283 |
283 gnt_screen_resize_widget(GNT_WIDGET(ui_handle), width + (ntvw - tvw), height + (ntvh - tvh)); | 284 gnt_screen_resize_widget(GNT_WIDGET(ui_handle), width + MAX(0, ntvw - tvw), height + MAX(0, ntvh - tvh)); |
284 g_free(strip); | 285 g_free(strip); |
285 g_free(key); | 286 g_free(key); |
286 } else { | 287 } else { |
287 primary = g_strdup_printf(_("Info for %s"), who); | 288 primary = g_strdup_printf(_("Info for %s"), who); |
288 ui_handle = finch_notify_formatted(_("Buddy Information"), primary, NULL, info); | 289 ui_handle = finch_notify_formatted(_("Buddy Information"), primary, NULL, info); |