mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 07:05:39 +00:00
1c3135b726
Slight optimization to TextComponent (by guaranteeing always having a font).
27 lines
597 B
C++
27 lines
597 B
C++
#pragma once
|
|
|
|
#include "../GuiComponent.h"
|
|
#include "ImageComponent.h"
|
|
|
|
// A very simple "on/off" switch.
|
|
// Should hopefully be switched to use images instead of text in the future.
|
|
class SwitchComponent : public GuiComponent
|
|
{
|
|
public:
|
|
SwitchComponent(Window* window, bool state = false);
|
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
void render(const Eigen::Affine3f& parentTrans) override;
|
|
|
|
bool getState() const;
|
|
void setState(bool state);
|
|
|
|
virtual std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
private:
|
|
void onStateChanged();
|
|
|
|
ImageComponent mImage;
|
|
bool mState;
|
|
};
|