Messages: add option to change size of message text

Include default size and localized setup.

TODO: localize for nederlands and slovak, current english only.


Origin commit data
------------------
Commit: 4988df1dd9
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-11-20 (Sun, 20 Nov 2016)
This commit is contained in:
2016-11-20 01:08:14 +01:00
parent 5d258a58dd
commit ae117fae66
9 changed files with 32 additions and 4 deletions

View File

@@ -164,6 +164,13 @@ const SNeutrinoSettings::FONT_TYPES other_font_sizes[] =
};
size_t other_font_items = sizeof(other_font_sizes)/sizeof(other_font_sizes[0]);
const SNeutrinoSettings::FONT_TYPES msgtext_font_sizes[] =
{
SNeutrinoSettings::FONT_TYPE_MESSAGE_TEXT
};
size_t msgtext_font_items = sizeof(msgtext_font_sizes)/sizeof(msgtext_font_sizes[0]);
font_sizes_groups font_sizes_groups[] =
{
{LOCALE_FONTMENU_MENU , menu_font_items , menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS },
@@ -172,6 +179,7 @@ font_sizes_groups font_sizes_groups[] =
{LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS },
{LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS },
{LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS },
{LOCALE_FONTMENU_MESSAGES , msgtext_font_items , msgtext_font_sizes , "fontsize.msg", LOCALE_MENU_HINT_MESSAGE_FONTS },
{LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS }
};
#define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0]))
@@ -205,7 +213,8 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] =
{LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2},
{LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0},
{LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0},
{LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0}
{LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0},
{LOCALE_FONTSIZE_MESSAGE_TEXT , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}
};
int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)

View File

@@ -36,7 +36,7 @@
#include "hintbox.h"
#include <system/debug.h>
#define MSG_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MESSAGE_TEXT]
/**
x width ccw_head [relevant for CHintBox, CMsgBox. not enabled in CHint class]
@@ -132,7 +132,7 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string
timeout = HINTBOX_DEFAULT_TIMEOUT;
w_indentation = indent;
hb_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO];
hb_font = MSG_FONT;
//enable shadow
shadow = true;
@@ -321,7 +321,7 @@ void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const in
CComponentsInfoBox *obj_text = static_cast<CComponentsInfoBox*>(ccw_body->getCCItem(id));
//set required font and line size
Font* font = font_text == NULL ? g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] : font_text;
Font* font = font_text == NULL ? MSG_FONT : font_text;
if (obj_text)
obj_text->setText(Text, mode, font, color_text, style);
}