comparison pidgin/gtkrequest.c @ 17773:7a96dcb82ff7

Make multiline pidgin_request_input() windows resizable, and make the text field expand as the window expands. This includes the "Set Info" dialog for AIM. I didn't notice any problems, but let me know if you see an input dialog that looks bad.
author Mark Doliner <mark@kingant.net>
date Thu, 07 Jun 2007 08:02:47 +0000
parents fd620cbc5149
children 0b3d6ea61760
comparison
equal deleted inserted replaced
17772:a8d6f071eb6d 17773:7a96dcb82ff7
321 G_CALLBACK(input_response_cb), data); 321 G_CALLBACK(input_response_cb), data);
322 322
323 /* Setup the dialog */ 323 /* Setup the dialog */
324 gtk_container_set_border_width(GTK_CONTAINER(dialog), PIDGIN_HIG_BORDER/2); 324 gtk_container_set_border_width(GTK_CONTAINER(dialog), PIDGIN_HIG_BORDER/2);
325 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BORDER/2); 325 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BORDER/2);
326 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); 326 if (!multiline)
327 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
327 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); 328 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
328 gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); 329 gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0);
329 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BORDER); 330 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BORDER);
330 331
331 /* Setup the main horizontal box */ 332 /* Setup the main horizontal box */
339 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); 340 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
340 341
341 /* Vertical box */ 342 /* Vertical box */
342 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); 343 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER);
343 344
344 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); 345 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
345 346
346 /* Descriptive label */ 347 /* Descriptive label */
347 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; 348 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL;
348 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; 349 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
349 label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" 350 label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">"
357 label = gtk_label_new(NULL); 358 label = gtk_label_new(NULL);
358 359
359 gtk_label_set_markup(GTK_LABEL(label), label_text); 360 gtk_label_set_markup(GTK_LABEL(label), label_text);
360 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); 361 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
361 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 362 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
362 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); 363 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
363 364
364 g_free(label_text); 365 g_free(label_text);
365 366
366 /* Entry field. */ 367 /* Entry field. */
367 data->u.input.multiline = multiline; 368 data->u.input.multiline = multiline;