~aleteoryx/muditaos

ref: feec59f5346b7b993271b88d5e5f5495fe4a2895 muditaos/module-apps/application-desktop/windows/ChargingBatteryWindow.cpp -rw-r--r-- 1.3 KiB
feec59f5 — Lukasz Mastalerz [BH-1696] Notification when connect the device to the charger 2 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ChargingBatteryWindow.hpp"
#include "InputEvent.hpp"
#include "Names.hpp"

#include <gui/widgets/Image.hpp>
#include <log/log.hpp>
#include <service-appmgr/Controller.hpp>

namespace gui
{
    namespace
    {
        constexpr inline auto imgPositionX = 176;
        constexpr inline auto imgPositionY = 250;
    } // namespace

    ChargingBatteryWindow::ChargingBatteryWindow(app::ApplicationCommon *app)
        : AppWindow(app, app::window::name::charging_battery)
    {
        buildInterface();
        preventsAutoLock = true;
    }

    void ChargingBatteryWindow::rebuild()
    {
        destroyInterface();
        buildInterface();
    }

    void ChargingBatteryWindow::buildInterface()
    {
        AppWindow::buildInterface();
        navBar->setVisible(false);
        statusBar->setVisible(false);
        new gui::Image(this, imgPositionX, imgPositionY, 0, 0, "charging_battery_W_G");
    }

    void ChargingBatteryWindow::destroyInterface()
    {
        erase();
    }

    bool ChargingBatteryWindow::onInput(const InputEvent &inputEvent)
    {
        // Ignore all inputs
        return true;
    }

} /* namespace gui */