diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-01-14 18:49:19 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-01-14 18:49:19 -0300 |
commit | 0058f32eb536c7c286a6366da9e517e58dbe4a69 (patch) | |
tree | 18d6906cd799018ae517fa8dfae0e9a03c1cfe50 /src | |
parent | 952f0fed9ae8df6434d1b613b98fa48d2c698332 (diff) |
Fix: inherit bgcolor from parent widget (images). Also cleanups.
Diffstat (limited to 'src')
-rw-r--r-- | src/form.cc | 2 | ||||
-rw-r--r-- | src/html.cc | 7 | ||||
-rw-r--r-- | src/image.cc | 10 | ||||
-rw-r--r-- | src/image.hh | 3 |
4 files changed, 8 insertions, 14 deletions
diff --git a/src/form.cc b/src/form.cc index 2f8b320a..7d06f207 100644 --- a/src/form.cc +++ b/src/form.cc @@ -1947,8 +1947,6 @@ static Embed *Html_input_image(DilloHtml *html, const char *tag, int tagsize) (url = a_Html_url_new(html, attrbuf, NULL, 0))) { style_attrs = *html->styleEngine->style (); style_attrs.cursor = CURSOR_POINTER; - style_attrs.backgroundColor = - style::Color::create (HT2LT(html), S_TOP(html)->current_bg_color); /* create new image and add it to the button */ if ((Image = a_Html_add_new_image(html, tag, tagsize, url, false))) { diff --git a/src/html.cc b/src/html.cc index ffa213ae..c9bcac22 100644 --- a/src/html.cc +++ b/src/html.cc @@ -2034,10 +2034,13 @@ DilloImage *a_Html_add_new_image(DilloHtml *html, const char *tag, html->styleEngine->setNonCssHints(&props); /* Add a new image widget to this page */ - Image = a_Image_new(0, 0, alt_ptr, S_TOP(html)->current_bg_color); - if (add) + Image = a_Image_new(0, 0, alt_ptr, 0); + if (add) { DW2TB(html->dw)->addWidget((Widget*)Image->dw, html->styleEngine->style()); + } + if (DW2TB(html->dw)->getBgColor()) + Image->bg_color = DW2TB(html->dw)->getBgColor()->getColor(); load_now = a_UIcmd_get_images_enabled(html->bw) || (a_Capi_get_flags(url) & CAPI_IsCached); diff --git a/src/image.cc b/src/image.cc index 0edaf35c..95a7cf8b 100644 --- a/src/image.cc +++ b/src/image.cc @@ -27,7 +27,7 @@ using namespace dw::core; // Image to Object-Image macro -#define OI(Image) ((dw::Image*)(Image->dw)) +#define I2DW(Image) ((dw::Image*)(Image->dw)) /* @@ -44,8 +44,6 @@ DilloImage *a_Image_new(int width, Image->dw = (void*) new dw::Image(alt_text); Image->width = 0; Image->height = 0; - Image->cmap = NULL; - Image->in_type = DILLO_IMG_TYPE_NOTSET; Image->bg_color = bg_color; Image->ScanNumber = 0; Image->BitVec = NULL; @@ -94,11 +92,10 @@ void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url, _MSG("a_Image_set_parms: width=%d height=%d\n", width, height); bool resize = (Image->width != width || Image->height != height); - OI(Image)->setBuffer((Imgbuf*)v_imgbuf, resize); + I2DW(Image)->setBuffer((Imgbuf*)v_imgbuf, resize); if (!Image->BitVec) Image->BitVec = a_Bitvec_new(height); - Image->in_type = type; Image->width = width; Image->height = height; Image->State = IMG_SetParms; @@ -110,7 +107,6 @@ void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url, void a_Image_set_cmap(DilloImage *Image, const uchar_t *cmap) { _MSG("a_Image_set_cmap\n"); - Image->cmap = cmap; Image->State = IMG_SetCmap; } @@ -134,7 +130,7 @@ void a_Image_write(DilloImage *Image, uint_t y) dReturn_if_fail ( y < Image->height ); /* Update the row in DwImage */ - OI(Image)->drawRow(y); + I2DW(Image)->drawRow(y); a_Bitvec_set_bit(Image->BitVec, y); Image->State = IMG_Write; } diff --git a/src/image.hh b/src/image.hh index d4525ba2..7bc07ed6 100644 --- a/src/image.hh +++ b/src/image.hh @@ -38,10 +38,7 @@ struct _DilloImage { uint_t width; uint_t height; - const uchar_t *cmap; /* Color map (only for indexed) */ - DilloImgType in_type; /* Image Type */ int32_t bg_color; /* Background color */ - bitvec_t *BitVec; /* Bit vector for decoded rows */ uint_t ScanNumber; /* Current decoding scan */ ImageState State; /* Processing status */ |