summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Seltzer <MorganSeltzer000@gmail.com>2021-06-14 15:51:46 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2021-08-07 13:37:29 -0400
commit61ed5f835cae29ce6405ec34a7e310d5ea90327b (patch)
treebf45e923748bbdbd509b755a50a9b9e6a0f1f89b
parent31b3a5390bf7b8bfb6271f22703ccd022a8b538f (diff)
downloadcalcurse-61ed5f835cae29ce6405ec34a7e310d5ea90327b.tar.gz
calcurse-61ed5f835cae29ce6405ec34a7e310d5ea90327b.zip
Fixed sidebar config sometime not increasing width
The sidebar has a numerical mimumum width that is statically defined, and users may set the width of the sidebar in config by incrementing the percentage of the screen between this minimum and a maximum value of 50%. However, internally the mimimum percentage could be set as low as zero, and while that did not decrease the sidebar size below the numerical minimum width, did mean that between 0 and the mimimum width increasing the percentage had no visual effect to indicate change. Now the mimimum percent is not decremented below the mimimum width. Signed-off-by: Morgan Seltzer <MorganSeltzer000@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/vars.c2
-rw-r--r--src/wins.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/vars.c b/src/vars.c
index df27fbc..ac0fb4f 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -175,6 +175,8 @@ void vars_init(void)
ui_calendar_set_first_day_of_week(MONDAY);
+ wins_set_sbar_width(col * SBARMINWIDTH / 100);
+
/* Pad structure to scroll text inside the appointment panel */
apad.length = 1;
apad.first_onscreen = 0;
diff --git a/src/wins.c b/src/wins.c
index d66ec65..fa4874b 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -229,7 +229,7 @@ void wins_sbar_winc(void)
void wins_sbar_wdec(void)
{
- if (sbarwidth_perc > 0)
+ if (col * sbarwidth_perc / 100 > SBARMINWIDTH)
sbarwidth_perc--;
}