~aleteoryx/muditaos

ref: 4de9970108f7b1b454edec463c352b9a956cedec muditaos/module-apps/application-settings-new/widgets/OptionSetting.hpp -rw-r--r-- 904 bytes
4de99701 — Piotr Tański [EGD-5952] Changed service stack depths acc. to real usage 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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 "SpinBox.hpp"
#include "OptionWindow.hpp"
#include "Application.hpp"

#include <module-apps/options/type/OptionSetting.hpp>

namespace gui
{
    class SpinBoxOptionSettings : public option::OptionSettings
    {
      public:
        SpinBoxOptionSettings(UTF8 text,
                              uint8_t value,
                              uint8_t maxValue,
                              std::function<bool(uint8_t)> updateCallback,
                              std::function<bool(Item &)> focusChangedCallback = nullptr);

        [[nodiscard]] auto build() const -> ListItem * override;

      private:
        std::function<bool(uint8_t)> updateCallback;
        std::uint8_t maxValue;
        std::uint8_t value;
    };
} // namespace gui