From 68b431f1b822011374f80b450d4261a23d05970d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 24 Aug 2013 00:00:57 +0200 Subject: [PATCH] CSignalBar: use dynamic fonts in signalbars --- src/gui/widget/signalbars.cpp | 15 +++++++++++---- src/gui/widget/signalbars.h | 4 +++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/signalbars.cpp b/src/gui/widget/signalbars.cpp index b65fb7078..d74750eb4 100644 --- a/src/gui/widget/signalbars.cpp +++ b/src/gui/widget/signalbars.cpp @@ -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() diff --git a/src/gui/widget/signalbars.h b/src/gui/widget/signalbars.h index 1d5eb64b3..c0f3bb779 100644 --- a/src/gui/widget/signalbars.h +++ b/src/gui/widget/signalbars.h @@ -37,7 +37,7 @@ #include #include #include - +#include /// 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;