[evolution] EDayView: Hide tooltip on context menu popup
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EDayView: Hide tooltip on context menu popup
- Date: Fri, 10 Aug 2012 09:57:05 +0000 (UTC)
commit d5363016179a3727c3d974ddbab3d39118d82c95
Author: Milan Crha <mcrha redhat com>
Date: Fri Aug 10 11:56:18 2012 +0200
EDayView: Hide tooltip on context menu popup
calendar/gui/e-day-view.c | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 2b935f3..2b8f7a8 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -420,6 +420,7 @@ static void e_day_view_recalc_work_week_days_shown (EDayView *day_view);
static void e_day_view_queue_layout (EDayView *day_view);
static void e_day_view_cancel_layout (EDayView *day_view);
static gboolean e_day_view_layout_timeout_cb (gpointer data);
+static void tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item);
enum {
PROP_0,
@@ -3662,6 +3663,8 @@ e_day_view_show_popup_menu (EDayView *day_view,
gint day,
gint event_num)
{
+ tooltip_destroy (day_view, NULL);
+
day_view->popup_event_day = day;
day_view->popup_event_num = event_num;
@@ -6274,23 +6277,26 @@ static void
tooltip_destroy (EDayView *day_view,
GnomeCanvasItem *item)
{
- EDayViewEvent *pevent;
- gint event_num = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-num"));
- gint day = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-day"));
+ GtkWidget *tooltip = g_object_get_data (G_OBJECT (day_view), "tooltip-window");
- pevent = tooltip_get_view_event (day_view, day, event_num);
- if (pevent) {
- if (pevent->tooltip && g_object_get_data (G_OBJECT (day_view), "tooltip-window")) {
- gtk_widget_destroy (pevent->tooltip);
- pevent->tooltip = NULL;
- }
+ if (tooltip) {
+ gtk_widget_destroy (tooltip);
+ g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL);
+ }
- if (pevent->timeout != -1) {
- g_source_remove (pevent->timeout);
- pevent->timeout = -1;
- }
+ if (item) {
+ EDayViewEvent *pevent;
+ gint event_num = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-num"));
+ gint day = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-day"));
- g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL);
+ pevent = tooltip_get_view_event (day_view, day, event_num);
+ if (pevent) {
+ pevent->tooltip = NULL;
+ if (pevent->timeout != -1) {
+ g_source_remove (pevent->timeout);
+ pevent->timeout = -1;
+ }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]