mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:38:10 +00:00
Browser: Enable close button on tabs
This commit is contained in:
parent
49d40a908c
commit
32fc8da917
1 changed files with 6 additions and 0 deletions
|
@ -60,6 +60,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
|
|||
auto& top_line = *widget.find_descendant_of_type_named<GUI::HorizontalSeparator>("top_line");
|
||||
|
||||
m_tab_widget = *widget.find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
|
||||
m_tab_widget->set_close_button_enabled(true);
|
||||
|
||||
m_tab_widget->on_tab_count_change = [&top_line](size_t tab_count) {
|
||||
top_line.set_visible(tab_count > 1);
|
||||
|
@ -76,6 +77,11 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
|
|||
tab.on_tab_close_request(tab);
|
||||
};
|
||||
|
||||
m_tab_widget->on_tab_close_click = [](auto& clicked_widget) {
|
||||
auto& tab = static_cast<Browser::Tab&>(clicked_widget);
|
||||
tab.on_tab_close_request(tab);
|
||||
};
|
||||
|
||||
m_tab_widget->on_context_menu_request = [](auto& clicked_widget, const GUI::ContextMenuEvent& context_menu_event) {
|
||||
auto& tab = static_cast<Browser::Tab&>(clicked_widget);
|
||||
tab.context_menu_requested(context_menu_event.screen_position());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue