mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
cc_extra: add short methode to paintIcon with optional text content
This commit is contained in:
@@ -122,3 +122,51 @@ bool paintImage( const std::string& Image,
|
||||
|
||||
return box.isPicPainted();
|
||||
}
|
||||
|
||||
bool paintIcon ( const std::string& filename,
|
||||
const int& x,
|
||||
const int& y,
|
||||
const int& dx,
|
||||
const int& dy,
|
||||
const std::string& text,
|
||||
const int& font_style,
|
||||
const fb_pixel_t& color_body,
|
||||
const fb_pixel_t& color_text)
|
||||
{
|
||||
int h = 0;
|
||||
int w = 0;
|
||||
CFrameBuffer::getInstance()->getIconSize(filename.c_str(), &w, &h);
|
||||
|
||||
CComponentsText box( x,
|
||||
y,
|
||||
dx < 1 ? w : dx,
|
||||
dy < 1 ? h : dy,
|
||||
text,
|
||||
CTextBox::CENTER,
|
||||
*CNeutrinoFonts::getInstance()->getDynFont(w, h, text),
|
||||
font_style,
|
||||
NULL,
|
||||
CC_SHADOW_OFF,
|
||||
color_text,
|
||||
COL_FRAME_PLUS_0,
|
||||
color_body);
|
||||
|
||||
box.setBodyBGImageName(filename);
|
||||
box.doPaintBg(true);
|
||||
box.enableTboxSaveScreen(false);
|
||||
box.setCorner(0, 0);
|
||||
box.paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
return box.isPainted();
|
||||
}
|
||||
|
||||
bool paintIcon ( const std::string& filename,
|
||||
const int& x,
|
||||
const int& y,
|
||||
const std::string& text,
|
||||
const int& font_style,
|
||||
const fb_pixel_t& color_body,
|
||||
const fb_pixel_t& color_text)
|
||||
{
|
||||
return paintIcon (filename, x, y, 0, 0, text, font_style, color_body, color_text);
|
||||
}
|
||||
|
Reference in New Issue
Block a user