~aleteoryx/muditaos

ref: 8f0797218f2defa9266704a93cfff94322a38f51 muditaos/module-apps/application-calendar/widgets/CalendarDateItem.cpp -rw-r--r-- 1017 bytes
8f079721 — Mateusz Grzegorzek [EGD-5312] Add Time selection window 5 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "CalendarDateItem.hpp"
#include <module-apps/widgets/DateAndTimeStyle.hpp>
#include <module-apps/widgets/DateWidget.hpp>
#include <module-apps/widgets/WidgetsUtils.hpp>

namespace date_and_time = style::window::date_and_time;

namespace gui
{
    CalendarDateItem::CalendarDateItem()
    {
        setMinimumSize(style::window::default_body_width, date_and_time::height);
        setEdges(RectangleEdge::None);
        setMargins(Margins(date_and_time::leftMargin, date_and_time::topMargin, 0, 0));

        vBox = new VBox(this, 0, 0, 0, 0);
        vBox->setEdges(RectangleEdge::None);

        dateWidget = new DateWidget(vBox);

        onLoadCallback = [&](std::shared_ptr<EventsRecord> event) {
            dateWidget->loadData(TimePointToYearMonthDay(event->date_from));
        };

        passDefaultCallbacksFromListItem(this, vBox);
    }
} /* namespace gui */