mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Ladybird/Qt: Close the browser when the last tab's close button is used
We currently do this already when the last tab is closed via the ctrl-W shortcut. Move the logic for this to BrowserWindow::close_tab so that we also close the window when the tab is closed via its close button.
This commit is contained in:
parent
db31fa730a
commit
795efea64f
Notes:
sideshowbarker
2024-07-16 20:05:14 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/795efea64f Pull-request: https://github.com/SerenityOS/serenity/pull/23846
1 changed files with 3 additions and 3 deletions
|
@ -613,6 +613,9 @@ void BrowserWindow::close_tab(int index)
|
|||
auto* tab = m_tabs_container->widget(index);
|
||||
m_tabs_container->removeTab(index);
|
||||
tab->deleteLater();
|
||||
|
||||
if (m_tabs_container->count() == 0)
|
||||
close();
|
||||
}
|
||||
|
||||
void BrowserWindow::open_file()
|
||||
|
@ -623,9 +626,6 @@ void BrowserWindow::open_file()
|
|||
void BrowserWindow::close_current_tab()
|
||||
{
|
||||
close_tab(m_tabs_container->currentIndex());
|
||||
|
||||
if (m_tabs_container->count() == 0)
|
||||
close();
|
||||
}
|
||||
|
||||
int BrowserWindow::tab_index(Tab* tab)
|
||||
|
|
Loading…
Reference in a new issue