mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
CMenuWidget::calcSize: Use scale2Res() to adjust fixed sizes
Origin commit data
------------------
Branch: ni/coolstream
Commit: 2ed30486c4
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-03-13 (Mon, 13 Mar 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1112,35 +1112,35 @@ void CMenuWidget::calcSize()
|
||||
if (items[i]->iconName_Info_right) {
|
||||
frameBuffer->getIconSize(items[i]->iconName_Info_right, &wi, &hi);
|
||||
if ((wi > 0) && (hi > 0))
|
||||
wi += 10;
|
||||
wi += OFFSET_INNER_MID;
|
||||
else
|
||||
wi = 0;
|
||||
}
|
||||
int tmpw = items[i]->getWidth() + 10 + 10 + wi; /* 10 pixels to the left and right of the text */
|
||||
int tmpw = items[i]->getWidth() + 2*OFFSET_INNER_MID; /* 10 pixels to the left and right of the text */
|
||||
if (tmpw > width)
|
||||
width = tmpw;
|
||||
}
|
||||
hint_height = 0;
|
||||
if(g_settings.show_menu_hints && has_hints) {
|
||||
hint_height = 60; //TODO: rework calculation of hint_height
|
||||
hint_height = frameBuffer->scale2Res(60); //TODO: rework calculation of hint_height
|
||||
int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight();
|
||||
int h_tmp = 16 + 2*fheight;
|
||||
int h_tmp = OFFSET_INNER_LARGE + 2*fheight;
|
||||
/* assuming all hint icons has the same size ! */
|
||||
int iw, ih;
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_HINT_TVMODE, &iw, &ih);
|
||||
h_tmp = std::max(h_tmp, ih+10);
|
||||
h_tmp = std::max(h_tmp, ih+OFFSET_INNER_MID);
|
||||
hint_height = std::max(h_tmp, hint_height);
|
||||
}
|
||||
/* set the max height to 9/10 of usable screen height
|
||||
debatable, if the callers need a possibility to set this */
|
||||
height = (frameBuffer->getScreenHeight() - fbutton_height - hint_height) / 20 * 18; /* make sure its a multiple of 2 */
|
||||
|
||||
if(height > ((int)frameBuffer->getScreenHeight() - 10))
|
||||
height = frameBuffer->getScreenHeight() - 10;
|
||||
if(height > ((int)frameBuffer->getScreenHeight() - OFFSET_INNER_MID))
|
||||
height = frameBuffer->getScreenHeight() - OFFSET_INNER_MID;
|
||||
|
||||
int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(getName());
|
||||
if (neededWidth > width-48) {
|
||||
width= neededWidth+ 49;
|
||||
if (neededWidth > width - frameBuffer->scale2Res(48)) {
|
||||
width = neededWidth + frameBuffer->scale2Res(48)+1;
|
||||
}
|
||||
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
||||
|
||||
@@ -1174,7 +1174,7 @@ void CMenuWidget::calcSize()
|
||||
iconOffset = w;
|
||||
}
|
||||
|
||||
iconOffset += 10;
|
||||
iconOffset += OFFSET_INNER_MID;
|
||||
width += iconOffset;
|
||||
|
||||
if (fbutton_count)
|
||||
|
Reference in New Issue
Block a user