| 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(); |
no test coverage detected