mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Ladybird/Qt: Draw line box borders for all tabs when option is toggled
Previously, line box borders were only set for the current tab when the option was toggled.
This commit is contained in:
parent
0ab4722cee
commit
d480355b57
Notes:
sideshowbarker
2024-07-17 02:23:25 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d480355b57 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/40
4 changed files with 18 additions and 6 deletions
|
@ -336,12 +336,15 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, WebView::Cook
|
|||
|
||||
debug_menu->addSeparator();
|
||||
|
||||
auto* show_line_box_borders_action = new QAction("Show Line Box Borders", this);
|
||||
show_line_box_borders_action->setCheckable(true);
|
||||
debug_menu->addAction(show_line_box_borders_action);
|
||||
QObject::connect(show_line_box_borders_action, &QAction::triggered, this, [this, show_line_box_borders_action] {
|
||||
bool state = show_line_box_borders_action->isChecked();
|
||||
debug_request("set-line-box-borders", state ? "on" : "off");
|
||||
m_show_line_box_borders_action = new QAction("Show Line Box Borders", this);
|
||||
m_show_line_box_borders_action->setCheckable(true);
|
||||
debug_menu->addAction(m_show_line_box_borders_action);
|
||||
QObject::connect(m_show_line_box_borders_action, &QAction::triggered, this, [this] {
|
||||
bool state = m_show_line_box_borders_action->isChecked();
|
||||
for (auto index = 0; index < m_tabs_container->count(); ++index) {
|
||||
auto tab = verify_cast<Tab>(m_tabs_container->widget(index));
|
||||
tab->set_line_box_borders(state);
|
||||
}
|
||||
});
|
||||
|
||||
debug_menu->addSeparator();
|
||||
|
@ -677,6 +680,7 @@ void BrowserWindow::initialize_tab(Tab* tab)
|
|||
create_close_button_for_tab(tab);
|
||||
|
||||
tab->focus_location_editor();
|
||||
tab->set_line_box_borders(m_show_line_box_borders_action->isChecked());
|
||||
}
|
||||
|
||||
void BrowserWindow::activate_tab(int index)
|
||||
|
|
|
@ -184,6 +184,7 @@ private:
|
|||
QAction* m_find_in_page_action { nullptr };
|
||||
QAction* m_view_source_action { nullptr };
|
||||
QAction* m_inspect_dom_node_action { nullptr };
|
||||
QAction* m_show_line_box_borders_action { nullptr };
|
||||
|
||||
SettingsDialog* m_settings_dialog { nullptr };
|
||||
|
||||
|
|
|
@ -956,4 +956,9 @@ void Tab::close_sub_widgets()
|
|||
close_widget_window(m_inspector_widget);
|
||||
}
|
||||
|
||||
void Tab::set_line_box_borders(bool enabled)
|
||||
{
|
||||
debug_request("set-line-box-borders", enabled ? "on" : "off");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,6 +65,8 @@ public:
|
|||
|
||||
void update_hover_label();
|
||||
|
||||
void set_line_box_borders(bool);
|
||||
|
||||
public slots:
|
||||
void focus_location_editor();
|
||||
void location_edit_return_pressed();
|
||||
|
|
Loading…
Reference in a new issue