CMenuWidget::calcSize: Recalculation of min_width ...

... for adjustment to the osd resolution
This commit is contained in:
M. Liebmann
2017-03-13 09:20:31 +01:00
parent 828329452e
commit 30db40da1a
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;

View File

@@ -513,6 +513,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals
std::string iconfile;
int min_width;
int mwidth_save;
int width;
int height;
int hheight; // header