Files
MuditaOS/module-apps/windows/Dialog.hpp
Radoslaw Wicik a8573a404c Apply new style
2020-03-17 10:03:16 +01:00

37 lines
789 B
C++

#pragma once
#include "AppWindow.hpp"
#include <Text.hpp>
#include <functional>
namespace gui
{
class Dialog : public AppWindow
{
Label *yes = nullptr, *no = nullptr;
Text *text = nullptr;
Image *icon = nullptr;
public:
struct Meta
{
std::string title;
UTF8 icon;
UTF8 text;
std::function<bool()> action;
} meta;
Dialog(app::Application *app, const std::string &name, const Meta &meta);
~Dialog() override = default;
bool onInput(const InputEvent &inputEvent) override;
void buildInterface() override;
void onBeforeShow(ShowMode mode, SwitchData *data) override;
void update(const Meta &meta);
};
}; // namespace gui