]> Pileus Git - lackey/blobdiff - views/events.c
Add bit flags for event and todo line items
[lackey] / views / events.c
index 8b1c7aafdf5748cbaababba3d76e86fb0313509e..e254ffbf6805b1e6003131d0f97de087f2efc732 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
+ * Copyright (C) 2012-2013 Andy Spencer <andy753421@gmail.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #include <ncurses.h>
 
-#include <util.h>
-#include <date.h>
-#include <cal.h>
-#include <view.h>
+#include "util.h"
+#include "date.h"
+#include "cal.h"
+#include "view.h"
 
 /* Static data */
 static WINDOW *win;
@@ -50,6 +50,7 @@ void events_draw(void)
        date_t cur   = {YEAR, MONTH, DAY-1,  0, 0};
        date_t end   = {YEAR, MONTH, DAY,   24, 0};
        add_days(&end.year, &end.month, &end.day, days);
+       cal_load(YEAR, MONTH, DAY, days);
 
        int      row   = 0;
        int      count = 0;
@@ -68,15 +69,15 @@ void events_draw(void)
                                row++;
                        if (newdate) {
                                wday_t wday = day_of_week(next.year, next.month, next.day);
-                               wattron(win, A_UNDERLINE);
+                               wattron(win, A_BOLD);
                                mvwprintw(win, row-line, 0,  "%04d-%02d-%02d",
                                        next.year, next.month+1, next.day+1);
                                mvwprintw(win, row-line, 13, "%s, %s %d",
                                        day_to_string(wday), month_to_string(next.month), next.day);
-                               wattroff(win, A_UNDERLINE);
+                               wattroff(win, A_BOLD);
                                row++;
                        }
-                       event_line(win, event, row++-line, 4, COLS-2, 1);
+                       event_line(win, event, row++-line, 4, COLS-4, SHOW_DETAILS);
                        if (event->name && event->desc)
                                mvwprintw(win, row++-line, 14, "%s", event->desc);
                        cur = next;