mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
CHintBox: add member to get maximal required width
Origin commit data
------------------
Commit: 4bdd5e11a9
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-10-31 (Mon, 31 Oct 2016)
This commit is contained in:
@@ -259,7 +259,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const
|
||||
|
||||
//set required font and line size
|
||||
hb_font = !font_text ? hb_font : font_text;
|
||||
width = max(width, min(hb_font->getRenderWidth(Text), HINTBOX_MIN_WIDTH));
|
||||
width = getMaxWidth(Text, width);
|
||||
int h_line = hb_font->getHeight();
|
||||
|
||||
//init side picon object
|
||||
@@ -439,6 +439,11 @@ void CHintBox::scroll_down(const uint& hint_id)
|
||||
Scroll(true, hint_id);
|
||||
}
|
||||
|
||||
int CHintBox::getMaxWidth(const string& Text, const int& minWidth)
|
||||
{
|
||||
return max(HINTBOX_MIN_WIDTH, max(minWidth, min(hb_font->getRenderWidth(Text), (int)frameBuffer->getScreenWidth())));
|
||||
}
|
||||
|
||||
int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons)
|
||||
{
|
||||
int res = messages_return::none;
|
||||
|
Reference in New Issue
Block a user