Adjusted the size and position of the various menus.

This commit is contained in:
Leon Styhre 2021-05-23 10:40:11 +02:00
parent 8f3ea88b7a
commit d6eba6ae24
7 changed files with 12 additions and 11 deletions

View file

@ -51,7 +51,7 @@ void GuiGamelistFilter::initializeMenu()
mMenu.addButton("BACK", "back", std::bind(&GuiGamelistFilter::applyFilters, this));
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2.0f,
Renderer::getScreenHeight() * 0.15f);
Renderer::getScreenHeight() * 0.13f);
// Save the initial filter values to be able to check later if any changes were made.
mInitialTextFilter = mTextFilterField->getValue();

View file

@ -70,8 +70,8 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window),
addChild(&mMenu);
addVersionInfo();
setSize(mMenu.getSize());
setPosition((Renderer::getScreenWidth() - mSize.x()) / 2,
Renderer::getScreenHeight() * 0.15f);
setPosition((Renderer::getScreenWidth() - mSize.x()) / 2.0f,
Renderer::getScreenHeight() * 0.13f);
}
GuiMenu::~GuiMenu()

View file

@ -107,7 +107,7 @@ GuiScraperMenu::GuiScraperMenu(Window* window, std::string title)
setSize(mMenu.getSize());
setPosition((Renderer::getScreenWidth() - mSize.x()) / 2,
Renderer::getScreenHeight() * 0.15f);
Renderer::getScreenHeight() * 0.13f);
}
GuiScraperMenu::~GuiScraperMenu()

View file

@ -41,7 +41,8 @@ GuiSettings::GuiSettings(
setSize(static_cast<float>(Renderer::getScreenWidth()),
static_cast<float>(Renderer::getScreenHeight()));
mMenu.setPosition((mSize.x() - mMenu.getSize().x()) / 2, Renderer::getScreenHeight() * 0.15f);
mMenu.setPosition((mSize.x() - mMenu.getSize().x()) / 2.0f,
Renderer::getScreenHeight() * 0.13f);
}
GuiSettings::~GuiSettings()

View file

@ -81,9 +81,9 @@ float MenuComponent::getButtonGridHeight() const
void MenuComponent::updateSize()
{
const float maxHeight = Renderer::getScreenHeight() * 0.75f;
const float maxHeight = Renderer::getScreenHeight() * 0.80f;
float height = TITLE_HEIGHT + mList->getTotalRowHeight() + getButtonGridHeight() +
(2 * Renderer::getScreenHeightModifier());
(2.0f * Renderer::getScreenHeightModifier());
if (height > maxHeight) {
height = TITLE_HEIGHT + getButtonGridHeight();
int i = 0;
@ -107,7 +107,7 @@ void MenuComponent::onSizeChanged()
{
mBackground.fitTo(mSize, Vector3f::Zero(), Vector2f(-32, -32));
// Update grid row/col sizes.
// Update grid row/column sizes.
mGrid.setRowHeightPerc(0, TITLE_HEIGHT / mSize.y());
mGrid.setRowHeightPerc(2, getButtonGridHeight() / mSize.y());

View file

@ -31,7 +31,7 @@ class MenuComponent : public GuiComponent
public:
MenuComponent(Window* window, std::string title,
const std::shared_ptr<Font>& titleFont = Font::get(FONT_SIZE_LARGE));
virtual ~MenuComponent(); // just calls save();
virtual ~MenuComponent();
void save();
void onSizeChanged() override;

View file

@ -366,8 +366,8 @@ private:
});
}
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2,
Renderer::getScreenHeight() * 0.15f);
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2.0f,
Renderer::getScreenHeight() * 0.13f);
addChild(&mMenu);
}