-
-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathapp.cpp
32 lines (25 loc) · 821 Bytes
/
app.cpp
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
#include <mdi/arrow-up-down.h>
#include <mdi/border-none-variant.h>
#include <mdi/brush.h>
#include <mdi/chart-histogram.h>
#include <mdi/flask.h>
#include <mdi/ruler-square.h>
#include "_embed.h"
#include "app.h"
#include "host.h"
namespace Karm::Ui {
Res<> runApp(Sys::Context &, Child root) {
return try$(_Embed::makeHost(root))->run();
}
Async::Task<> runAsync(Sys::Context &ctx, Child root) {
return _Embed::runAsync(ctx, root);
}
void mountApp(Cli::Command &cmd, Slot rootSlot) {
Cli::Flag mobileArg = Cli::flag(NONE, "mobile"s, "Show mobile layout."s);
cmd.option(mobileArg);
cmd.callbackAsync = [rootSlot = std::move(rootSlot)](Sys::Context &) -> Async::Task<> {
auto root = rootSlot();
co_return co_try$(_Embed::makeHost(root))->run();
};
}
} // namespace Karm::Ui