mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibWebView+UI: Generate the zoom menu
This commit is contained in:
parent
7d6ea99d0d
commit
9684e6dbc5
Notes:
github-actions[bot]
2025-09-11 18:24:52 +00:00
Author: https://github.com/trflynn89
Commit: 9684e6dbc5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6062
20 changed files with 104 additions and 210 deletions
|
@ -668,6 +668,22 @@ void Application::initialize_actions()
|
|||
view->get_source();
|
||||
});
|
||||
|
||||
m_zoom_menu = Menu::create_group("Zoom"sv);
|
||||
m_zoom_menu->add_action(Action::create("Zoom In"sv, ActionID::ZoomIn, [this]() {
|
||||
if (auto view = active_web_view(); view.has_value())
|
||||
view->zoom_in();
|
||||
}));
|
||||
m_zoom_menu->add_action(Action::create("Zoom Out"sv, ActionID::ZoomOut, [this]() {
|
||||
if (auto view = active_web_view(); view.has_value())
|
||||
view->zoom_out();
|
||||
}));
|
||||
|
||||
m_reset_zoom_action = Action::create("Reset Zoom"sv, ActionID::ResetZoom, [this]() {
|
||||
if (auto view = active_web_view(); view.has_value())
|
||||
view->reset_zoom();
|
||||
});
|
||||
m_zoom_menu->add_action(*m_reset_zoom_action);
|
||||
|
||||
auto set_color_scheme = [this](auto color_scheme) {
|
||||
return [this, color_scheme]() {
|
||||
m_color_scheme = color_scheme;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue