mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
menue.h/cpp: add method to override menu position from user settings
This commit is contained in:
@@ -640,6 +640,7 @@ void CMenuWidget::Init(const std::string &NameString, const std::string &Icon, c
|
||||
//pos
|
||||
x = y = 0;
|
||||
height = 0;
|
||||
w_pos_mode = MENU_POS_PRESET;
|
||||
|
||||
//caption and icon
|
||||
nameString = NameString;
|
||||
@@ -1459,8 +1460,10 @@ void CMenuWidget::setMenuPos(const int& menu_width)
|
||||
int real_h = full_height + hint_h; // full_height includes footer_height : see calcSize
|
||||
int x_old = x;
|
||||
int y_old = y;
|
||||
//configured positions
|
||||
switch(g_settings.menu_pos)
|
||||
|
||||
//configured/custom positions
|
||||
int menu_pos = w_pos_mode == MENU_POS_PRESET ? g_settings.menu_pos : w_pos_mode;
|
||||
switch(menu_pos)
|
||||
{
|
||||
case MENU_POS_CENTER:
|
||||
x = offx + scr_x + ((scr_w - menu_width ) >> 1 );
|
||||
|
Reference in New Issue
Block a user