]> Pileus Git - lackey/commitdiff
Make morning time configurable
authorAndy Spencer <andy753421@gmail.com>
Mon, 12 Jan 2015 17:30:33 +0000 (17:30 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 12 Jan 2015 17:30:33 +0000 (17:30 +0000)
src/view.c
src/view.h
views/day.c
views/week.c

index 8341e97aa7433a428aefec70f5246b152937a837..bcca151b38d6b23505357a0917bc1ed4a3fbaf63 100644 (file)
@@ -83,6 +83,7 @@ view_t *menu[] = {
 
 /* Config data */
 int COMPACT = 0;
+int MORNING = 8;
 
 /* Global data */
 edit_t EDIT = EDIT_NONE;
@@ -299,6 +300,8 @@ void view_config(const char *group, const char *name, const char *key, const cha
        if (match(group, "view")) {
                if (match(key, "compact")) {
                        COMPACT = get_bool(value);
+               } else if (match(key, "morning")) {
+                       MORNING = get_number(value);
                } else if (match(key, "active")) {
                        for (int i = 0; i < N_ELEMENTS(views); i++) {
                                if (match(value, views[i]->name)) {
index 03d79224e00b12ddf599d9525dd41b39800ccd89..d225323436b3e33163721ccc118631a6981b65e7 100644 (file)
@@ -42,6 +42,7 @@ typedef enum {
 
 /* Config data */
 extern int COMPACT; // reduce layout spacing
+extern int MORNING; // first line to display
 
 /* Global data */
 extern edit_t EDIT; // edit mode 0=cal 1=event 3=todo
index 3e75480724d2cd748c2bf65c434a3cf455b530c9..3d7e1953c226f100bd3664d9213da87338340fd2 100644 (file)
@@ -94,7 +94,7 @@ void day_init(WINDOW *_win)
        win   = _win; //    lines    cols    y  x
        times = derwin(win, LINES-2,      5, 0, 0);
        body  = derwin(win, LINES-2, COLS-5, 0, 5);
-       line  = 10*4; // 10:00
+       line  = MORNING*4;
 }
 
 /* Day size */
index 82b56b31a69aa50742fbc2b55605880bf009c978..9f972521ad8c220f994d5bcc8ca5fe51b8ab15f7 100644 (file)
@@ -36,7 +36,7 @@ void week_init(WINDOW *_win)
        win   = _win; //    lines    cols    y  x
        times = derwin(win, LINES-2,      5, 0, 0);
        body  = derwin(win, LINES-2, COLS-5, 0, 5);
-       line  = 10*4; // 10:00
+       line  = MORNING*4;
 }
 
 /* Week size */