Fixed https://github.com/ManiaControl/ManiaControl/issues/131 Fixed https://github.com/ManiaControl/ManiaControl/issues/130 Fixed https://github.com/ManiaControl/ManiaControl/issues/129
This commit is contained in:
@ -61,7 +61,6 @@ class SidebarMenuManager implements UsageInformationAble, CallbackListener {
|
||||
} else {
|
||||
$posY = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SIDEBAR_POSY_TRACKMANIA);
|
||||
}
|
||||
|
||||
$pos = new Position();
|
||||
$pos->setX($posX);
|
||||
$pos->setY($posY);
|
||||
@ -69,6 +68,16 @@ class SidebarMenuManager implements UsageInformationAble, CallbackListener {
|
||||
return $pos;
|
||||
}
|
||||
|
||||
private function getElementCountbeforeAdminMenu(){
|
||||
$count = 0;
|
||||
foreach($this->menuEntries as $k => $entry){
|
||||
if($k < SidebarMenuManager::ORDER_ADMIN_MENU){
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns PositionObject of a menu item of the sidebar, or null if it's not found
|
||||
*
|
||||
@ -81,6 +90,10 @@ class SidebarMenuManager implements UsageInformationAble, CallbackListener {
|
||||
$itemMarginFactor = 1.2;
|
||||
$pos = $this->getSidebarPosition();
|
||||
|
||||
$count = $this->getElementCountbeforeAdminMenu();
|
||||
$pos->setY($pos->getY() + $itemSize * $itemMarginFactor * $count);
|
||||
|
||||
|
||||
if (isset($this->yPositions[$id])) {
|
||||
$pos->setY($this->yPositions[$id]);
|
||||
return $pos;
|
||||
|
Reference in New Issue
Block a user