mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-21 07:28:21 -04:00
* Moved ApplicationLauncher to separate files - declutering * WindowsStore renamed to WindowsFactory - Store needs to be splitted toavoid antipattern * Options window build dynamically onBeforeShow * Dialog windows dynamically built
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
#include "OptionsWindowOption.hpp"
|
|
#include <Label.hpp>
|
|
#include <Image.hpp>
|
|
#include <cassert>
|
|
|
|
namespace style::option
|
|
{
|
|
const gui::Position arrow_position_x = 408;
|
|
const gui::Position arrow_position_y = 24;
|
|
} // namespace style::option
|
|
|
|
namespace gui::option
|
|
{
|
|
auto Simple::build() const -> Item *
|
|
{
|
|
auto *label = new gui::Label(nullptr,
|
|
style::window::default_left_margin,
|
|
0,
|
|
style::window_width - 2 * style::window::default_left_margin,
|
|
style::window::label::big_h,
|
|
text);
|
|
style::window::decorateOption(label);
|
|
label->activatedCallback = activatedCallback;
|
|
if (arrow == Arrow::Enabled) {
|
|
new gui::Image(
|
|
label, style::option::arrow_position_x, style::option::arrow_position_y, 0, 0, "right_label_arrow");
|
|
}
|
|
return label;
|
|
}
|
|
|
|
} // namespace gui::option
|
|
|
|
namespace gui
|
|
{
|
|
[[nodiscard]] auto Option::build() const -> Item *
|
|
{
|
|
assert(option);
|
|
return option->build();
|
|
}
|
|
} // namespace gui
|