From 671568a19ea189b9e68de516423f3e85a07c4bd0 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 13 Mar 2017 09:20:36 +0100 Subject: [PATCH] CMenuWidget::calcSize: Use scale2Res() to adjust fixed sizes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2ed30486c47a6d13e852372347cd55d7734c3967 Author: Michael Liebmann Date: 2017-03-13 (Mon, 13 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 9511e5239..77ace6045 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -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)