mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
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:
@@ -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]);
|
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
|
||||||
|
|
||||||
//dimension
|
//dimension
|
||||||
|
mwidth_save = mwidth;
|
||||||
min_width = 0;
|
min_width = 0;
|
||||||
width = 0; /* is set in paint() */
|
width = 0; /* is set in paint() */
|
||||||
if (mwidth > 100){
|
if (mwidth > 100){
|
||||||
@@ -1096,6 +1097,13 @@ void CMenuWidget::checkHints()
|
|||||||
|
|
||||||
void CMenuWidget::calcSize()
|
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;
|
width = min_width;
|
||||||
|
|
||||||
int wi, hi;
|
int wi, hi;
|
||||||
|
@@ -513,6 +513,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals
|
|||||||
std::string iconfile;
|
std::string iconfile;
|
||||||
|
|
||||||
int min_width;
|
int min_width;
|
||||||
|
int mwidth_save;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int hheight; // header
|
int hheight; // header
|
||||||
|
Reference in New Issue
Block a user