commit 6f97687fde3ddc05151875cbe817b06cf06a4651
parent 7e4550b91a510193e80ace2f4ebcdc1ba1f6d4b1
Author: afify <hassan@afify.dev>
Date: Thu, 15 Sep 2022 12:35:29 +0300
add progress bar
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -24,6 +24,9 @@ static const float linespacing = 1.4;
static const float usablewidth = 0.75;
static const float usableheight = 0.75;
+/* height of the presentation progress bar */
+static const int progressheight = 5;
+
static Mousekey mshortcuts[] = {
/* button function argument */
{ Button1, advance, {.i = +1} },
diff --git a/sent.c b/sent.c
@@ -539,6 +539,12 @@ xdraw()
0,
slides[idx].lines[i],
0);
+ if (idx != 0 && progressheight != 0) {
+ drw_rect(d,
+ 0, xw.h - progressheight,
+ (xw.w * idx)/(slidecount - 1), progressheight,
+ 1, 0);
+ }
drw_map(d, xw.win, 0, 0, xw.w, xw.h);
} else {
if (!(im->state & SCALED))