From 378db90adad6c502342459d8502b4fd9c614e45f Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Tue, 28 May 2019 20:19:07 +0200 Subject: Fix sidebar width to accommodate calendar week column Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/ui-calendar.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/ui-calendar.c') diff --git a/src/ui-calendar.c b/src/ui-calendar.c index 97cabf4..6d301e6 100644 --- a/src/ui-calendar.c +++ b/src/ui-calendar.c @@ -392,7 +392,7 @@ draw_monthly_view(struct scrollwin *sw, struct date *current_day, /* offset for centering calendar in window */ w = wins_sbar_width() - 2; ofs_y = 0; - ofs_x = (w - monthw) / 2; + ofs_x = (w - monthw) / 2 + ((w - monthw) % 2); /* invalidate cache if a new month is selected */ if (yr * YEARINMONTHS + mo != monthly_view_cache_month) { @@ -441,10 +441,8 @@ draw_monthly_view(struct scrollwin *sw, struct date *current_day, slctd = !date_cmp(&c_day, &slctd_day); /* Next line, week over. */ - if (!w_day && j != first_day) { + if (!w_day && j != first_day) ofs_y++; - ofs_x = (w - monthw) / 2; - } /* Week number, beware of first and last week of the year. */ if (!w_day) { -- cgit v1.2.3-54-g00ecf