mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-07 14:26:00 +01:00
Display scoll percentage in statusbar (Closes #58).
Thank's to acieroid.
This commit is contained in:
parent
59b202ca4a
commit
66b3bd32b3
1 changed files with 3 additions and 1 deletions
|
@ -1514,7 +1514,7 @@ update_status(void)
|
||||||
char* zoom_level = (Zathura.PDF.scale != 0) ? g_strdup_printf("%d%%", Zathura.PDF.scale) : g_strdup("");
|
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" :
|
char* goto_mode = (Zathura.Global.goto_mode == GOTO_LABELS) ? "L" :
|
||||||
(Zathura.Global.goto_mode == GOTO_OFFSET) ? "O" : "D";
|
(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);
|
gtk_label_set_markup((GtkLabel*) Zathura.Global.status_state, status_text);
|
||||||
g_free(status_text);
|
g_free(status_text);
|
||||||
g_free(zoom_level);
|
g_free(zoom_level);
|
||||||
|
@ -2214,6 +2214,8 @@ sc_scroll(Argument* argument)
|
||||||
else
|
else
|
||||||
new_value = (value + scroll_step) > max ? max : (value + scroll_step);
|
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)
|
if(smooth_scrolling && !ss)
|
||||||
{
|
{
|
||||||
gdouble i;
|
gdouble i;
|
||||||
|
|
Loading…
Reference in a new issue