aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-canvas.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-canvas.c')
-rw-r--r--widgets/misc/e-canvas.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 91fbca29b8..e48c6bb821 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -31,6 +31,10 @@ static void e_canvas_unrealize (GtkWidget *widget);
static gint e_canvas_key (GtkWidget *widget,
GdkEventKey *event);
+static gint e_canvas_visibility (GtkWidget *widget,
+ GdkEventVisibility *event,
+ ECanvas *canvas);
+
static gint e_canvas_focus_in (GtkWidget *widget,
GdkEventFocus *event);
static gint e_canvas_focus_out (GtkWidget *widget,
@@ -114,6 +118,7 @@ e_canvas_init (ECanvas *canvas)
canvas->cursor = NULL;
canvas->ic = NULL;
canvas->ic_attr = NULL;
+ canvas->tooltip_window = NULL;
}
static void
@@ -124,6 +129,16 @@ e_canvas_destroy (GtkObject *object)
if (canvas->idle_id)
g_source_remove(canvas->idle_id);
+ if (canvas->toplevel) {
+ if (canvas->visibility_notify_id)
+ gtk_signal_disconnect (GTK_OBJECT(canvas->toplevel),
+ canvas->visibility_notify_id);
+ canvas->visibility_notify_id = 0;
+
+ gtk_object_unref(GTK_OBJECT(canvas->toplevel));
+ canvas->toplevel = NULL;
+ }
+
if ((GTK_OBJECT_CLASS (parent_class))->destroy)
(*(GTK_OBJECT_CLASS (parent_class))->destroy) (object);
}
@@ -284,6 +299,18 @@ e_canvas_key (GtkWidget *widget, GdkEventKey *event)
return emit_event (canvas, &full_event);
}
+/* Key event handler for the canvas */
+static gint
+e_canvas_visibility (GtkWidget *widget, GdkEventVisibility *event, ECanvas *canvas)
+{
+ if (! canvas->visibility_first) {
+ e_canvas_hide_tooltip(canvas);
+ }
+ canvas->visibility_first = FALSE;
+
+ return FALSE;
+}
+
/**
* e_canvas_item_grab_focus:
@@ -703,3 +730,31 @@ e_canvas_item_remove_selection (GnomeCanvasItem *item, gpointer id)
}
}
}
+
+void e_canvas_popup_tooltip (ECanvas *canvas, GtkWidget *widget, int x, int y)
+{
+ if (canvas->tooltip_window && canvas->tooltip_window != widget) {
+ e_canvas_hide_tooltip(canvas);
+ }
+ canvas->tooltip_window = widget;
+ canvas->visibility_first = TRUE;
+ if (canvas->toplevel == NULL) {
+ canvas->toplevel = gtk_widget_get_toplevel (GTK_WIDGET(canvas));
+ if (canvas->toplevel) {
+ gtk_widget_add_events(canvas->toplevel, GDK_VISIBILITY_NOTIFY_MASK);
+ gtk_object_ref(GTK_OBJECT(canvas->toplevel));
+ canvas->visibility_notify_id =
+ gtk_signal_connect (GTK_OBJECT (canvas->toplevel), "visibility_notify_event",
+ GTK_SIGNAL_FUNC (e_canvas_visibility), canvas);
+ }
+ }
+ gtk_widget_popup (widget, x, y);
+}
+
+void e_canvas_hide_tooltip (ECanvas *canvas)
+{
+ if (canvas->tooltip_window) {
+ gtk_widget_destroy (canvas->tooltip_window);
+ canvas->tooltip_window = NULL;
+ }
+}
/a>Tomasz Kłoczko2005-09-111-6059/+505 * Updated Serbian translation by Igor Nestorovic.Danilo Šegan2005-08-221-2099/+2351 * fixed a typo: s/occured/occurred/gJens Seidel2005-08-221-1/+1 * Updated Serbian translation by Igor Nestorovic.Danilo Šegan2005-07-161-620/+981 * Updated Serbian translation by Igor Nestorovic.Danilo Šegan2005-07-111-3004/+3264 * added all the new gal widgets & a couple of other missing files. re-sortedNot Zed2005-06-211-3221/+4398 * Updated Serbian translation.Danilo Šegan2005-04-061-5407/+5266 * Updated Serbian translation.Danilo Šegan2005-03-051-3991/+3915 * Updated Serbian translation by Igor.Danilo Šegan2005-03-051-8496/+9797 * Updated Serbian translation.Danilo Šegan2004-08-231-2003/+1526 * bump version. requiresJP Rosevear2004-08-141-384/+506 * bump version, requirementsJP Rosevear2004-08-031-600/+709 * bump version, requirementsJP Rosevear2004-07-201-301/+334 * bump version, requirementsJP Rosevear2004-07-051-3405/+4143 * Merge from release branch.JP Rosevear2004-06-041-1896/+1927 * bump versionJP Rosevear2004-05-201-3128/+3857 * distedJeffrey Stedfast2004-04-301-1949/+2752 * Merge from release branchJP Rosevear2004-04-201-805/+833 * bump version, requirementsJP Rosevear2004-04-031-1060/+1054 * Updated Serbian translation.Danilo Šegan2004-03-271-778/+1018 * Updated Serbian translation.Danilo Šegan2004-03-241-818/+962 * Updated Serbian translation.Danilo Šegan2004-03-141-173/+216 * Updated Serbian translation.Danilo Šegan2004-03-121-169/+174 * Updated Serbian translation.Danilo Šegan2004-03-091-230/+285 * bump version, requirementsJP Rosevear2004-03-061-595/+601 * Updated Serbian translation.Danilo Šegan2004-03-021-149/+208 * Updated Serbian translation -- hey, this Korean guy is a day ahead of me.Danilo Šegan2004-02-271-326/+309 * Updated Serbian translation.Danilo Šegan2004-02-221-1094/+1133 * bump version, libtool numbersJP Rosevear2004-02-101-1127/+1232 * Marked all plural-forms bugs with 'bug: plural-forms'.Danilo Šegan2004-01-291-1/+27 * Updated Serbian translation.Danilo Šegan2004-01-281-225/+244 * Updated Serbian translation.Danilo Šegan2004-01-271-95/+96 * bump requirements, versionJP Rosevear2004-01-271-420/+489 * Updated Serbian translation.Danilo Šegan2004-01-231-407/+413 * Updated Serbian translation.Danilo Å egan2004-01-171-629/+658 * Updated Serbian translation.Danilo Šegan2004-01-151-112/+138 * Updated Serbian translation.Danilo Å egan2004-01-141-359/+426 * bump version and requirementsJP Rosevear2004-01-131-667/+892 * Updated Serbian translation.Danilo Šegan2004-01-121-190/+311 * Updated Serbian translation.Danilo Å egan2004-01-101-711/+947 * Updated Serbian translation, added missing files to POTFILES.in.Danilo Šegan2004-01-061-9448/+1055 * bump version and gal, e-d-s and gtkhtml requirementsJP Rosevear2003-12-301-1483/+1672 * update version relianceJP Rosevear2003-12-081-2229/+3539 * updateJP Rosevear2003-11-071-1267/+1079 * remove dead fileJP Rosevear2003-10-311-14246/+12337 * Updated Serbian translation by Serbian team (Prevod.org).Danilo Å egan2003-07-261-829/+911 * 1.4.1 release.Ettore Perazzoli2003-06-261-184/+178 * Updated Serbian translation by Serbian team (Prevod.org).Danilo Å egan2003-06-221-2885/+2779