image background colors
Is this anywhere near correct? (This at least makes the background colors right for the rounded-corner images on the top row of links at fltk.org. Of course it still looks funny because valign top isn't obeyed...)
On Wed, Apr 21, 2010 at 05:01:11AM +0000, corvid wrote:
Is this anywhere near correct?
It is definately better than what we have now, but somehow this image background handling is a bit of a hack all together. Basically the Image Widget should get the background color via Widget::getBgColor() at drawing time. That would avoid any special handling in html.cc and would allow to modify the background color by setting a different style. However I can't see any easy way to achive this atm.
(This at least makes the background colors right for the rounded-corner images on the top row of links at fltk.org. Of course it still looks funny because valign top isn't obeyed...)
diff -r 3e01d83fd6d1 src/html.cc --- a/src/html.cc Wed Apr 21 03:46:20 2010 +0000 +++ b/src/html.cc Wed Apr 21 04:52:00 2010 +0000 @@ -2119,7 +2119,10 @@
/* Add a new image widget to this page */ Image = a_Image_new(alt_ptr, 0); - if (HT2TB(html)->getBgColor()) + + if (html->styleEngine->style()->backgroundColor) + Image->bg_color =html->styleEngine->style()->backgroundColor->getColor(); + else if (HT2TB(html)->getBgColor()) Image->bg_color = HT2TB(html)->getBgColor()->getColor();
load_now = prefs.load_images ||
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
On Wed, Apr 21, 2010 at 10:28:46AM +0200, Johannes Hofmann wrote:
On Wed, Apr 21, 2010 at 05:01:11AM +0000, corvid wrote:
Is this anywhere near correct?
It is definately better than what we have now, but somehow this image background handling is a bit of a hack all together. Basically the Image Widget should get the background color via Widget::getBgColor() at drawing time. That would avoid any special handling in html.cc and would allow to modify the background color by setting a different style. However I can't see any easy way to achive this atm.
It seems that dw/imgbuf.hh supports RGBA images already. We probabely want to use them instead of just RGB with merged in background color. Otherwise we will have problems as in the following example (due to the shared image buffer): <div style="background-color: green"> <img src="http://www.libpng.org/pub/png/img_png/stefan_pal_rgba.png" /> </div> <div style="background-color: red"> <img src="http://www.libpng.org/pub/png/img_png/stefan_pal_rgba.png" /> </div> Cheers, Johannes
Johannes wrote:
On Wed, Apr 21, 2010 at 10:28:46AM +0200, Johannes Hofmann wrote:
On Wed, Apr 21, 2010 at 05:01:11AM +0000, corvid wrote:
Is this anywhere near correct?
It is definately better than what we have now, but somehow this image background handling is a bit of a hack all together. Basically the Image Widget should get the background color via Widget::getBgColor() at drawing time. That would avoid any special handling in html.cc and would allow to modify the background color by setting a different style. However I can't see any easy way to achive this atm.
It seems that dw/imgbuf.hh supports RGBA images already. We probabely want to use them instead of just RGB with merged in background color. Otherwise we will have problems as in the following example (due to the shared image buffer):
I played with this some time ago http://lists.auriga.wearlab.de/pipermail/dillo-dev/2008-May/004265.html and had some difficulties. I'll have to see whether I still have that code around somewhere...
On Sat, Apr 24, 2010 at 07:43:38PM +0000, corvid wrote:
Johannes wrote:
On Wed, Apr 21, 2010 at 10:28:46AM +0200, Johannes Hofmann wrote:
On Wed, Apr 21, 2010 at 05:01:11AM +0000, corvid wrote:
Is this anywhere near correct?
It is definately better than what we have now, but somehow this image background handling is a bit of a hack all together. Basically the Image Widget should get the background color via Widget::getBgColor() at drawing time. That would avoid any special handling in html.cc and would allow to modify the background color by setting a different style. However I can't see any easy way to achive this atm.
It seems that dw/imgbuf.hh supports RGBA images already. We probabely want to use them instead of just RGB with merged in background color. Otherwise we will have problems as in the following example (due to the shared image buffer):
I played with this some time ago http://lists.auriga.wearlab.de/pipermail/dillo-dev/2008-May/004265.html and had some difficulties.
I'll have to see whether I still have that code around somewhere...
That would be cool. I'd really like to remove the image background handling from src/* and use RGBA image buffers instead.
participants (2)
-
corvid@lavabit.com
-
Johannes.Hofmann@gmx.de