blob: 7ea5e3cec5c521425aa73f302c1244da60b12de6 (
plain)
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
|
/*
* Copyright 2023 jacqueline <me@jacqueline.id.au>
*
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "screen.hpp"
#include <memory>
#include "widget_top_bar.hpp"
namespace ui {
auto Screen::UpdateTopBar(const widgets::TopBar::State& state) -> void {
if (top_bar_) {
top_bar_->Update(state);
}
}
auto Screen::CreateTopBar(lv_obj_t* parent,
const widgets::TopBar::Configuration& config)
-> widgets::TopBar* {
assert(top_bar_ == nullptr);
top_bar_ = std::make_unique<widgets::TopBar>(parent, config);
if (top_bar_->button()) {
lv_group_add_obj(group_, top_bar_->button());
}
return top_bar_.get();
}
} // namespace ui
|