Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semi-transparent background for text inserts #60

Closed
ecraven opened this issue Aug 18, 2011 · 3 comments
Closed

semi-transparent background for text inserts #60

ecraven opened this issue Aug 18, 2011 · 3 comments
Assignees
Labels

Comments

@ecraven
Copy link

@ecraven ecraven commented Aug 18, 2011

It would be nice to have a semi-transparent background behind --info and --actions and other windows, to make that text more readable.

@ghost ghost assigned derf Aug 18, 2011
@livibetter
Copy link
Contributor

@livibetter livibetter commented Aug 18, 2011

The code is already there, just change a couple of numbers. I wonder if there is a reason that this hasn't not been done before.

diff --git a/src/imlib.c b/src/imlib.c
index e27db57..96d83cc 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -550,7 +550,7 @@ void feh_draw_info(winwidget w)

        gib_imlib_image_set_has_alpha(im, 1);
        gib_imlib_apply_color_modifier_to_rectangle(im, 0, 0, 290 * tw, 20 * th, NULL, NULL, NULL, atab);
-       gib_imlib_image_fill_rectangle(im, 0, 0, 290 * tw, 20 * th, 0, 0, 0, 0);
+       gib_imlib_image_fill_rectangle(im, 0, 0, 290 * tw, 20 * th, 0, 0, 0, 127);

        if (!info_pipe) {
                gib_imlib_text_draw(im, fn, NULL, 2, 2,
@@ -573,7 +573,7 @@ void feh_draw_info(winwidget w)
        }


-       gib_imlib_render_image_on_drawable(w->bg_pmap, im, 2,
+       gib_imlib_render_image_on_drawable(w->bg_pmap, im, 0,
                        w->h - (th * no_lines) - 2, 1, 1, 0);

        gib_imlib_free_image_and_decache(im);
@@ -1045,7 +1045,7 @@ void feh_draw_actions(winwidget w)

        gib_imlib_image_set_has_alpha(im, 1);
        gib_imlib_apply_color_modifier_to_rectangle(im, 0, 0, tw, th, NULL, NULL, NULL, atab);
-       gib_imlib_image_fill_rectangle(im, 0, 0, tw, th, 0, 0, 0, 0);
+       gib_imlib_image_fill_rectangle(im, 0, 0, tw, th, 0, 0, 0, 127);

        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);

But I did find a strange gap in info drawing, the X is shifted two pixels. Since the width is 290*tw, the info is almost always drawn beyond the screen width (at least in my screen).

The y is pulled up 2 pixels as well, but if removes, character like 'y' will touch the edge of window, it would look weird.

(Edit: there are more draw functions, I only changed these two. Maybe I should open a pull request with all changed and also command line option for turning the background on?)

@ecraven
Copy link
Author

@ecraven ecraven commented Aug 18, 2011

where can i find your changes? i didn't see them on your github fork.

@livibetter
Copy link
Contributor

@livibetter livibetter commented Aug 19, 2011

I didn't even commit locally. But it's here #61 with a little extra.

@derf derf closed this in a4794cb Aug 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.