CSignalBar: use dynamic fonts in signalbars

This commit is contained in:
2013-08-24 00:00:57 +02:00
parent af920c8988
commit 68b431f1b8
2 changed files with 14 additions and 5 deletions

View File

@@ -62,10 +62,16 @@ void CSignalBar::initVarSigBar()
append_h_offset = 4;
append_v_offset = 0;
sb_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL];
height = SB_MIN_HEIGHT;
sb_item_height = height;
sb_scale_height = sb_item_height;
dy_font = CNeutrinoFonts::getInstance();
int dx = 0;
sb_font = *dy_font->getDynFont(dx, height);
sb_item_height = sb_font->getHeight();
height = sb_item_height;
sb_scale_height = SB_MIN_HEIGHT;
sb_caption_color= COL_INFOBAR_TEXT;
initDimensions();
@@ -83,11 +89,12 @@ void CSignalBar::initVarSigBar()
void CSignalBar::initDimensions()
{
//set current required dimensions
int dx = 0;
sb_font = *dy_font->getDynFont(dx, height);
sb_vlbl_width = sb_font->getRenderWidth ("100%", true);
sb_lbl_width = sb_font->getRenderWidth ("XXXXX", true);
sb_scale_width = width-sb_vlbl_width-sb_lbl_width-corner_rad;
sb_item_height = max(sb_scale_height, sb_font->getHeight());
height = max(height, sb_item_height);
}
void CSignalBar::initSBItems()

View File

@@ -37,7 +37,7 @@
#include <gui/components/cc_item_progressbar.h>
#include <gui/components/cc_item_text.h>
#include <zapit/include/zapit/frontend_c.h>
#include <driver/neutrinofonts.h>
/// Basic class for signalbars
/*!
@@ -61,6 +61,8 @@ class CSignalBar : public CComponentsForm
CComponentsLabel *sb_lbl;
///object: current font
Font *sb_font;
///object: dynamic font object handler
CNeutrinoFonts *dy_font;
///property: text color, see also setTextColor()
fb_pixel_t sb_caption_color;