# HG changeset patch # User Sadrul Habib Chowdhury # Date 1176672063 0 # Node ID 7a2ffa981c1a61a0d24df6c3015a08dfe21dd0ee # Parent 063274e9cb277d3ccb9d034e76c1f01f209a710f Allow adding information widgets in the conversation window. diff -r 063274e9cb27 -r 7a2ffa981c1a finch/gntconv.c --- a/finch/gntconv.c Sun Apr 15 20:25:40 2007 +0000 +++ b/finch/gntconv.c Sun Apr 15 21:21:03 2007 +0000 @@ -308,6 +308,9 @@ gnt_widget_set_size(ggc->tv, purple_prefs_get_int(PREF_ROOT "/size/width"), purple_prefs_get_int(PREF_ROOT "/size/height")); + ggc->info = gnt_vbox_new(FALSE); + gnt_box_add_widget(GNT_BOX(ggc->window), ggc->info); + ggc->entry = gnt_entry_new(NULL); gnt_box_add_widget(GNT_BOX(ggc->window), ggc->entry); gnt_widget_set_name(ggc->entry, "conversation-window-entry"); @@ -742,3 +745,21 @@ g_free(title); } +void finch_conversation_set_info_widget(PurpleConversation *conv, GntWidget *widget) +{ + FinchConv *fc = conv->ui_data; + int height, width; + + gnt_box_remove_all(GNT_BOX(fc->info)); + + if (widget) { + gnt_box_add_widget(GNT_BOX(fc->info), widget); + gnt_box_readjust(GNT_BOX(fc->info)); + } + + gnt_widget_get_size(fc->window, &width, &height); + gnt_box_readjust(GNT_BOX(fc->window)); + gnt_screen_resize_widget(fc->window, width, height); + gnt_box_give_focus_to_child(GNT_BOX(fc->window), fc->entry); +} + diff -r 063274e9cb27 -r 7a2ffa981c1a finch/gntconv.h --- a/finch/gntconv.h Sun Apr 15 20:25:40 2007 +0000 +++ b/finch/gntconv.h Sun Apr 15 21:21:03 2007 +0000 @@ -47,6 +47,7 @@ GntWidget *window; /* the container */ GntWidget *entry; /* entry */ GntWidget *tv; /* text-view */ + GntWidget *info; union { @@ -89,6 +90,15 @@ */ void finch_conversation_set_active(PurpleConversation *conv); +/** + * Sets the information widget for the conversation window. + * + * @param conv The conversation. + * @param widget The widget containing the information. If @c NULL, + * the current information widget is removed. + */ +void finch_conversation_set_info_widget(PurpleConversation *conv, GntWidget *widget); + /*@}*/ #endif