~aleteoryx/muditaos

ref: 42ca53a732487f7dabf5e06ee4c03f73c329882b muditaos/module-apps/apps-common/widgets/BightnessBox.hpp -rw-r--r-- 1.6 KiB
42ca53a7 — Maciej-Mudita [MOS-686] Fix the accessibility of user files by MTP 3 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// 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 <BoxLayout.hpp>
#include <Label.hpp>
#include <module-gui/gui/widgets/Image.hpp>

namespace style::window::brightness
{
    const inline auto title_key = "brightness_text";

    namespace bar
    {
        constexpr inline auto brightness_levels = 5;
        constexpr inline auto left_offset       = 160;
        constexpr inline auto top_offset        = 520;
    } // namespace bar

    namespace box
    {
        constexpr inline auto top_offset = 405;
        constexpr inline auto height     = style::window_height - top_offset;
        constexpr inline auto width      = style::window_width;
    } // namespace box

    namespace title
    {
        constexpr inline auto width  = 213;
        constexpr inline auto height = 33;

        constexpr inline auto space_width  = 20;
        constexpr inline auto arrow_width  = 20;
        constexpr inline auto arrow_height = 20;

        constexpr inline auto label_width  = 135;
        constexpr inline auto label_height = 33;
        constexpr inline auto top_offset   = 463;
        constexpr inline auto left_offset  = 134;
    } // namespace title
} // namespace style::window::brightness

namespace gui
{
    class BrightnessBox : public HBox
    {
        void addArrow(const std::string &arrowName, Alignment::Horizontal aligment);

        void addBrightnessTitle(Item *parent, const std::string &text);

      public:
        BrightnessBox(Item *parent = nullptr, uint32_t x = 0, uint32_t y = 0);
    };
} // namespace gui