~aleteoryx/muditaos

ref: 18a388633832b6cc4aeb1d2f8382d9210110993c muditaos/module-apps/application-settings/widgets/SpinBoxOptionSettings.hpp -rw-r--r-- 800 bytes
18a38863 — Mateusz Piesta [BH-862] Snooze settings 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
// 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::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