MCPcopy Create free account
hub / github.com/AshampooSystems/boden / MainViewController

Function MainViewController

examples/KeeWeb/src/keeweb.cpp:11–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9{
10 public:
11 MainViewController()
12 {
13 _window = std::make_shared<ui::Window>();
14 _window->title = "KeeWeb";
15 _window->geometry = Rect{0, 0, 1024, 768};
16 _window->setLayout(std::make_shared<ui::yoga::Layout>());
17 _window->stylesheet =
18 JsonStringify({"status-bar-style" : "light", "background-color" : "#000000", "use-unsafe-area" : true});
19
20 auto mainContainer = std::make_shared<ui::ContainerView>();
21 mainContainer->stylesheet = FlexJsonStringify({"flexGrow" : 1.0});
22
23 auto webView = std::make_shared<ui::WebView>();
24 webView->stylesheet = FlexJsonStringify({"flexGrow" : 1.0});
25 webView->userAgent = "boden/0.1";
26 webView->url = App()->uriToBundledFileUri("asset://main/keeweb/index.html");
27 mainContainer->addChildView(webView);
28
29 webView->redirectHandler = [=](const ui::WebView::RedirectRequest &request) {
30 logstream() << "Redirecting to: " << request.url;
31 return true;
32 };
33
34 _window->contentView = mainContainer;
35 _window->visible = true;
36 }
37
38 protected:
39 std::shared_ptr<ui::Window> _window;
40};
41
42class WebViewDemoApplicationController : public ui::UIApplicationController
43{

Callers

nothing calls this directly

Calls 5

AppFunction · 0.85
logstreamClass · 0.85
setLayoutMethod · 0.45
uriToBundledFileUriMethod · 0.45
addChildViewMethod · 0.45

Tested by

no test coverage detected