Fix sidebar width to accommodate calendar week column
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
3674127e80
commit
378db90ada
@ -117,7 +117,7 @@
|
|||||||
#define NBUSERCOLORS 6
|
#define NBUSERCOLORS 6
|
||||||
|
|
||||||
/* Side bar width acceptable boundaries. */
|
/* Side bar width acceptable boundaries. */
|
||||||
#define SBARMINWIDTH 32
|
#define SBARMINWIDTH 34
|
||||||
#define SBARMAXWIDTHPERC 50
|
#define SBARMAXWIDTHPERC 50
|
||||||
|
|
||||||
/* Related to date manipulation. */
|
/* Related to date manipulation. */
|
||||||
|
@ -392,7 +392,7 @@ draw_monthly_view(struct scrollwin *sw, struct date *current_day,
|
|||||||
/* offset for centering calendar in window */
|
/* offset for centering calendar in window */
|
||||||
w = wins_sbar_width() - 2;
|
w = wins_sbar_width() - 2;
|
||||||
ofs_y = 0;
|
ofs_y = 0;
|
||||||
ofs_x = (w - monthw) / 2;
|
ofs_x = (w - monthw) / 2 + ((w - monthw) % 2);
|
||||||
|
|
||||||
/* invalidate cache if a new month is selected */
|
/* invalidate cache if a new month is selected */
|
||||||
if (yr * YEARINMONTHS + mo != monthly_view_cache_month) {
|
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);
|
slctd = !date_cmp(&c_day, &slctd_day);
|
||||||
|
|
||||||
/* Next line, week over. */
|
/* Next line, week over. */
|
||||||
if (!w_day && j != first_day) {
|
if (!w_day && j != first_day)
|
||||||
ofs_y++;
|
ofs_y++;
|
||||||
ofs_x = (w - monthw) / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Week number, beware of first and last week of the year. */
|
/* Week number, beware of first and last week of the year. */
|
||||||
if (!w_day) {
|
if (!w_day) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user