mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-03 10:51:05 +02:00
menue.h/cpp: add method to override menu position from user settings
Origin commit data
------------------
Commit: 341ce4a9c7
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-06-20 (Thu, 20 Jun 2019)
This commit is contained in:
@@ -638,6 +638,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;
|
||||
@@ -1454,8 +1455,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