From: Daniel Carl Date: Sat, 20 Apr 2013 14:25:26 +0000 (+0200) Subject: Added rounding to the percent of page in status bar. X-Git-Url: https://git.owens.tech/git.owens.tech/git.owens.tech/git?a=commitdiff_plain;h=ffda1a42d9d3108bae4a5673c5a32aa239f3b352;p=vimb.git Added rounding to the percent of page in status bar. If the user scrolled to 1% of the page there was 0% shown and with 50G vimb browser showed 49% in status bar. This patch adapts the rounding of the values in the status bar so that they fit to the done scrolling. --- diff --git a/src/main.c b/src/main.c index cb0e14a..caca584 100644 --- a/src/main.c +++ b/src/main.c @@ -18,6 +18,7 @@ */ #include +#include #include "main.h" #include "util.h" #include "command.h" @@ -306,7 +307,7 @@ void vb_update_statusbar() /* show the scroll status */ max = gtk_adjustment_get_upper(vb.gui.adjust_v) - gtk_adjustment_get_page_size(vb.gui.adjust_v); - val = (int)(gtk_adjustment_get_value(vb.gui.adjust_v) / max * 100); + val = (int)floor(0.5 + (gtk_adjustment_get_value(vb.gui.adjust_v) / max * 100)); if (max == 0) { g_string_append(status, " All");