CMenuWidget::calcSize: Recalculation of min_width ...

... for adjustment to the osd resolution


Origin commit data
------------------
Branch: ni/coolstream
Commit: 30db40da1a
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-03-13 (Mon, 13 Mar 2017)



------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2017-03-13 09:20:31 +01:00
parent 7596c7d3d3
commit b5aa38dc56
2 changed files with 9 additions and 0 deletions

View File

@@ -600,6 +600,7 @@ void CMenuWidget::Init(const std::string &NameString, const std::string &Icon, c
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
//dimension
mwidth_save = mwidth;
min_width = 0;
width = 0; /* is set in paint() */
if (mwidth > 100){
@@ -1096,6 +1097,13 @@ void CMenuWidget::checkHints()
void CMenuWidget::calcSize()
{
// recalc min_width
min_width = 0;
int mwidth = std::min(mwidth_save, 100);
min_width = frameBuffer->getScreenWidth(true) * mwidth / 100;
if (min_width > (int)frameBuffer->getScreenWidth())
min_width = frameBuffer->getScreenWidth();
width = min_width;
int wi, hi;