aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-11-27 17:48:14 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-11-27 17:48:14 +0800
commit1f74b320373be33b8527e336b480b66ebd51aae5 (patch)
tree28668713f4384a510d98d8df434662e82a39943a /calendar/gui/e-week-view.c
parentdd34eba30cd90659975dc8b56d00dfe36f243854 (diff)
downloadgsoc2013-evolution-1f74b320373be33b8527e336b480b66ebd51aae5.tar
gsoc2013-evolution-1f74b320373be33b8527e336b480b66ebd51aae5.tar.gz
gsoc2013-evolution-1f74b320373be33b8527e336b480b66ebd51aae5.tar.bz2
gsoc2013-evolution-1f74b320373be33b8527e336b480b66ebd51aae5.tar.lz
gsoc2013-evolution-1f74b320373be33b8527e336b480b66ebd51aae5.tar.xz
gsoc2013-evolution-1f74b320373be33b8527e336b480b66ebd51aae5.tar.zst
gsoc2013-evolution-1f74b320373be33b8527e336b480b66ebd51aae5.zip
** Fix for bug #214645
2007-11-27 Milan Crha <mcrha@redhat.com> ** Fix for bug #214645 * gui/e-week-view.c: (e_week_view_get_day_position), (e_week_view_convert_position_to_day): * gui/e-week-view-layout.c: (e_week_view_layout_event), (e_week_view_layout_get_span_position): Collapses non-working days to occupy one row and expand other days if possible. svn path=/trunk/; revision=34594
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r--calendar/gui/e-week-view.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 9d539cecba..47a939a4de 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1978,8 +1978,12 @@ e_week_view_get_day_position (EWeekView *week_view,
*day_w = week_view->col_widths[cell_x];
*day_h = week_view->row_heights[cell_y];
- if (cell_h == 2)
+
+ while (cell_h > 1) {
*day_h += week_view->row_heights[cell_y + 1];
+ cell_h --;
+ cell_y ++;
+ }
}
@@ -2214,7 +2218,7 @@ e_week_view_convert_position_to_day (EWeekView *week_view,
gint y)
{
gint col, row, grid_x = -1, grid_y = -1, week, day;
- gint weekend_col, box, weekend_box;
+ gint weekend_col;
/* First we convert it to a grid position. */
for (col = 0; col <= week_view->columns; col++) {
@@ -2249,12 +2253,17 @@ e_week_view_convert_position_to_day (EWeekView *week_view,
} else {
week = 0;
- box = grid_x * 3 + grid_y / 2;
- weekend_box = (5 + 7 - week_view->display_start_day) % 7;
- day = box;
- if (box > weekend_box
- ||( box == weekend_box && grid_y % 2 == 1))
- day++;
+ for (day = 0; day < 7; day ++) {
+ gint day_x = 0, day_y = 0, rows = 0;
+ e_week_view_layout_get_day_position (day, FALSE, 1, week_view->display_start_day, week_view->compress_weekend,
+ &day_x, &day_y, &rows);
+
+ if (grid_x == day_x && grid_y >= day_y && grid_y < day_y + rows)
+ break;
+ }
+
+ if (day == 7)
+ return -1;
}
return week * 7 + day;