mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWebView+UI: Generate the zoom menu
This commit is contained in:
Notes:
github-actions[bot]
2025-09-11 18:24:52 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/9684e6dbc59 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6062
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user