diff options
author | MacDue <macdue@dueutil.tech> | 2023-03-29 00:25:42 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-29 07:17:35 +0200 |
commit | bdbea0baebe44d12e5d2b9fe0bc64ea1cde7cdc9 (patch) | |
tree | 9ddcea2a85dbf3c49286537993bc682321fe2e62 /Ladybird/BrowserWindow.cpp | |
parent | b7f9b316ed39e487fdf822916d10324689a3454f (diff) | |
download | serenity-bdbea0baebe44d12e5d2b9fe0bc64ea1cde7cdc9.zip |
Ladybird: Add reset zoom level button to toolbar
This is a port of the Browser feature.
Diffstat (limited to 'Ladybird/BrowserWindow.cpp')
-rw-r--r-- | Ladybird/BrowserWindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Ladybird/BrowserWindow.cpp b/Ladybird/BrowserWindow.cpp index 23d2ec9d22..aea82e4d41 100644 --- a/Ladybird/BrowserWindow.cpp +++ b/Ladybird/BrowserWindow.cpp @@ -336,7 +336,7 @@ void BrowserWindow::set_current_tab(Tab* tab) { m_current_tab = tab; if (tab) - update_zoom_menu_text(); + update_displayed_zoom_level(); } void BrowserWindow::debug_request(DeprecatedString const& request, DeprecatedString const& argument) @@ -523,7 +523,7 @@ void BrowserWindow::zoom_in() if (!m_current_tab) return; m_current_tab->view().zoom_in(); - update_zoom_menu_text(); + update_displayed_zoom_level(); } void BrowserWindow::zoom_out() @@ -531,7 +531,7 @@ void BrowserWindow::zoom_out() if (!m_current_tab) return; m_current_tab->view().zoom_out(); - update_zoom_menu_text(); + update_displayed_zoom_level(); } void BrowserWindow::reset_zoom() @@ -539,7 +539,7 @@ void BrowserWindow::reset_zoom() if (!m_current_tab) return; m_current_tab->view().reset_zoom(); - update_zoom_menu_text(); + update_displayed_zoom_level(); } void BrowserWindow::select_all() @@ -548,11 +548,12 @@ void BrowserWindow::select_all() tab->view().select_all(); } -void BrowserWindow::update_zoom_menu_text() +void BrowserWindow::update_displayed_zoom_level() { VERIFY(m_zoom_menu && m_current_tab); auto zoom_level_text = MUST(String::formatted("&Zoom ({}%)", round_to<int>(m_current_tab->view().zoom_level() * 100))); m_zoom_menu->setTitle(qstring_from_ak_string(zoom_level_text)); + m_current_tab->update_reset_zoom_button(); } void BrowserWindow::copy_selected_text() |