[Goodies-commits] r6060 - xfce4-mailwatch-plugin/trunk/panel-plugin
Brian Tarricone
kelnos at xfce.org
Tue Nov 11 08:16:17 CET 2008
Author: kelnos
Date: 2008-11-11 07:16:17 +0000 (Tue, 11 Nov 2008)
New Revision: 6060
Modified:
xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c
Log:
support gtk 2.12-style tooltips, and trigger a tooltip re-query when it changes
Modified: xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c
===================================================================
--- xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c 2008-11-11 03:26:19 UTC (rev 6059)
+++ xfce4-mailwatch-plugin/trunk/panel-plugin/mailwatch-plugin.c 2008-11-11 07:16:17 UTC (rev 6060)
@@ -57,7 +57,9 @@
GdkPixbuf *pix_normal;
GdkPixbuf *pix_newmail;
+#if !GTK_CHECK_VERSION(2, 12, 0)
GtkTooltips *tooltip;
+#endif
gchar *click_command;
gchar *new_messages_command;
@@ -106,7 +108,12 @@
mailwatch_set_size(mwp->plugin,
xfce_panel_plugin_get_size(mwp->plugin),
mwp);
+#if GTK_CHECK_VERSION(2, 12, 0)
+ gtk_widget_set_tooltip_text(mwp->button, _("No new mail"));
+ gtk_widget_trigger_tooltip_query(mwp->button);
+#else
gtk_tooltips_set_tip(mwp->tooltip, mwp->button, _("No new mail"), NULL);
+#endif
} else if(new_messages > 0) {
if(!mwp->newmail_icon_visible) {
mwp->newmail_icon_visible = TRUE;
@@ -141,7 +148,12 @@
g_strfreev(mailbox_names);
g_free(new_message_counts);
+#if GTK_CHECK_VERSION(2, 12, 0)
+ gtk_widget_set_tooltip_text(mwp->button, ttip_str->str);
+ gtk_widget_trigger_tooltip_query(mwp->button);
+#else
gtk_tooltips_set_tip(mwp->tooltip, mwp->button, ttip_str->str, NULL);
+#endif
g_string_free(ttip_str, TRUE);
if(mwp->new_messages_command)
@@ -405,8 +417,6 @@
g_free(mwp);
return NULL;
}
-
- mwp->tooltip = gtk_tooltips_new();
mwp->button = xfce_create_panel_button();
gtk_button_set_relief(GTK_BUTTON(mwp->button), GTK_RELIEF_NONE);
@@ -416,7 +426,13 @@
G_CALLBACK(mailwatch_button_press_cb), mwp);
g_signal_connect(mwp->button, "button-release-event",
G_CALLBACK(mailwatch_button_release_cb), mwp);
+
+#if GTK_CHECK_VERSION(2, 12, 0)
+ gtk_widget_set_tooltip_text(mwp->button, _("No new mail"));
+#else
+ mwp->tooltip = gtk_tooltips_new();
gtk_tooltips_set_tip(mwp->tooltip, mwp->button, _("No new mail"), NULL);
+#endif
xfce_panel_plugin_add_action_widget(plugin, mwp->button);
@@ -1007,7 +1023,9 @@
g_object_unref(G_OBJECT(mwp->loglist));
+#if !GTK_CHECK_VERSION(2, 12, 0)
gtk_object_sink(GTK_OBJECT(mwp->tooltip));
+#endif
g_free(mwp);
}
More information about the Goodies-commits
mailing list