]> Pileus Git - lackey/blobdiff - src/view.c
Add option to show and hide weekends.
[lackey] / src / view.c
index ceb9fec7328019bc154f067645e234fea3d68d80..a66fb853dcfe17ae59af7305744dab1f0754cb6d 100644 (file)
@@ -85,8 +85,9 @@ view_t *menu[] = {
 };
 
 /* Config data */
-int COMPACT = 0;
-int MORNING = 8;
+int COMPACT  = 0;
+int MORNING  = 8;
+int WEEKENDS = 0;
 
 /* Global data */
 edit_t EDIT = EDIT_NONE;
@@ -231,14 +232,6 @@ static int process(int key, mmask_t btn, int row, int col)
                        return set_view(active, NULL);
                case '?':    // help
                        return set_view(active, &help_view);
-               case 'c':
-                       COMPACT ^= 1;
-                       set_bool("view", 0, "compact", COMPACT);
-                       update_sizes();
-                       draw_view();
-                       return 1;
-               case 'e':    // edit
-                       return set_view(active, &edit_view);
        }
 
        /* Pass key to active view */
@@ -433,6 +426,8 @@ void view_config(const char *group, const char *name, const char *key, const cha
                        COMPACT = get_bool(value);
                } else if (match(key, "morning")) {
                        MORNING = get_number(value);
+               } else if (match(key, "weekends")) {
+                       WEEKENDS = get_bool(value);
                } else if (match(key, "active")) {
                        for (int i = 0; i < N_ELEMENTS(views); i++) {
                                if (match(value, views[i]->name)) {