summaryrefslogtreecommitdiff
path: root/src/winwidget.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-02-06 21:59:25 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2010-02-06 21:59:25 +0100
commit4e20a8cea66e707846f78f7cf55806b131c71a61 (patch)
treed778eef0c5837c5cb6769251c999202b25fafa84 /src/winwidget.c
parente9ec78c5e0c7030433b89519a1a000f3a70d0787 (diff)
Add option to set image background to white or black
Diffstat (limited to 'src/winwidget.c')
-rw-r--r--src/winwidget.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index fe98e85..c494123 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -627,20 +627,27 @@ feh_create_checks(void)
eprintf
("Unable to create a teeny weeny imlib image. I detect problems");
- for (y = 0; y < 16; y += 8) {
- onoff = (y / 8) & 0x1;
- for (x = 0; x < 16; x += 8) {
- if (onoff)
- gib_imlib_image_fill_rectangle(checks, x, y, 8, 8, 144, 144, 144,
- 255);
- else
- gib_imlib_image_fill_rectangle(checks, x, y, 8, 8, 100, 100, 100,
- 255);
- onoff++;
- if (onoff == 2)
- onoff = 0;
+ if (strncmp(opt.image_bg, "white", 5) == 0)
+ gib_imlib_image_fill_rectangle(checks, 0, 0, 16, 16, 255, 255, 255, 255);
+ else if (strncmp(opt.image_bg, "black", 5) == 0)
+ gib_imlib_image_fill_rectangle(checks, 0, 0, 16, 16, 0, 0, 0, 255);
+ else {
+ for (y = 0; y < 16; y += 8) {
+ onoff = (y / 8) & 0x1;
+ for (x = 0; x < 16; x += 8) {
+ if (onoff)
+ gib_imlib_image_fill_rectangle(checks, x, y, 8, 8, 144, 144, 144,
+ 255);
+ else
+ gib_imlib_image_fill_rectangle(checks, x, y, 8, 8, 100, 100, 100,
+ 255);
+ onoff++;
+ if (onoff == 2)
+ onoff = 0;
+ }
}
}
+
checks_pmap = XCreatePixmap(disp, root, 16, 16, depth);
gib_imlib_render_image_on_drawable(checks_pmap, checks, 0, 0, 1, 0, 0);
gib_imlib_free_image_and_decache(checks);