diff options
author | Milan Crha <mcrha@redhat.com> | 2009-02-16 19:00:23 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2009-02-16 19:00:23 +0800 |
commit | 5f0a7fea0d679915459fb28a98c82d61cb79b673 (patch) | |
tree | 8d882acdc94652af6a459b8acbf6ca7b4806aba5 /calendar | |
parent | 5a7c58ddeb7d9fc5749f0bdf3c4c2f50d0245a58 (diff) | |
download | gsoc2013-evolution-5f0a7fea0d679915459fb28a98c82d61cb79b673.tar.gz gsoc2013-evolution-5f0a7fea0d679915459fb28a98c82d61cb79b673.tar.zst gsoc2013-evolution-5f0a7fea0d679915459fb28a98c82d61cb79b673.zip |
** Fix for bug #550114
2009-02-16 Milan Crha <mcrha@redhat.com>
** Fix for bug #550114
* widgets/table/e-table-group.h:
* widgets/table/e-table-group.c:
* widgets/table/e-table-group-container.c:
* widgets/table/e-table-group-leaf.c:
Replaced 'compute_mouse_over' with 'get_mouse_over', now works
with cached values 'motion_row', 'motion_col'.
* widgets/table/e-table.c: (e_table_get_mouse_over_cell):
Mouse position not required anymore, remove it too then.
* calendar/gui/e-calendar-table.h: (ec_query_tooltip):
* calendar/gui/e-calendar-table.c: (ec_query_tooltip): Offer it to others too.
* calendar/gui/e-calendar-table.c: (query_tooltip_cb): Use above funtion.
Show proper tooltip in table with grouping columns.
* calendar/gui/e-memo-table.c: (query_tooltip_cb), (e_memo_table_init):
Show tooltips in memo view too.
svn path=/trunk/; revision=37275
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 11 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 29 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-memo-table.c | 15 |
4 files changed, 48 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index f7d47c8ce9..96b08efbba 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,14 @@ +2009-02-16 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #550114 + + * gui/e-calendar-table.h: (ec_query_tooltip): + * gui/e-calendar-table.c: (ec_query_tooltip): Offer it to others too. + * gui/e-calendar-table.c: (query_tooltip_cb): Use above funtion. + Show proper tooltip in table with grouping columns. + * gui/e-memo-table.c: (query_tooltip_cb), (e_memo_table_init): + Show tooltips in memo view too. + 2009-02-13 Chow Loong Jin <hyperair@gmail.com> ** Fixes bug #571625 diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 4c5836f1d9..3f5e708e9d 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -276,10 +276,9 @@ get_time_as_text (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t buff, buff_len); } -static gboolean -query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) +gboolean +ec_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, GtkWidget *etable_wgt, ECalModel *model) { - ECalendarTable *cal_table; ECalModelComponent *comp; int row = -1, col = -1; GtkWidget *box, *l, *w; @@ -302,13 +301,13 @@ query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, Gtk return FALSE; g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (E_IS_CALENDAR_TABLE (user_data), FALSE); g_return_val_if_fail (tooltip != NULL, FALSE); + g_return_val_if_fail (E_IS_TABLE (etable_wgt), FALSE); + g_return_val_if_fail (E_IS_CAL_MODEL (model), FALSE); - cal_table = E_CALENDAR_TABLE (user_data); + etable = E_TABLE (etable_wgt); - etable = e_calendar_table_get_table (cal_table); - e_table_get_mouse_over_cell (etable, x, y, &row, &col); + e_table_get_mouse_over_cell (etable, &row, &col); if (row == -1 || !etable) return FALSE; @@ -317,7 +316,7 @@ query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, Gtk if (esm && esm->sorter && e_sorter_needs_sorting (esm->sorter)) row = e_sorter_sorted_to_model (esm->sorter, row); - comp = e_cal_model_get_component_at (cal_table->model, row); + comp = e_cal_model_get_component_at (model, row); if (!comp || !comp->icalcomp) return FALSE; @@ -386,7 +385,7 @@ query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, Gtk e_cal_component_get_dtstart (new_comp, &dtstart); e_cal_component_get_due (new_comp, &dtdue); - default_zone = e_cal_model_get_timezone (cal_table->model); + default_zone = e_cal_model_get_timezone (model); if (dtstart.tzid) { zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (new_comp), dtstart.tzid); @@ -476,6 +475,18 @@ query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, Gtk return TRUE; } +static gboolean +query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) +{ + ECalendarTable *cal_table; + + g_return_val_if_fail (E_IS_CALENDAR_TABLE (user_data), FALSE); + + cal_table = E_CALENDAR_TABLE (user_data); + + return ec_query_tooltip (widget, x, y, keyboard_mode, tooltip, GTK_WIDGET (e_calendar_table_get_table (cal_table)), cal_table->model); +} + static void e_calendar_table_init (ECalendarTable *cal_table) { diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index 3e11716e21..e9906ad59b 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -116,6 +116,8 @@ void e_calendar_table_hide_completed_tasks (ECalendarTable *table, GList *client void e_calendar_table_process_completed_tasks (ECalendarTable *table, GList *clients_list, gboolean config_changed); +gboolean ec_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, GtkWidget *etable_wgt, ECalModel *model); + G_END_DECLS #endif /* _E_CALENDAR_TABLE_H_ */ diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 8e312c7b0b..260103ada0 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -57,6 +57,7 @@ #include <e-util/e-icon-factory.h> #include <e-util/e-util-private.h> #include "e-cal-popup.h" +#include "e-calendar-table.h" enum TargetType{ TARGET_TYPE_VCALENDAR @@ -181,6 +182,18 @@ row_appended_cb (ECalModel *model, EMemoTable *memo_table) g_signal_emit (memo_table, signals[USER_CREATED], 0); } +static gboolean +query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) +{ + EMemoTable *memo_table; + + g_return_val_if_fail (E_IS_MEMO_TABLE (user_data), FALSE); + + memo_table = E_MEMO_TABLE (user_data); + + return ec_query_tooltip (widget, x, y, keyboard_mode, tooltip, GTK_WIDGET (e_memo_table_get_table (memo_table)), memo_table->model); +} + static void e_memo_table_init (EMemoTable *memo_table) { @@ -272,6 +285,8 @@ e_memo_table_init (EMemoTable *memo_table) g_signal_connect (e_table, "right_click", G_CALLBACK (e_memo_table_on_right_click), memo_table); g_signal_connect (e_table, "key_press", G_CALLBACK (e_memo_table_on_key_press), memo_table); g_signal_connect (e_table, "popup_menu", G_CALLBACK (e_memo_table_on_popup_menu), memo_table); + g_signal_connect (e_table, "query-tooltip", G_CALLBACK (query_tooltip_cb), memo_table); + gtk_widget_set_has_tooltip (GTK_WIDGET (e_table), TRUE); a11y = gtk_widget_get_accessible (GTK_WIDGET(e_table)); if (a11y) |