mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
CHintBox: fix position in case of missing text
Without text, position was not complete calculated.
Only default position was used.
Origin commit data
------------------
Commit: e48cc87b6f
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-05-17 (Wed, 17 May 2017)
This commit is contained in:
@@ -162,6 +162,8 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string
|
|||||||
|
|
||||||
if (!Text.empty())
|
if (!Text.empty())
|
||||||
addHintItem(Text, text_mode, Picon, COL_MENUCONTENT_TEXT, hb_font);
|
addHintItem(Text, text_mode, Picon, COL_MENUCONTENT_TEXT, hb_font);
|
||||||
|
else
|
||||||
|
ReSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
CHintBox::~CHintBox()
|
CHintBox::~CHintBox()
|
||||||
@@ -312,13 +314,8 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const
|
|||||||
info_box->setPicture(Picon);
|
info_box->setPicture(Picon);
|
||||||
info_box->doPaintBg(false);
|
info_box->doPaintBg(false);
|
||||||
|
|
||||||
/* recalculate new hintbox height */
|
/* recalculate new hintbox dimensions and position*/
|
||||||
ReSize();
|
ReSize();
|
||||||
|
|
||||||
/* set hint box position general to center and refresh window */
|
|
||||||
setCenterPos(CC_ALONG_X);
|
|
||||||
y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2),
|
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const int& mode, Font* font_text, const fb_pixel_t& color_text, const int& style)
|
void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const int& mode, Font* font_text, const fb_pixel_t& color_text, const int& style)
|
||||||
@@ -350,6 +347,10 @@ void CHintBox::ReSize()
|
|||||||
h += item->getHeight();
|
h += item->getHeight();
|
||||||
}
|
}
|
||||||
height = min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, max(height,h)));
|
height = min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, max(height,h)));
|
||||||
|
|
||||||
|
/* set hint box position general to center and refresh window */
|
||||||
|
setCenterPos(CC_ALONG_X);
|
||||||
|
y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2),
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user