diff options
author | Paul Aurich <darkrain42@pidgin.im> | 2010-07-03 01:13:29 +0000 |
---|---|---|
committer | Paul Aurich <darkrain42@pidgin.im> | 2010-07-03 01:13:29 +0000 |
commit | 88d756b95c0a37d402d580272519614cfd8a8e6f (patch) | |
tree | 810a77a03ecc9c78cde74f771f2c2b3816638746 | |
parent | 01b85eddb93d889ab478395a9a3c9f44177a76b3 (diff) | |
download | pidgin-88d756b95c0a37d402d580272519614cfd8a8e6f.tar.gz |
Add notify::visibilty handlers for the 'lean' GtkIMHtmlToolbar,
meaning, e.g., gtk_widget_hide(toolbar->link) will affect the
'lean' view, too.
This was entirely untested.
-rw-r--r-- | ChangeLog.API | 6 | ||||
-rw-r--r-- | pidgin/gtkimhtmltoolbar.c | 20 |
2 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog.API b/ChangeLog.API index 531ddd2aef..00cc60e48f 100644 --- a/ChangeLog.API +++ b/ChangeLog.API @@ -6,6 +6,12 @@ version 2.7.2 (??/??/????): * purple_account_[gs]et_public_alias no longer crash when called for a protocol that doesn't support the underlying calls and the caller does not specify a failure callback. + Pidgin: + Changed: + * Changing the visibility (gtk_widget_hide/show) of + the widgets in the GtkIMHtmlToolbar should now affect + the visibility of the entries in the 'lean' view + (the default toolbar view). version 2.7.1 (05/29/2010): * No changes diff --git a/pidgin/gtkimhtmltoolbar.c b/pidgin/gtkimhtmltoolbar.c index 117c1c9c87..41c3ea64e1 100644 --- a/pidgin/gtkimhtmltoolbar.c +++ b/pidgin/gtkimhtmltoolbar.c @@ -1276,6 +1276,15 @@ static void gtk_imhtmltoolbar_create_old_buttons(GtkIMHtmlToolbar *toolbar) } static void +button_visibility_changed(GtkWidget *button, gpointer dontcare, GtkWidget *item) +{ + if (gtk_widget_is_visible(button)) + gtk_widget_show(item); + else + gtk_widget_hide(item); +} + +static void button_sensitiveness_changed(GtkWidget *button, gpointer dontcare, GtkWidget *item) { gtk_widget_set_sensitive(item, GTK_WIDGET_IS_SENSITIVE(button)); @@ -1394,6 +1403,8 @@ static void gtk_imhtmltoolbar_init (GtkIMHtmlToolbar *toolbar) gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), menuitem); g_signal_connect(G_OBJECT(old), "notify::sensitive", G_CALLBACK(button_sensitiveness_changed), menuitem); + g_signal_connect(G_OBJECT(old), "notify::visible", + G_CALLBACK(button_visibility_changed), menuitem); gtk_container_foreach(GTK_CONTAINER(menuitem), (GtkCallback)enable_markup, NULL); } @@ -1426,12 +1437,16 @@ static void gtk_imhtmltoolbar_init (GtkIMHtmlToolbar *toolbar) gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), menuitem); g_signal_connect(G_OBJECT(toolbar->image), "notify::sensitive", G_CALLBACK(button_sensitiveness_changed), menuitem); + g_signal_connect(G_OBJECT(toolbar->image), "notify::visible", + G_CALLBACK(button_visibility_changed), menuitem); menuitem = gtk_menu_item_new_with_mnemonic(_("_Link")); g_signal_connect_swapped(G_OBJECT(menuitem), "activate", G_CALLBACK(gtk_button_clicked), toolbar->link); gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), menuitem); g_signal_connect(G_OBJECT(toolbar->link), "notify::sensitive", G_CALLBACK(button_sensitiveness_changed), menuitem); + g_signal_connect(G_OBJECT(toolbar->link), "notify::visible", + G_CALLBACK(button_visibility_changed), menuitem); menuitem = gtk_menu_item_new_with_mnemonic(_("_Horizontal rule")); g_signal_connect(G_OBJECT(menuitem), "activate" , G_CALLBACK(insert_hr_cb), toolbar); @@ -1484,9 +1499,10 @@ static void gtk_imhtmltoolbar_init (GtkIMHtmlToolbar *toolbar) G_CALLBACK(gtk_button_clicked), wide_attention_button); gtk_widget_show_all(attention_button); - g_signal_connect(wide_attention_button, "attention", - "notify::sensitive", + g_signal_connect(wide_attention_button, "notify::sensitive", G_CALLBACK(button_sensitiveness_changed), attention_button); + g_signal_connect(wide_attentino_button, "notify::visible", + G_CALLBACK(button_visibility_changed), attention_button); /* set attention button to be greyed out until we get a conversation */ gtk_widget_set_sensitive(wide_attention_button, FALSE); |