diff options
author | Rob Kendrick <rjek@netsurf-browser.org> | 2006-03-22 01:06:05 +0000 |
---|---|---|
committer | Rob Kendrick <rjek@netsurf-browser.org> | 2006-03-22 01:06:05 +0000 |
commit | 190672dc9860975ca2ca106dd4372336d540a989 (patch) | |
tree | f683ace50b0dc7106256d27304f8eb4239354ba2 /render | |
parent | 07f691b3260fac5b312fb21a92e83cabc7fe54c3 (diff) | |
download | netsurf-190672dc9860975ca2ca106dd4372336d540a989.tar.gz netsurf-190672dc9860975ca2ca106dd4372336d540a989.tar.bz2 |
[project @ 2006-03-22 01:06:05 by rjek]
Replace check in selected checkboxes with a tick, also now black.
svn path=/import/netsurf/; revision=2148
Diffstat (limited to 'render')
-rw-r--r-- | render/html_redraw.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c index 23db55cb6..b225adb29 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -894,14 +894,14 @@ colour html_redraw_aa(colour c0, colour c1) */ #define WIDGET_BASEC 0xd9d9d9 -#define WIDGET_BLOBC 0x0000ff +#define WIDGET_BLOBC 0x000000 bool html_redraw_checkbox(int x, int y, int width, int height, bool selected) { int dark = html_redraw_darker(html_redraw_darker(WIDGET_BASEC)); int lite = html_redraw_lighter(html_redraw_lighter(WIDGET_BASEC)); - int z = width * 0.15; + double z = width * 0.15; if (z == 0) z = 1; @@ -915,17 +915,28 @@ bool html_redraw_checkbox(int x, int y, int width, int height, return false; if (selected) { - if (!plot.line(x + z + z, y + z + z, - x + width - z - z, y + height - z - z, - 2, WIDGET_BLOBC, false, false)) - return false; - - if (!plot.line(x - z - z + width, y + z + z, - x + z + z, y + height - z - z, - 2, WIDGET_BLOBC, false, false)) - return false; + if (width < 12 || height < 12) { + /* render a solid box instead of a tick */ + if (!plot.fill(x + z + z, y + z + z, + x + width - z, y + height - z, + WIDGET_BLOBC)) + return false; + } else { + /* render a tick, as it'll fit comfortably */ + if (!(plot.line(x + width - z, + y + z, + x + (z * 3), + y + height - z, + 2, WIDGET_BLOBC, false, false) && + + plot.line(x + (z * 3), + y + height - z, + x + z + z, + y + (height / 2), + 2, WIDGET_BLOBC, false, false))) + return false; + } } - return true; } |