pidgin: 0f815cf6: Add notify::visibilty handlers for the '...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Fri Jul 2 21:20:44 EDT 2010
----------------------------------------------------------------------
Revision: 0f815cf6a2856f5a827db33ddb59851697345c8f
Parent: 92d2f85227948eba1c1b529cb12ddf864b23d34b
Author: darkrain42 at pidgin.im
Date: 07/02/10 21:13:29
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0f815cf6a2856f5a827db33ddb59851697345c8f
Changelog:
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.
Changes against parent 92d2f85227948eba1c1b529cb12ddf864b23d34b
patched ChangeLog.API
patched pidgin/gtkimhtmltoolbar.c
-------------- next part --------------
============================================================
--- pidgin/gtkimhtmltoolbar.c 881290900bd419272d0bba3fd23582791392c8fc
+++ pidgin/gtkimhtmltoolbar.c 9ee928505da6dcd79ed5f4f98d4a6a43c1ce5c76
@@ -1276,6 +1276,15 @@ static void
}
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 (GtkI
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 (GtkI
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 (GtkI
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);
============================================================
--- ChangeLog.API 7506e29b249f9ac031167def0f09de6b5bfb0cd3
+++ ChangeLog.API 634ca71057bc5f56eb91b4cdf58217be4d7db2bc
@@ -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
More information about the Commits
mailing list