mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
*neutrino menu classes: add member and numerations to manage menu position
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1954 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -803,9 +803,7 @@ void CMenuWidget::calcSize()
|
||||
if(hheight+itemHeightTotal < height)
|
||||
height=hheight+itemHeightTotal;
|
||||
|
||||
x = offx + frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth() - width ) >> 1 );
|
||||
y = offy + frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 1 );
|
||||
|
||||
//scrollbar width
|
||||
sb_width=0;
|
||||
if(total_pages > 1)
|
||||
sb_width=15;
|
||||
@@ -813,26 +811,7 @@ void CMenuWidget::calcSize()
|
||||
full_width = width+sb_width+SHADOW_OFFSET;
|
||||
full_height = height+RADIUS_LARGE-2+SHADOW_OFFSET;
|
||||
|
||||
switch(g_settings.menu_pos) {
|
||||
case 0: //DEFAULT_CENTER
|
||||
break;
|
||||
case 1: //TOP_LEFT
|
||||
y = offy + frameBuffer->getScreenY() + 10;
|
||||
x = offx + frameBuffer->getScreenX() + 10;
|
||||
break;
|
||||
case 2: //TOP_RIGHT
|
||||
y = offy + frameBuffer->getScreenY() + 10;
|
||||
x = offx + frameBuffer->getScreenX() + frameBuffer->getScreenWidth() - width - sb_width - 10;
|
||||
break;
|
||||
case 3: //BOTTOM_LEFT
|
||||
y = offy + frameBuffer->getScreenY() + frameBuffer->getScreenHeight() - height - 10;
|
||||
x = offx + frameBuffer->getScreenX() + 10;
|
||||
break;
|
||||
case 4: //BOTTOM_RIGHT
|
||||
y = offy + frameBuffer->getScreenY() + frameBuffer->getScreenHeight() - height - 10;
|
||||
x = offx + frameBuffer->getScreenX() + frameBuffer->getScreenWidth() - width - sb_width - 10;
|
||||
break;
|
||||
}
|
||||
setMenuPos(width - sb_width);
|
||||
}
|
||||
|
||||
void CMenuWidget::paint(bool save)
|
||||
@@ -864,6 +843,45 @@ void CMenuWidget::paint(bool save)
|
||||
paintItems();
|
||||
}
|
||||
|
||||
void CMenuWidget::setMenuPos(const int& menu_width)
|
||||
{
|
||||
int mn_width = menu_width;
|
||||
|
||||
int scr_x = frameBuffer->getScreenX();
|
||||
int scr_y = frameBuffer->getScreenY();
|
||||
int scr_w = frameBuffer->getScreenWidth();
|
||||
int scr_h = frameBuffer->getScreenHeight();
|
||||
|
||||
//configured positions
|
||||
switch(g_settings.menu_pos)
|
||||
{
|
||||
case MENU_POS_CENTER:
|
||||
x = offx + scr_x + ((scr_w - mn_width ) >> 1 );
|
||||
y = offy + scr_y + ((scr_h - height) >> 1 );
|
||||
break;
|
||||
|
||||
case MENU_POS_TOP_LEFT:
|
||||
y = offy + scr_y + 10;
|
||||
x = offx + scr_x + 10;
|
||||
break;
|
||||
|
||||
case MENU_POS_TOP_RIGHT:
|
||||
y = offy + scr_y + 10;
|
||||
x = offx + scr_x + scr_w - mn_width - 10;
|
||||
break;
|
||||
|
||||
case MENU_POS_BOTTOM_LEFT:
|
||||
y = offy + scr_y + scr_h - height - 10;
|
||||
x = offx + scr_x + 10;
|
||||
break;
|
||||
|
||||
case MENU_POS_BOTTOM_RIGHT:
|
||||
y = offy + scr_y + scr_h - height - 10;
|
||||
x = offx + scr_x + scr_w - mn_width - 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CMenuWidget::paintItems()
|
||||
{
|
||||
int item_height=height-(item_start_y-y);
|
||||
|
@@ -426,6 +426,8 @@ class CMenuWidget : public CMenuTarget
|
||||
void calcSize();
|
||||
void saveScreen();
|
||||
void restoreScreen();
|
||||
void setMenuPos(const int& menu_width);
|
||||
|
||||
public:
|
||||
CMenuWidget();
|
||||
/* mwidth (minimum width) in percent of screen width */
|
||||
@@ -461,6 +463,14 @@ class CMenuWidget : public CMenuTarget
|
||||
void setWizardMode(bool _from_wizard) { from_wizard = _from_wizard;};
|
||||
void enableFade(bool _enable) { fade = _enable; };
|
||||
void enableSaveScreen(bool enable);
|
||||
enum
|
||||
{
|
||||
MENU_POS_CENTER ,
|
||||
MENU_POS_TOP_LEFT ,
|
||||
MENU_POS_TOP_RIGHT ,
|
||||
MENU_POS_BOTTOM_LEFT ,
|
||||
MENU_POS_BOTTOM_RIGHT ,
|
||||
};
|
||||
};
|
||||
|
||||
class CPINProtection
|
||||
|
@@ -452,7 +452,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
||||
g_settings.casystem_display = configfile.getInt32("casystem_display", 2 );//mini ca mode default
|
||||
g_settings.scrambled_message = configfile.getBool("scrambled_message", true );
|
||||
g_settings.volume_pos = configfile.getInt32("volume_pos", 0 );
|
||||
g_settings.menu_pos = configfile.getInt32("menu_pos", 0 );
|
||||
g_settings.menu_pos = configfile.getInt32("menu_pos", CMenuWidget::MENU_POS_CENTER);
|
||||
g_settings.infobar_show_var_hdd = configfile.getBool("infobar_show_var_hdd" , true );
|
||||
g_settings.show_infomenu = configfile.getInt32("show_infomenu", 0 );
|
||||
g_settings.show_mute_icon = configfile.getInt32("show_mute_icon" ,0);
|
||||
|
Reference in New Issue
Block a user