aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view-main-item.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-06-30 02:15:58 +0800
committerMilan Crha <mcrha@redhat.com>2009-06-30 02:15:58 +0800
commit619c1cf37efc97be4bad9b028b3e8fbb080aefd4 (patch)
tree80a50d6ef93fde031030d85f4140715c08b6b60f /calendar/gui/e-day-view-main-item.c
parent3a428d7a5d9ecd49704a3fe98046994f5e426ee8 (diff)
downloadgsoc2013-evolution-619c1cf37efc97be4bad9b028b3e8fbb080aefd4.tar.gz
gsoc2013-evolution-619c1cf37efc97be4bad9b028b3e8fbb080aefd4.tar.zst
gsoc2013-evolution-619c1cf37efc97be4bad9b028b3e8fbb080aefd4.zip
Bug #238058 - Show more from summary for events with icons
Diffstat (limited to 'calendar/gui/e-day-view-main-item.c')
-rw-r--r--calendar/gui/e-day-view-main-item.c19
1 files changed, 11 insertions, 8 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);
}