From 619c1cf37efc97be4bad9b028b3e8fbb080aefd4 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 29 Jun 2009 20:15:58 +0200 Subject: Bug #238058 - Show more from summary for events with icons --- calendar/gui/e-day-view-main-item.c | 19 +++++++++++-------- calendar/gui/e-day-view.c | 2 -- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 6d65dc063f..48830be99f 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -1072,8 +1072,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, e_cal_component_get_categories_list (comp, &categories_list); if (num_icons != 0) { - if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD) - * num_icons) { + if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD) * num_icons) { icon_x_inc = 0; icon_y_inc = E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD; @@ -1083,7 +1082,9 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_y_inc = 0; } - if (draw_reminder_icon) { + #define fit_in_event() icon_x + icon_x_inc < item_x + item_w && icon_y + icon_y_inc < item_y + item_h + + if (draw_reminder_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1102,7 +1103,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_y += icon_y_inc; } - if (draw_recurrence_icon) { + if (draw_recurrence_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1120,7 +1121,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_x += icon_x_inc; icon_y += icon_y_inc; } - if (draw_attach_icon) { + if (draw_attach_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1137,7 +1138,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_x += icon_x_inc; icon_y += icon_y_inc; } - if (draw_timezone_icon) { + if (draw_timezone_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1157,7 +1158,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, } - if (draw_meeting_icon) { + if (draw_meeting_icon && fit_in_event ()) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y @@ -1173,7 +1174,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, } /* draw categories icons */ - for (elem = categories_list; elem; elem = elem->next) { + for (elem = categories_list; elem && fit_in_event (); elem = elem->next) { gchar *category; GdkPixmap *pixmap = NULL; GdkBitmap *mask = NULL; @@ -1206,6 +1207,8 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_y += icon_y_inc; } + #undef fit_in_event + gdk_gc_set_clip_mask (gc, NULL); } diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 088f544aae..a0ac7098e1 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4684,8 +4684,6 @@ e_day_view_reshape_day_event (EDayView *day_view, if (num_icons > 0) { if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD) * num_icons) icons_offset = E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD * 2; - else - icons_offset = (E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD) * num_icons + E_DAY_VIEW_ICON_X_PAD; } if (!event->canvas_item) { -- cgit