From 02b590f6a23ab775535ab96614eb467156e8abe6 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Thu, 27 May 2021 12:32:41 +0200 Subject: sfeed_frames/sfeed_html: show the total counts and improve the title format This title format now matches the one with sfeed_curses. It shows the count to the most left and makes it more readable imho. It also works better when the titlebar is small. --- sfeed_frames.c | 9 +++++---- sfeed_html.c | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sfeed_frames.c b/sfeed_frames.c index f805e59..dc225d9 100644 --- a/sfeed_frames.c +++ b/sfeed_frames.c @@ -12,7 +12,7 @@ static struct feed *feeds; static char *line; static size_t linesize; static time_t comparetime; -static unsigned long totalnew; +static unsigned long totalnew, total; static void printfeed(FILE *fpitems, FILE *fpin, struct feed *f) @@ -54,6 +54,7 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) fputs(" ", fpitems); } f->total++; + total++; if (fields[FieldLink][0]) { fputs("\n\n\n" "\t\n" "\t\n" - "\tNewsfeed (", fpindex); - fprintf(fpindex, "%lu", totalnew); - fputs(")\n\t\n" + "\t(", fpindex); + fprintf(fpindex, "%lu/%lu", totalnew, total); + fputs(") - Newsfeed\n\t\n" "\n", fpindex); if (showsidebar) { fputs("\n" diff --git a/sfeed_html.c b/sfeed_html.c index d1e1b63..9a03901 100644 --- a/sfeed_html.c +++ b/sfeed_html.c @@ -12,7 +12,7 @@ static struct feed *feeds; static int showsidebar; static char *line; static size_t linesize; -static unsigned long totalnew; +static unsigned long totalnew, total; static time_t comparetime; static void @@ -55,6 +55,7 @@ printfeed(FILE *fp, struct feed *f) fputs(" ", stdout); } f->total++; + total++; if (fields[FieldLink][0]) { fputs("\n\t\n", stdout); } - fprintf(stdout, "\t\n\tNewsfeed (%lu)\n\n", - totalnew); + fprintf(stdout, "\t\n\t(%lu/%lu) - Newsfeed\n\n", + totalnew, total); return 0; } -- cgit v1.2.3