Use larger list for android in two more places

This commit is contained in:
Deve 2018-12-17 00:36:12 +01:00
parent 093f815d2c
commit efd502c808
2 changed files with 19 additions and 4 deletions

View File

@ -19,6 +19,7 @@
#include "states_screens/ghost_replay_selection.hpp"
#include "config/player_manager.hpp"
#include "config/user_config.hpp"
#include "graphics/material.hpp"
#include "guiengine/CGUISpriteBank.hpp"
#include "karts/kart_properties.hpp"
@ -172,11 +173,16 @@ void GhostReplaySelection::init()
Screen::init();
m_cur_difficulty = race_manager->getDifficulty();
int icon_height = getHeight()/24;
int icon_height = UserConfigParams::m_hidpi_enabled ? getHeight() / 15
: getHeight() / 24;
int row_height = UserConfigParams::m_hidpi_enabled ? getHeight() / 12
: getHeight() / 24;
// 128 is the height of the image file
m_icon_bank->setScale(icon_height/128.0f);
m_icon_bank->setTargetIconSize(128, 128);
m_replay_list_widget->setIcons(m_icon_bank, (int)icon_height);
m_replay_list_widget->setIcons(m_icon_bank, (int)row_height);
refresh(/*reload replay files*/ false, /* update columns */ true);
} // init

View File

@ -129,8 +129,17 @@ void NetworkingLobby::loadedFromFile()
m_icon_bank->addTextureAsSprite(icon_3);
m_icon_bank->addTextureAsSprite(icon_4);
m_icon_bank->addTextureAsSprite(icon_5);
if (UserConfigParams::m_hidpi_enabled)
{
m_icon_bank->setScale(getHeight() / 15.0f / 128.0f);
}
else
{
const int screen_width = irr_driver->getFrameSize().Width;
m_icon_bank->setScale(screen_width > 1280 ? 0.4f : 0.25f);
}
} // loadedFromFile
// ---------------------------------------------------------------------------