From cb235bd82c5ebd0fbb33369145d04b23f783246c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Sep 2017 08:42:26 +0200 Subject: [PATCH] menue: user smaller vertical offset for hintboxes to keep it in sync with other vertical offsets * get bottom menu offset from CMenuSeparator()->getHeight() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/33a596d1754e8189d02ab929b2c3252f06d7a17b Author: vanhofen Date: 2017-09-25 (Mon, 25 Sep 2017) Origin message was: ------------------ - menue: user smaller vertical offset for hintboxes to keep it in sync with other vertical offsets * get bottom menu offset from CMenuSeparator()->getHeight() --- src/gui/widget/menue.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 1ab6a4e9d..9d7cd9f72 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1140,11 +1140,11 @@ void CMenuWidget::calcSize() hint_height = 0; if(g_settings.show_menu_hints && has_hints) { int lines = 2; - int text_height = 2*OFFSET_INNER_MID + lines*g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); + int text_height = 2*OFFSET_INNER_SMALL + lines*g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); /* assuming all hint icons has the same size ! */ int icon_width, icon_height; frameBuffer->getIconSize(NEUTRINO_ICON_HINT_TVMODE, &icon_width, &icon_height); - icon_height += 2*OFFSET_INNER_MID; + icon_height += 2*OFFSET_INNER_SMALL; hint_height = std::max(icon_height, text_height); } /* set the max height to 9/10 of usable screen height @@ -1202,11 +1202,12 @@ void CMenuWidget::calcSize() // shrink menu if less items height = std::min(height, hheight + maxItemHeight); /* - Always add a bottom offset. + Always add a bottom separator offset. Most menus has an upper offset too, which is added with the intro-items */ - height += OFFSET_INNER_MID; + CMenuItem *separator = new CMenuSeparator(); + height += separator->getHeight(); //scrollbar width scrollbar_width=0;