diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2019-05-28 20:19:07 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2019-05-28 17:57:35 -0400 |
commit | 378db90adad6c502342459d8502b4fd9c614e45f (patch) | |
tree | 7098b3fa09c8cef983c639be12033b908b93a902 /src | |
parent | 3674127e8061b5f93cd32d6cfa99d3ba21a3a3f0 (diff) | |
download | calcurse-378db90adad6c502342459d8502b4fd9c614e45f.tar.gz calcurse-378db90adad6c502342459d8502b4fd9c614e45f.zip |
Fix sidebar width to accommodate calendar week column
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/calcurse.h | 2 | ||||
-rw-r--r-- | src/ui-calendar.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/calcurse.h b/src/calcurse.h index 72a0fa6..d32c534 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -117,7 +117,7 @@ #define NBUSERCOLORS 6 /* Side bar width acceptable boundaries. */ -#define SBARMINWIDTH 32 +#define SBARMINWIDTH 34 #define SBARMAXWIDTHPERC 50 /* Related to date manipulation. */ 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) { |