mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
neutrino: add possibility to specify minimal menu width
A static window width was specified in pixels before, which is
"problematic". Then it was ignored and menus were automatically
sized to their largest menu item.
Due to popular demand, add the possibility to specify a minimal
window width in percent of screen width. If set to 0 (default),
menus will autosize as before.
Main menu is set to 22% screenwidth.
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@288 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Commit: 18dca0f47d
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2010-02-07 (Sun, 07 Feb 2010)
This commit is contained in:
@@ -100,7 +100,7 @@ CMenuWidget::CMenuWidget(const char* Name, const std::string & Icon, const int m
|
||||
Init(Icon, mwidth, mheight);
|
||||
}
|
||||
|
||||
void CMenuWidget::Init(const std::string & Icon, const int /*mwidth*/, const int /*mheight*/)
|
||||
void CMenuWidget::Init(const std::string & Icon, const int mwidth, const int /*mheight*/)
|
||||
{
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
iconfile = Icon;
|
||||
@@ -108,6 +108,11 @@ void CMenuWidget::Init(const std::string & Icon, const int /*mwidth*/, const int
|
||||
needed_width = 0; /* is set in addItem() */
|
||||
width = 0; /* is set in paint() */
|
||||
|
||||
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
|
||||
needed_width = frameBuffer->getScreenWidth() * mwidth / 100;
|
||||
|
||||
/* set the max height to 9/10 of usable screen height
|
||||
debatable, if the callers need a possibility to set this */
|
||||
height = frameBuffer->getScreenHeight() / 20 * 18; /* make sure its a multiple of 2 */
|
||||
|
@@ -349,9 +349,10 @@ class CMenuWidget : public CMenuTarget
|
||||
|
||||
public:
|
||||
CMenuWidget();
|
||||
/* TODO: mwidth and mheight are not used anymore. remove if nobody misses them */
|
||||
CMenuWidget(const char* Name, const std::string & Icon = "", const int mwidth = 400, const int mheight = 576);
|
||||
CMenuWidget(const neutrino_locale_t Name, const std::string & Icon = "", const int mwidth = 400, const int mheight = 576);
|
||||
/* TODO: mheight is not used anymore. remove if nobody misses it */
|
||||
/* mwidth (minimum width) in percent of screen width */
|
||||
CMenuWidget(const char* Name, const std::string & Icon = "", const int mwidth = 0, const int mheight = 576);
|
||||
CMenuWidget(const neutrino_locale_t Name, const std::string & Icon = "", const int mwidth = 0, const int mheight = 576);
|
||||
~CMenuWidget();
|
||||
|
||||
virtual void addItem(CMenuItem* menuItem, const bool defaultselected = false);
|
||||
|
Reference in New Issue
Block a user