Mercurial > pidgin.yaz
comparison src/dialogs.c @ 7751:d691cb95ee67
[gaim-migrate @ 8396]
Changes for the conversation "Find" dialog:
-Makes the window manager "X" work correctly when closing the dialog
-Added an "s" mnemonic for the search box
-Hitting enter now performs the default action (Find)
-The Find button grays and un-grays (aka sensitizes and desensitizes)
itself based on the presence or absence of text in the search box.
For this I moved a function from dialogs.c to util.[c|h]:
gaim_gtk_set_sensitive_if_input()
-HIGification suggestions from Steven Garrity:
1. Give the window a title ("Find") as is recommended by the HIG
(http://developer.gnome.org/projects/gup/hig/1.0/windows.html#window-properties).
2. Drop the phrase "Enter a search phrase" altogether. Since the text
box is already labeled (and if the window was labeled too), this phrase
is redundant. Removing it simplifies the visual appearance of the
window, and is one less thing to translate.
3.Change text box label from "Search term:" to "Search for:". This isn't
a big deal, but the Search window in GEdit uses "Search for:" (I
couldn't find much consistency anywhere else).
4.Move "Close" and "Find" buttons to be 12 pixels from the bottom and
right edges of the window, as recommended by the HIG
(http://developer.gnome.org/projects/gup/hig/1.0/layout.html#window-layout-spacing).
Also thanks to Nathan Fredrickson for writing a patch for Steven's
suggestions.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 04 Dec 2003 22:09:58 +0000 |
parents | 662a33ce4343 |
children | 8ebd9038ef62 |
comparison
equal
deleted
inserted
replaced
7750:14cc6614af93 | 7751:d691cb95ee67 |
---|---|
627 struct getuserinfo *info) | 627 struct getuserinfo *info) |
628 { | 628 { |
629 info->gc = gaim_account_get_connection(account); | 629 info->gc = gaim_account_get_connection(account); |
630 } | 630 } |
631 | 631 |
632 static void dialog_set_ok_sensitive(GtkWidget *entry, GtkWidget *dlg) { | |
633 const char *txt = gtk_entry_get_text(GTK_ENTRY(entry)); | |
634 gtk_dialog_set_response_sensitive(GTK_DIALOG(dlg), GTK_RESPONSE_OK, | |
635 (*txt != '\0')); | |
636 } | |
637 | |
638 void show_im_dialog() | 632 void show_im_dialog() |
639 { | 633 { |
640 GtkWidget *hbox, *vbox; | 634 GtkWidget *hbox, *vbox; |
641 GtkWidget *label; | 635 GtkWidget *label; |
642 GtkWidget *table; | 636 GtkWidget *table; |
690 info->entry = gtk_entry_new(); | 684 info->entry = gtk_entry_new(); |
691 gtk_table_attach_defaults(GTK_TABLE(table), info->entry, 1, 2, 0, 1); | 685 gtk_table_attach_defaults(GTK_TABLE(table), info->entry, 1, 2, 0, 1); |
692 gtk_entry_set_activates_default (GTK_ENTRY(info->entry), TRUE); | 686 gtk_entry_set_activates_default (GTK_ENTRY(info->entry), TRUE); |
693 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry)); | 687 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry)); |
694 g_signal_connect(G_OBJECT(info->entry), "changed", | 688 g_signal_connect(G_OBJECT(info->entry), "changed", |
695 G_CALLBACK(dialog_set_ok_sensitive), imdialog); | 689 G_CALLBACK(gaim_gtk_set_sensitive_if_input), imdialog); |
696 | 690 |
697 if (gaim_connections_get_all()->next) { | 691 if (gaim_connections_get_all()->next) { |
698 | 692 |
699 label = gtk_label_new(NULL); | 693 label = gtk_label_new(NULL); |
700 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); | 694 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); |
768 gtk_table_attach_defaults(GTK_TABLE(table), info->entry, 1, 2, 0, 1); | 762 gtk_table_attach_defaults(GTK_TABLE(table), info->entry, 1, 2, 0, 1); |
769 gtk_entry_set_activates_default (GTK_ENTRY(info->entry), TRUE); | 763 gtk_entry_set_activates_default (GTK_ENTRY(info->entry), TRUE); |
770 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry)); | 764 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry)); |
771 | 765 |
772 g_signal_connect(G_OBJECT(info->entry), "changed", | 766 g_signal_connect(G_OBJECT(info->entry), "changed", |
773 G_CALLBACK(dialog_set_ok_sensitive), window); | 767 G_CALLBACK(gaim_gtk_set_sensitive_if_input), window); |
774 | 768 |
775 if (gaim_connections_get_all()->next) { | 769 if (gaim_connections_get_all()->next) { |
776 | 770 |
777 label = gtk_label_new(NULL); | 771 label = gtk_label_new(NULL); |
778 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); | 772 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); |