Files
MuditaOS/module-apps/application-desktop/windows/PowerOffWindow.hpp
Piotr Tanski 288040d348 [EGD-3514] Fixed a crash on system language change. (#693)
- Fixed by invalidating internal states of running windows after destroying their interfaces.
2020-09-18 16:17:49 +02:00

43 lines
1.0 KiB
C++

#pragma once
#include <vector>
#include "AppWindow.hpp"
#include "gui/widgets/Label.hpp"
#include "gui/widgets/Image.hpp"
#include "gui/widgets/BottomBar.hpp"
namespace gui
{
class PowerOffWindow : public AppWindow
{
enum class State
{
PowerDown,
Return,
};
gui::Label *titleLabel = nullptr;
gui::Label *infoLabel = nullptr;
std::vector<gui::Label *> selectionLabels;
gui::Label *eventMgrLabel = nullptr;
gui::Image *powerImage = nullptr;
gui::Image *powerDownImage = nullptr;
State state = State::Return;
public:
PowerOffWindow(app::Application *app);
void onBeforeShow(ShowMode mode, SwitchData *data) override;
bool onInput(const InputEvent &inputEvent) override;
void rebuild() override;
void buildInterface() override;
void destroyInterface() override;
private:
void invalidate() noexcept;
};
} /* namespace gui */