Commit cadfa64c authored by Supernature2k's avatar Supernature2k

fix menu size

parent b3a12ace
......@@ -40,7 +40,7 @@ GuiHashStart::GuiHashStart(Window* window)
mMenu.addButton(_("START"), "start",[this] {mState = 1;});
mMenu.addButton(_("BACK"), "back", [&] { delete this; });
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2, Renderer::getScreenHeight() * 0.15f);
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2, (Renderer::getScreenHeight() - mMenu.getSize().y()) / 2);
}
void GuiHashStart::start()
......
......@@ -48,7 +48,7 @@ GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window),
mMenu.addButton(_("START"), "start", std::bind(&GuiScraperStart::pressedStart, this));
mMenu.addButton(_("BACK"), "back", [&] { delete this; });
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2, Renderer::getScreenHeight() * 0.15f);
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2, (Renderer::getScreenHeight() - mMenu.getSize().y()) / 2);
}
void GuiScraperStart::pressedStart()
......
......@@ -40,6 +40,7 @@ public:
row.addElement(entryMenu, true);
row.addElement(makeArrow(mWindow), false);
mMenu.addRowWithHelp(row, label, help);
updatePosition();
};
inline void addSaveFunc(const std::function<void()>& func) { mSaveFuncs.push_back(func); };
inline void setSave(bool sav) { doSave = sav; };
......
......@@ -118,7 +118,7 @@ float MenuComponent::getButtonGridHeight() const
void MenuComponent::updateSize()
{
const float maxHeight = Renderer::getScreenHeight() * 0.85f;
const float maxHeight = Renderer::getScreenHeight() * 0.8f;
float height = TITLE_HEIGHT + mList->getTotalRowHeight() + getButtonGridHeight() + 2;
if(height > maxHeight)
{
......
......@@ -123,7 +123,7 @@ private:
});
}
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2, Renderer::getScreenHeight() * 0.15f);
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2, (Renderer::getScreenHeight() - mMenu.getSize().y()) / 2);
addChild(&mMenu);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment