Commit 48a29913 authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

Display scoll percentage in statusbar (Closes #58).

Thank's to acieroid.
parent 3b8efee3
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment