UI/Qt: Place the "reset zoom" button to the left of the hamburger menu
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

It feels a bit awkward having this button displace the menu.
This commit is contained in:
Timothy Flynn 2025-09-11 07:45:57 -04:00 committed by Tim Flynn
commit 4a5c374084
Notes: github-actions[bot] 2025-09-11 18:24:46 +00:00

View file

@ -99,9 +99,11 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_toolbar->addAction(m_navigate_forward_action);
m_toolbar->addAction(m_reload_action);
m_toolbar->addWidget(m_location_edit);
m_toolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
m_toolbar->addAction(create_application_action(*m_toolbar, view().reset_zoom_action()));
m_hamburger_button_action = m_toolbar->addWidget(m_hamburger_button);
m_toolbar->setIconSize({ 16, 16 });
m_toolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
// This is a little awkward, but without this Qt shrinks the button to the size of the icon.
// Note: toolButtonStyle="0" -> ToolButtonIconOnly.
m_toolbar->setStyleSheet("QToolButton[toolButtonStyle=\"0\"]{width:24px;height:24px}");
@ -112,8 +114,6 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_hamburger_button_action->setVisible(!show_menubar);
});
m_toolbar->addAction(create_application_action(*m_toolbar, view().reset_zoom_action()));
view().on_activate_tab = [this] {
m_window->activate_tab(tab_index());
};