MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / Refresh

Method Refresh

Goldleaf/source/ui/ui_WebBrowserLayout.cpp:59–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 void WebBrowserLayout::Refresh() {
60 g_Settings.ApplyToMenu(this->opts_menu);
61 this->opts_menu->ClearItems();
62
63 auto input_itm = pu::ui::elm::MenuItem::New(cfg::Strings.GetString(378));
64 input_itm->SetColor(g_Settings.GetColorScheme().text);
65 input_itm->AddOnKey(std::bind(&WebBrowserLayout::input_DefaultKey, this));
66 this->opts_menu->AddItem(input_itm);
67
68 for(const auto &bmk: g_Settings.json_settings.web.value().bookmarks.value()) {
69 auto bmk_itm = pu::ui::elm::MenuItem::New(bmk.name);
70 bmk_itm->SetColor(g_Settings.GetColorScheme().text);
71 bmk_itm->SetIcon(GetCommonIcon(CommonIconKind::Browser));
72 bmk_itm->AddOnKey(std::bind(&WebBrowserLayout::bookmark_DefaultKey, this, bmk));
73 this->opts_menu->AddItem(bmk_itm);
74 }
75 }
76
77 void WebBrowserLayout::Reload() {
78 this->Refresh();

Callers 3

ReloadMethod · 0.95
input_DefaultKeyMethod · 0.95
bookmark_DefaultKeyMethod · 0.95

Calls 2

GetCommonIconFunction · 0.85
ApplyToMenuMethod · 0.80

Tested by

no test coverage detected