mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
hintbox: supplement to fix getMaxWidth, hintbox have shadow default ON and shadow is added to width in cc_item (dx+sw). This break RestoreScreen
This commit is contained in:
@@ -441,11 +441,11 @@ void CHintBox::scroll_down(const uint& hint_id)
|
|||||||
|
|
||||||
int CHintBox::getMaxWidth(const string& Text, const string& Title, Font *font, const int& minWidth)
|
int CHintBox::getMaxWidth(const string& Text, const string& Title, Font *font, const int& minWidth)
|
||||||
{
|
{
|
||||||
int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth())));
|
int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth() - shadow_w)));
|
||||||
if (ccw_show_header){
|
if (ccw_show_header){
|
||||||
initHeader();
|
initHeader();
|
||||||
int max_title_width = max(res, ccw_head->getCaptionFont()->getRenderWidth(Title) + 2*w_indentation);
|
int max_title_width = max(res, ccw_head->getCaptionFont()->getRenderWidth(Title) + 2*w_indentation);
|
||||||
return min(max_title_width, (int)frameBuffer->getScreenWidth());
|
return min(max_title_width, (int)frameBuffer->getScreenWidth() - shadow_w);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
Reference in New Issue
Block a user