From efd502c8082c77c978d6a03426fdbfa10ee57c33 Mon Sep 17 00:00:00 2001 From: Deve Date: Mon, 17 Dec 2018 00:36:12 +0100 Subject: [PATCH] Use larger list for android in two more places --- src/states_screens/ghost_replay_selection.cpp | 10 ++++++++-- src/states_screens/online/networking_lobby.cpp | 13 +++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/states_screens/ghost_replay_selection.cpp b/src/states_screens/ghost_replay_selection.cpp index 628c5a40b..2af82358b 100644 --- a/src/states_screens/ghost_replay_selection.cpp +++ b/src/states_screens/ghost_replay_selection.cpp @@ -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" @@ -171,12 +172,17 @@ void GhostReplaySelection::init() { Screen::init(); m_cur_difficulty = race_manager->getDifficulty(); + + int icon_height = UserConfigParams::m_hidpi_enabled ? getHeight() / 15 + : getHeight() / 24; - int icon_height = 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 diff --git a/src/states_screens/online/networking_lobby.cpp b/src/states_screens/online/networking_lobby.cpp index a69ad445b..78fdc4448 100644 --- a/src/states_screens/online/networking_lobby.cpp +++ b/src/states_screens/online/networking_lobby.cpp @@ -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); - const int screen_width = irr_driver->getFrameSize().Width; - m_icon_bank->setScale(screen_width > 1280 ? 0.4f : 0.25f); + + + 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 // ---------------------------------------------------------------------------