mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-27 01:36:59 -04:00
[EGD-3789] OptionSetting intoduced as a base to handle settings windows [EGD-3789] added icons on/off/bt/right arrow [EGD-3789] btn_ok icon used
38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "OptionWindow.hpp"
|
|
#include "Application.hpp"
|
|
|
|
namespace gui
|
|
{
|
|
enum class RightIcon : uint8_t
|
|
{
|
|
Disabled,
|
|
Enabled,
|
|
Border,
|
|
On,
|
|
Off,
|
|
Bt
|
|
};
|
|
|
|
class OptionSettings : public option::Base
|
|
{
|
|
private:
|
|
UTF8 text;
|
|
std::function<bool(Item &)> activatedCallback = nullptr;
|
|
std::function<bool(Item &)> focusCb = nullptr;
|
|
AppWindow *app = nullptr;
|
|
RightIcon rIcon = RightIcon::Disabled;
|
|
|
|
public:
|
|
OptionSettings(const UTF8 text,
|
|
std::function<bool(Item &)> cb,
|
|
std::function<bool(Item &)> cbFocus,
|
|
AppWindow *app,
|
|
RightIcon rIcon = RightIcon::Disabled)
|
|
: text(text), activatedCallback(std::move(cb)), focusCb(std::move(cbFocus)), app(app), rIcon(rIcon)
|
|
{}
|
|
[[nodiscard]] auto build() const -> Item * override;
|
|
};
|
|
} // namespace gui
|