gui/widget/colorchooser.cpp: add getColor() member

This commit is contained in:
[CST] Focus
2013-07-10 19:32:04 +04:00
parent d6de6baebb
commit 1f02a0d49e
2 changed files with 8 additions and 6 deletions

View File

@@ -98,15 +98,16 @@ CColorChooser::CColorChooser(const neutrino_locale_t Name, unsigned char *R, uns
}
void CColorChooser::setColor()
{
frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, getColor());
}
fb_pixel_t CColorChooser::getColor()
{
int color = convertSetupColor2RGB(*(value[VALUE_R]), *(value[VALUE_G]), *(value[VALUE_B]));
int tAlpha = (value[VALUE_ALPHA]) ? (convertSetupAlpha2Alpha(*(value[VALUE_ALPHA]))) : 0;
int tAlpha = (value[VALUE_ALPHA]) ? (convertSetupAlpha2Alpha(*(value[VALUE_ALPHA]))) : 0xFF;
if(!value[VALUE_ALPHA]) tAlpha = 0xFF;
fb_pixel_t col = ((tAlpha << 24) & 0xFF000000) | color;
//((tAlpha << 24) & 0xFF000000) | ((color << 16) & 0x00FF0000) | (color & 0x0000FF00) | ((color >> 16) & 0xFF);
frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, col);
return (((tAlpha << 24) & 0xFF000000) | color);
}
int CColorChooser::exec(CMenuTarget* parent, const std::string &)

View File

@@ -67,6 +67,7 @@ class CColorChooser : public CMenuTarget
void hide();
int exec(CMenuTarget* parent, const std::string & actionKey);
fb_pixel_t getColor(void);
};