comparison src/gtkconv.c @ 9080:717d0e23f5fa

[gaim-migrate @ 9856] Make the focus chain for conversations awesome. Unfortunately it's not usable because every time something in the gtkconv gets a "focus" signal we switch focus back to the entry widget. We need a better way to give the entry widget focus when initially switching to a tab, but not any time after that. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 27 May 2004 03:34:52 +0000
parents f01eef2c264a
children 6a17b7e2e3b2
comparison
equal deleted inserted replaced
9079:67e20c25d41e 9080:717d0e23f5fa
3537 GtkWidget *button; 3537 GtkWidget *button;
3538 GtkWidget *sw; 3538 GtkWidget *sw;
3539 GtkListStore *ls; 3539 GtkListStore *ls;
3540 GtkCellRenderer *rend; 3540 GtkCellRenderer *rend;
3541 GtkTreeViewColumn *col; 3541 GtkTreeViewColumn *col;
3542 GList *focus_chain; 3542 GList *focus_chain = NULL;
3543 3543
3544 gtkconv = GAIM_GTK_CONVERSATION(conv); 3544 gtkconv = GAIM_GTK_CONVERSATION(conv);
3545 gtkchat = gtkconv->u.chat; 3545 gtkchat = gtkconv->u.chat;
3546 gc = gaim_conversation_get_gc(conv); 3546 gc = gaim_conversation_get_gc(conv);
3547 3547
3779 gtk_box_pack_start(GTK_BOX(vbox), gtkconv->bbox, FALSE, FALSE, 0); 3779 gtk_box_pack_start(GTK_BOX(vbox), gtkconv->bbox, FALSE, FALSE, 0);
3780 gtk_widget_show(gtkconv->bbox); 3780 gtk_widget_show(gtkconv->bbox);
3781 3781
3782 setup_chat_buttons(conv, gtkconv->bbox); 3782 setup_chat_buttons(conv, gtkconv->bbox);
3783 3783
3784 focus_chain = g_list_prepend (NULL, sw); 3784 /*
3785 gtk_container_set_focus_chain (GTK_CONTAINER(vbox), focus_chain); 3785 * Focus for chat windows should be as follows:
3786 * Tab title -> chat topic -> conversation scrollback -> user list ->
3787 * user list buttons -> entry -> buttons at bottom
3788 */
3789 focus_chain = g_list_prepend(focus_chain, gtkconv->bbox);
3790 focus_chain = g_list_prepend(focus_chain, gtkconv->entrybox);
3791 gtk_container_set_focus_chain(GTK_CONTAINER(vbox), focus_chain);
3792
3786 return vpaned; 3793 return vpaned;
3787 } 3794 }
3788 3795
3789 static GtkWidget * 3796 static GtkWidget *
3790 setup_im_pane(GaimConversation *conv) 3797 setup_im_pane(GaimConversation *conv)
3794 GaimPlugin *protocol; 3801 GaimPlugin *protocol;
3795 GtkWidget *paned; 3802 GtkWidget *paned;
3796 GtkWidget *vbox; 3803 GtkWidget *vbox;
3797 GtkWidget *vbox2; 3804 GtkWidget *vbox2;
3798 GtkWidget *sw; 3805 GtkWidget *sw;
3799 GList *focus_chain; 3806 GList *focus_chain = NULL;
3800 3807
3801 gtkconv = GAIM_GTK_CONVERSATION(conv); 3808 gtkconv = GAIM_GTK_CONVERSATION(conv);
3802 gtkim = gtkconv->u.im; 3809 gtkim = gtkconv->u.im;
3803 3810
3804 /* Setup the outer pane. */ 3811 /* Setup the outer pane. */
3917 gtk_widget_show(gtkconv->bbox); 3924 gtk_widget_show(gtkconv->bbox);
3918 3925
3919 setup_im_buttons(conv, gtkconv->bbox); 3926 setup_im_buttons(conv, gtkconv->bbox);
3920 gtkconv->u.im->animate = gaim_prefs_get_bool("/gaim/gtk/conversations/im/animate_buddy_icons"); 3927 gtkconv->u.im->animate = gaim_prefs_get_bool("/gaim/gtk/conversations/im/animate_buddy_icons");
3921 3928
3922 focus_chain = g_list_prepend (NULL, sw); 3929 /*
3923 gtk_container_set_focus_chain (GTK_CONTAINER(vbox2), focus_chain); 3930 * Focus for IM windows should be as follows:
3931 * Tab title -> conversation scrollback -> entry -> buttons at bottom
3932 */
3933 focus_chain = g_list_prepend(focus_chain, gtkconv->bbox);
3934 focus_chain = g_list_prepend(focus_chain, gtkconv->entrybox);
3935 gtk_container_set_focus_chain(GTK_CONTAINER(vbox2), focus_chain);
3924 3936
3925 return paned; 3937 return paned;
3926 } 3938 }
3927 3939
3928 static void 3940 static void
4232 4244
4233 if (gtkconv->show_formatting_toolbar) 4245 if (gtkconv->show_formatting_toolbar)
4234 gtk_widget_show(gtkconv->toolbar); 4246 gtk_widget_show(gtkconv->toolbar);
4235 4247
4236 g_signal_connect_swapped(G_OBJECT(pane), "focus", 4248 g_signal_connect_swapped(G_OBJECT(pane), "focus",
4237 G_CALLBACK(gtk_widget_grab_focus), 4249 G_CALLBACK(gtk_widget_grab_focus),
4238 gtkconv->entry); 4250 gtkconv->entry);
4239 } 4251 }
4240 4252
4241 gtkconv->tabby = tabby = gtk_hbox_new(FALSE, 6); 4253 gtkconv->tabby = tabby = gtk_hbox_new(FALSE, 6);
4242 gtkconv->menu_tabby = menu_tabby = gtk_hbox_new(FALSE, 6); 4254 gtkconv->menu_tabby = menu_tabby = gtk_hbox_new(FALSE, 6);
4243 4255