mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 15:15:38 +00:00
fdbbf96d5e
--no-exit works again. Changed default screen dim time from 30 seconds to 120 seconds.
28 lines
751 B
C++
28 lines
751 B
C++
#include "MenuComponent.h"
|
|
|
|
MenuComponent::MenuComponent(Window* window, const char* title) : GuiComponent(window),
|
|
mBackground(window), mTitle(window), mList(window)
|
|
{
|
|
mBackground.setImagePath(":/frame.png");
|
|
|
|
mTitle.setFont(Font::get(FONT_SIZE_LARGE));
|
|
mTitle.setText(title);
|
|
mTitle.setCentered(true);
|
|
|
|
addChild(&mBackground);
|
|
addChild(&mTitle);
|
|
addChild(&mList);
|
|
|
|
setSize(Renderer::getScreenWidth() * 0.6f, Renderer::getScreenHeight() * 0.8f);
|
|
}
|
|
|
|
void MenuComponent::onSizeChanged()
|
|
{
|
|
mBackground.fitTo(mSize, Eigen::Vector3f::Zero(), Eigen::Vector2f(-2, -2));
|
|
|
|
mTitle.setSize(mSize.x(), (float)mTitle.getFont()->getHeight());
|
|
|
|
mList.setPosition(0, mTitle.getSize().y());
|
|
mList.setSize(mSize.x(), mSize.y() - mTitle.getSize().y());
|
|
}
|