[Goodies-commits] r3692 - in xfce4-places-plugin/trunk: . panel-plugin
Diego Ongaro
ongardie at xfce.org
Mon Dec 10 09:14:45 CET 2007
Author: ongardie
Date: 2007-12-10 08:14:45 +0000 (Mon, 10 Dec 2007)
New Revision: 3692
Modified:
xfce4-places-plugin/trunk/ChangeLog
xfce4-places-plugin/trunk/TODO
xfce4-places-plugin/trunk/panel-plugin/view.c
xfce4-places-plugin/trunk/panel-plugin/view.h
Log:
2007-12-10 Diego Ongaro <ongardie at gmail.com>
* view.c: Use GtkTooltip API when available
Modified: xfce4-places-plugin/trunk/ChangeLog
===================================================================
--- xfce4-places-plugin/trunk/ChangeLog 2007-12-10 08:03:22 UTC (rev 3691)
+++ xfce4-places-plugin/trunk/ChangeLog 2007-12-10 08:14:45 UTC (rev 3692)
@@ -1,6 +1,7 @@
2007-12-10 Diego Ongaro <ongardie at gmail.com>
* view.c: Bug: label didn't change when already shown
+ * view.c: Use GtkTooltip API when available
2007-12-09 Diego Ongaro <ongardie at gmail.com>
Modified: xfce4-places-plugin/trunk/TODO
===================================================================
--- xfce4-places-plugin/trunk/TODO 2007-12-10 08:03:22 UTC (rev 3691)
+++ xfce4-places-plugin/trunk/TODO 2007-12-10 08:14:45 UTC (rev 3692)
@@ -1,4 +1,3 @@
use less resources
path/uri mess
-new tooltip API in GTK 2.12
error messages and notifications for (un)mounting
Modified: xfce4-places-plugin/trunk/panel-plugin/view.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/view.c 2007-12-10 08:03:22 UTC (rev 3691)
+++ xfce4-places-plugin/trunk/panel-plugin/view.c 2007-12-10 08:14:45 UTC (rev 3692)
@@ -46,6 +46,8 @@
#include <gtk/gtk.h>
+#define USE_GTK_TOOLTIP_API GTK_CHECK_VERSION(2,12,0)
+
#include <libxfce4util/libxfce4util.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/xfce-panel-convenience.h>
@@ -81,7 +83,9 @@
GtkWidget *button_image;
GtkWidget *button_label;
GtkWidget *menu;
+#if !USE_GTK_TOOLTIP_API
GtkTooltips *tooltips;
+#endif
gboolean needs_separator;
guint menu_timeout_id;
@@ -902,8 +906,13 @@
gtk_widget_set_size_request(view->button, width, height);
}
- if(label_changed)
+ if(label_changed){
+#if USE_GTK_TOOLTIP_API
+ gtk_widget_set_tooltip_text(view->button, view->label_text);
+#else
gtk_tooltips_set_tip(view->tooltips, view->button, view->label_text, NULL);
+#endif
+ }
}
static void
@@ -1013,7 +1022,12 @@
pview_reconfigure_model(view);
+#if USE_GTK_TOOLTIP_API
+ DBG("using GtkTooltip API");
+#else
+ DBG("using GtkTooltips API");
view->tooltips = exo_gtk_object_ref_sink(GTK_OBJECT(gtk_tooltips_new()));
+#endif
/* init button */
@@ -1079,7 +1093,10 @@
g_object_unref(view->button);
if(view->label_text != NULL)
g_free(view->label_text);
+
+#if !USE_GTK_TOOLTIP_API
g_object_unref(view->tooltips);
+#endif
places_cfg_view_iface_finalize(view->cfg_iface);
Modified: xfce4-places-plugin/trunk/panel-plugin/view.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/view.h 2007-12-10 08:03:22 UTC (rev 3691)
+++ xfce4-places-plugin/trunk/panel-plugin/view.h 2007-12-10 08:14:45 UTC (rev 3692)
@@ -27,9 +27,7 @@
#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-plugin.h>
-#if GTK_CHECK_VERSION(2,10,0)
-# define USE_RECENT_DOCUMENTS TRUE
-#endif
+#define USE_RECENT_DOCUMENTS GTK_CHECK_VERSION(2,10,0)
typedef struct _PlacesView PlacesView;
More information about the Goodies-commits
mailing list