From cfcf1a2934bc5d6c7b7985a7bc721a3250c7ee23 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 30 Jul 2013 13:38:10 +0200 Subject: Generalize search blitting in x11 to include page number. --- platform/x11/x11_main.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'platform/x11/x11_main.c') diff --git a/platform/x11/x11_main.c b/platform/x11/x11_main.c index 5de97187..8f992345 100644 --- a/platform/x11/x11_main.c +++ b/platform/x11/x11_main.c @@ -425,7 +425,7 @@ static void fillrect(int x, int y, int w, int h) XFillRectangle(xdpy, xwin, xgc, x, y, w, h); } -static void winblitsearch(pdfapp_t *app) +static void winblitstatusbar(pdfapp_t *app) { if (gapp.isediting) { @@ -435,6 +435,12 @@ static void winblitsearch(pdfapp_t *app) fillrect(0, 0, gapp.winw, 30); windrawstring(&gapp, 10, 20, buf); } + else if (showingpage) + { + char buf[42]; + snprintf(buf, sizeof buf, "Page %d/%d", gapp.pageno, gapp.pagecount); + windrawstringxor(&gapp, 10, 20, buf); + } } static void winblit(pdfapp_t *app) @@ -507,14 +513,7 @@ static void winblit(pdfapp_t *app) justcopied = 1; } - winblitsearch(app); - - if (showingpage) - { - char buf[42]; - snprintf(buf, sizeof buf, "Page %d/%d", gapp.pageno, gapp.pagecount); - windrawstringxor(&gapp, 10, 20, buf); - } + winblitstatusbar(app); } void winrepaint(pdfapp_t *app) @@ -934,7 +933,7 @@ int main(int argc, char **argv) if (dirty) winblit(&gapp); else if (dirtysearch) - winblitsearch(&gapp); + winblitstatusbar(&gapp); dirty = 0; transition_dirty = 0; dirtysearch = 0; -- cgit v1.2.3