aboutsummaryrefslogtreecommitdiff
path: root/src/narrative_window.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-01-05 22:46:45 +0100
committerThomas White <taw@physics.org>2018-01-05 22:46:45 +0100
commit80f80f612c92ee21199d7503cec5cb9227c4174c (patch)
tree92d59b71862989bb0eb6261c1a3d3d3f48068f6e /src/narrative_window.c
parent3a17352968dad0d44165dbb3513775005b516ca1 (diff)
Single monitor mode for slideshow
If we only have one monitor, page up/down should change slide instead of paragraph.
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r--src/narrative_window.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c
index 6968aa2..f0f4d32 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -392,6 +392,19 @@ static void ss_next_para(SCSlideshow *ss, void *vp)
sc_editor_set_cursor_para(nw->sceditor,
sc_editor_get_cursor_para(nw->sceditor)+1);
+
+ /* If we only have one monitor, don't try to do paragraph counting */
+ if ( ss->single_monitor ) {
+ int i, max;
+ max = sc_editor_get_num_paras(nw->sceditor);
+ for ( i=sc_editor_get_cursor_para(nw->sceditor); i<max; i++ ) {
+ SCBlock *ns;
+ sc_editor_set_cursor_para(nw->sceditor, i);
+ ns = sc_editor_get_cursor_bvp(nw->sceditor);
+ if ( ns != NULL ) break;
+ }
+ }
+
pr_clock_set_pos(nw->pr_clock, sc_editor_get_cursor_para(nw->sceditor),
sc_editor_get_num_paras(nw->sceditor));
ns = sc_editor_get_cursor_bvp(nw->sceditor);