[wiki] [sites] [sent] add progress bar patch || David Phillips

From: <git_AT_suckless.org>
Date: Sun, 07 Jan 2018 02:12:17 +0100

commit dad16211e161f748ecff226b700b6cf8ca57c1d3
Author: David Phillips <david_AT_sighup.nz>
Date: Sun Jan 7 14:11:16 2018 +1300

    [sent] add progress bar patch

diff --git a/tools.suckless.org/sent/patches/progress-bar.md b/tools.suckless.org/sent/patches/progress-bar.md
new file mode 100644
index 00000000..8809b635
--- /dev/null
+++ b/tools.suckless.org/sent/patches/progress-bar.md
_AT_@ -0,0 +1,21 @@
+Progress Bar
+============
+
+Description
+-----------
+
+This patch introduces a progress bar at the very bottom of non-image slides.
+Similar to the slide numbers patch, it may be useful for an audience to know
+how much more of a presentation they have to endure. One way of measuring this
+is to add a bar to the slides which indicate the presenter's progress based on
+slide count.
+
+Download
+--------
+
+* [sent-progress-bar-1.0.diff](sent-progress-bar-1.0.diff)
+
+Author
+------
+
+* David Phillips <david_AT_sighup.nz>
diff --git a/tools.suckless.org/sent/patches/sent-progress-bar-1.0.diff b/tools.suckless.org/sent/patches/sent-progress-bar-1.0.diff
new file mode 100644
index 00000000..9d0e7d2d
--- /dev/null
+++ b/tools.suckless.org/sent/patches/sent-progress-bar-1.0.diff
_AT_@ -0,0 +1,31 @@
+diff --git a/config.def.h b/config.def.h
+index 60eb376..25d89e0 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -19,6 +19,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
+index c50a572..046466e 100644
+--- a/sent.c
++++ b/sent.c
+_AT_@ -533,6 +533,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))
Received on Sun Jan 07 2018 - 02:12:17 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 07 2018 - 02:24:19 CET