// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #pragma once #include #include #include #include namespace style::toggle { const gui::Position toggle_x = 408; const gui::Position toggle_y = 24; } // namespace style::toggle namespace gui { class Toggle : public HBox { public: Toggle(Item *parent, int x, int y, int w, int h, UTF8 text, bool defaultState); ~Toggle() override = default; void doToggle(); bool getState() const noexcept; private: void buildToggle(); UTF8 text; Label *label = nullptr; Label *indicator = nullptr; bool state; static constexpr uint toggle_width = 40; }; } // namespace gui