mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-19 14:40:57 -04:00
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <OptionSetting.hpp>
|
|
|
|
namespace gui
|
|
{
|
|
class SpinBoxOptionSettings : public option::Base
|
|
{
|
|
public:
|
|
SpinBoxOptionSettings(UTF8 text,
|
|
uint8_t value,
|
|
uint8_t maxValue,
|
|
std::function<bool(uint8_t)> updateCallback,
|
|
std::function<void(const UTF8 &text)> navBarTemporaryMode,
|
|
std::function<void()> navBarRestoreFromTemporaryMode,
|
|
bool indent = false);
|
|
|
|
[[nodiscard]] auto build() const -> ListItem * override;
|
|
|
|
private:
|
|
std::function<bool(uint8_t)> updateCallback;
|
|
std::function<void(const UTF8 &text)> navBarTemporaryMode = nullptr;
|
|
std::function<void()> navBarRestoreFromTemporaryMode = nullptr;
|
|
std::uint8_t maxValue;
|
|
std::uint8_t value;
|
|
UTF8 text;
|
|
bool indent = false;
|
|
};
|
|
} // namespace gui
|