~aleteoryx/muditaos

ref: 5b06da46a6dabf26d5bd37ffdbcc4ec63e57393f muditaos/module-apps/apps-common/popups/lock-popups/phone-lock-wallpapers/WallpaperLogo.cpp -rw-r--r-- 1.7 KiB
5b06da46 — rrandomsky [MOS-948] Fix for tethering popup was losing user unsaved data 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
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "WallpaperLogo.hpp"
#include <service-appmgr/Controller.hpp>
#include <Style.hpp>
#include <ImageBox.hpp>
#include <Image.hpp>

namespace gui
{
    WallpaperLogo::WallpaperLogo(Item *parent)
        : WallpaperBase(parent), notificationsPresenter(std::make_shared<NotificationTilesPresenter>())
    {
        wallpaperBox = new VBox(parent,
                                ::style::window::default_left_margin,
                                ::style::wallpaper::wallpaperBox::y,
                                ::style::window::default_body_width,
                                ::style::wallpaper::wallpaperBox::h);
        wallpaperBox->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Top));
        wallpaperBox->setEdges(RectangleEdge::None);

        auto logoImage = new ImageBox(wallpaperBox, new Image("logo", ImageTypeSpecifier::W_G));
        logoImage->setMinimumSizeToFitImage();
        logoImage->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Top));
        logoImage->setMargins(Margins(0, style::logo::logoTopMarigin, 0, style::logo::logoBottomMarigin));

        new NotificationTilesBox(wallpaperBox, notificationsPresenter);
        hide();
    }

    void WallpaperLogo::show()
    {
        wallpaperBox->setVisible(true);
        wallpaperBox->resizeItems();
    }

    void WallpaperLogo::hide()
    {
        wallpaperBox->setVisible(false);
        wallpaperBox->resizeItems();
    }

    std::shared_ptr<NotificationsPresenter> WallpaperLogo::getNotificationsPresenter()
    {
        return notificationsPresenter;
    }

} /* namespace gui */