summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-05-13 15:10:47 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-05-13 15:10:47 +0200
commitca83e6569617aa19679844986ecb929d38fc7786 (patch)
treec722586446bc817e17eea472852a198b2c85b409
parentbd4f4a136fc218f0854f5ee5219149ce5b0acdb3 (diff)
downloadcalcurse-ca83e6569617aa19679844986ecb929d38fc7786.zip
Pass date parameter to ui_day_update_panel()
This allows for drawing appointment panels for days other than the current day. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/calcurse.h2
-rw-r--r--src/ui-day.c4
-rw-r--r--src/wins.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index 6333946..5da79e2 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -627,7 +627,7 @@ void ui_day_scroll_pad_down(int, int);
void ui_day_scroll_pad_up(int);
struct notify_app *apoint_check_next(struct notify_app *, long);
void apoint_switch_notify(struct apoint *);
-void ui_day_update_panel(int);
+void ui_day_update_panel(int, struct date);
void apoint_paste_item(struct apoint *, long);
/* args.c */
diff --git a/src/ui-day.c b/src/ui-day.c
index 847b2da..3562637 100644
--- a/src/ui-day.c
+++ b/src/ui-day.c
@@ -923,7 +923,7 @@ void ui_day_scroll_pad_up(int nb_events_inday)
}
/* Updates the Appointment panel */
-void ui_day_update_panel(int which_pan)
+void ui_day_update_panel(int which_pan, struct date slctd_date)
{
int title_xpos;
int bordr = 1;
@@ -931,10 +931,8 @@ void ui_day_update_panel(int which_pan)
int app_width = win[APP].w - bordr;
int app_length = win[APP].h - bordr - title_lines;
long date;
- struct date slctd_date;
/* variable inits */
- slctd_date = *ui_calendar_get_slctd_day();
title_xpos =
win[APP].w - (strlen(_(monthnames[slctd_date.mm - 1])) + 16);
if (slctd_date.dd < 10)
diff --git a/src/wins.c b/src/wins.c
index 4cb9b15..3ad7010 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -507,7 +507,7 @@ void wins_update_border(int flags)
void wins_update_panels(int flags)
{
if (flags & FLAG_APP)
- ui_day_update_panel(slctd_win);
+ ui_day_update_panel(slctd_win, *ui_calendar_get_slctd_day());
if (flags & FLAG_TOD)
ui_todo_update_panel(slctd_win);
if (flags & FLAG_CAL)