summaryrefslogtreecommitdiff
path: root/src/wins.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-11-25 10:47:47 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-11-25 18:33:29 +0100
commit4d0c095947ed30d4f32e6db27eddbc4719fbcf9b (patch)
tree1f8d4a305fc0e80ee0801a2b8fa8f65699a868d6 /src/wins.c
parentedf3903ac840b1889b9bdd687965453a7e26b7ee (diff)
downloadcalcurse-4d0c095947ed30d4f32e6db27eddbc4719fbcf9b.zip
Add compact panels support
Add a configuration option that allows for switching to compact panel mode. In this mode, all window labels are hidden, so that there's more space for actual information. This patch doesn't add a configuration menu entry and doesn't add any documentation. Implements FR#7. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/wins.c')
-rw-r--r--src/wins.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/wins.c b/src/wins.c
index 45da1d3..3e94aba 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -239,7 +239,8 @@ void wins_slctd_next(void)
static void wins_init_panels(void)
{
- win[CAL].p = newwin(CALHEIGHT, wins_sbar_width(), win[CAL].y, win[CAL].x);
+ win[CAL].p = newwin(CALHEIGHT + (conf.compact_panels ? 2 : 4),
+ wins_sbar_width(), win[CAL].y, win[CAL].x);
wins_show(win[CAL].p, _("Calendar"));
win[APP].p = newwin(win[APP].h, win[APP].w, win[APP].y, win[APP].x);
@@ -356,11 +357,14 @@ void wins_show(WINDOW * win, const char *label)
int width = getmaxx(win);
box(win, 0, 0);
- mvwaddch(win, 2, 0, ACS_LTEE);
- mvwhline(win, 2, 1, ACS_HLINE, width - 2);
- mvwaddch(win, 2, width - 1, ACS_RTEE);
- print_in_middle(win, 1, 0, width, label);
+ if (!conf.compact_panels) {
+ mvwaddch(win, 2, 0, ACS_LTEE);
+ mvwhline(win, 2, 1, ACS_HLINE, width - 2);
+ mvwaddch(win, 2, width - 1, ACS_RTEE);
+
+ print_in_middle(win, 1, 0, width, label);
+ }
}
/*
@@ -390,7 +394,7 @@ void wins_get_config(void)
}
win[CAL].w = wins_sbar_width();
- win[CAL].h = CALHEIGHT;
+ win[CAL].h = CALHEIGHT + (conf.compact_panels ? 2 : 4);
if (layout <= 4) { /* APPOINTMENT is the biggest panel */
win[APP].w = col - win[CAL].w;