diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-02-11 08:44:23 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-02-11 08:44:23 +0100 |
commit | 32136757a7201676a7ba7aead76dd962bad3482d (patch) | |
tree | eeb50570518ce94315b094f1da96cbb25659f402 | |
parent | cbf1e7cc60a04bd2d0ee302eea0a331695e63c50 (diff) | |
download | feh-32136757a7201676a7ba7aead76dd962bad3482d.zip |
Fix --draw-actions alignment (when used with --draw-filename)
-rw-r--r-- | src/imlib.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/imlib.c b/src/imlib.c index 87352a9..ca999bf 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -1204,6 +1204,7 @@ feh_draw_actions(winwidget w) { static Imlib_Font fn = NULL; int tw = 0, th = 0; + int th_offset = 0; int max_tw = 0; int line_th = 0; Imlib_Image im = NULL; @@ -1256,6 +1257,14 @@ feh_draw_actions(winwidget w) line_th = th; th = (th*num_actions)+line_th; + /* This depends on feh_draw_filename internals... + * should be fixed some time + */ + if (opt.draw_filename && w->full_screen) + th_offset = line_th * 2; + else if (opt.draw_filename) + th_offset = line_th; + im = imlib_create_image(tw, th); if (!im) eprintf("Couldn't create image. Out of memory?"); @@ -1265,9 +1274,9 @@ feh_draw_actions(winwidget w) NULL, NULL, NULL, atab); gib_imlib_image_fill_rectangle(im, 0, 0, tw, th, 0, 0, 0, 0); - gib_imlib_text_draw(im, fn, NULL, 1, 1, "defined actions:", - IMLIB_TEXT_TO_RIGHT, 0, 0, 0, 255); gib_imlib_text_draw(im, fn, NULL, 2, 2, "defined actions:", + IMLIB_TEXT_TO_RIGHT, 0, 0, 0, 255); + gib_imlib_text_draw(im, fn, NULL, 1, 1, "defined actions:", IMLIB_TEXT_TO_RIGHT, 255, 255, 255, 255); for(i = 0; i < num_actions; i++) @@ -1286,7 +1295,7 @@ feh_draw_actions(winwidget w) free(line); } - gib_imlib_render_image_on_drawable(w->bg_pmap, im, 0, 0, 1, 1, 0); + gib_imlib_render_image_on_drawable(w->bg_pmap, im, 0, 0 + th_offset, 1, 1, 0); gib_imlib_free_image_and_decache(im); D_RETURN_(4); |