From bd13a7a0f41d3de7eaa002a5f2102ca01c41a698 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 23 Feb 2010 10:40:40 +0000 Subject: [PATCH] Calc %% from full screen width git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@402 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/da9704d7668db34626ad18f8833ad7865797e87a Author: [CST] Focus Date: 2010-02-23 (Tue, 23 Feb 2010) ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 92883a710..c4dbe2533 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -108,8 +108,11 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const int /*m if (mwidth > 100) /* warn about abuse until we found all offenders... */ fprintf(stderr, "CMenuWidget::Init (%s) (%s) mwidth over 100%%: %d\n", nameString.c_str(), Icon.c_str(), mwidth); - else - min_width = frameBuffer->getScreenWidth() * mwidth / 100; + else { + min_width = frameBuffer->getScreenWidth(true) * mwidth / 100; + if(min_width > (int) frameBuffer->getScreenWidth()) + min_width = frameBuffer->getScreenWidth(); + } /* set the max height to 9/10 of usable screen height debatable, if the callers need a possibility to set this */