IV for better row size (#3920)

* Smaller rows

* Bigger row

* Smaller row
This commit is contained in:
dumaosen 2019-05-17 03:21:56 +08:00 committed by Deve
parent 80be3a936a
commit 86a0d06f99
3 changed files with 6 additions and 7 deletions

View File

@ -145,9 +145,9 @@ void AddonsScreen::init()
getWidget<GUIEngine::ListWidget>("list_addons");
// This defines the row height !
m_icon_height = GUIEngine::getFontHeight() * 5 / 2;
m_icon_height = GUIEngine::getFontHeight() * 2;
// 128 is the height of the image file
m_icon_bank->setScale((float)GUIEngine::getFontHeight() / 64.0f);
m_icon_bank->setScale((float)GUIEngine::getFontHeight() / 72.0f);
w_list->setIcons(m_icon_bank, (int)(m_icon_height));
m_type = "kart";

View File

@ -137,7 +137,7 @@ void ServerSelection::init()
m_searcher->clearListeners();
m_searcher->addListener(this);
m_icon_bank->setScale((float)GUIEngine::getFontHeight() / 64.0f);
m_icon_bank->setScale((float)GUIEngine::getFontHeight() / 72.0f);
m_icon_bank->setTargetIconSize(128, 128);
video::ITexture* icon1 = irr_driver->getTexture(
@ -159,7 +159,7 @@ void ServerSelection::init()
m_icon_bank->addTextureAsSprite(tex);
}
int row_height = GUIEngine::getFontHeight() * 5 / 2;
int row_height = GUIEngine::getFontHeight() * 2;
m_server_list_widget->setIcons(m_icon_bank, row_height);
m_sort_desc = false;

View File

@ -69,9 +69,8 @@ void OptionsScreenInput::loadedFromFile()
m_icon_bank->addTextureAsSprite(icon3);
m_icon_bank->addTextureAsSprite(icon4);
// scale icons depending on screen resolution. the numbers below are a bit arbitrary
const int screen_width = irr_driver->getFrameSize().Width;
const float scale = 0.3f + 0.2f*std::max(0, screen_width - 640)/564.0f;
// scale icons depending on font height
const float scale = GUIEngine::getFontHeight() / 72.0f;
m_icon_bank->setScale(scale);
} // loadFromFile