From 66b3bd32b3992ad07e8c2e93de8a86fc55ecdbd0 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 3 Nov 2010 20:33:39 +0100 Subject: [PATCH] Display scoll percentage in statusbar (Closes #58). Thank's to acieroid. --- zathura.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zathura.c b/zathura.c index 15224e4..2369a5d 100644 --- a/zathura.c +++ b/zathura.c @@ -1514,7 +1514,7 @@ update_status(void) char* zoom_level = (Zathura.PDF.scale != 0) ? g_strdup_printf("%d%%", Zathura.PDF.scale) : g_strdup(""); char* goto_mode = (Zathura.Global.goto_mode == GOTO_LABELS) ? "L" : (Zathura.Global.goto_mode == GOTO_OFFSET) ? "O" : "D"; - char* status_text = g_strdup_printf("%s [%s] %s", zoom_level, goto_mode, Zathura.State.pages); + char* status_text = g_strdup_printf("%s [%s] %s (%d%%)", zoom_level, goto_mode, Zathura.State.pages, Zathura.State.scroll_percentage); gtk_label_set_markup((GtkLabel*) Zathura.Global.status_state, status_text); g_free(status_text); g_free(zoom_level); @@ -2214,6 +2214,8 @@ sc_scroll(Argument* argument) else new_value = (value + scroll_step) > max ? max : (value + scroll_step); + Zathura.State.scroll_percentage = max == 0 ? 0 : (new_value*100/max); + if(smooth_scrolling && !ss) { gdouble i;