1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 07:07:36 +00:00

Browser: Hide tab bar if there's only one tab

This commit is contained in:
Linus Groh 2020-05-19 16:13:30 +01:00 committed by Andreas Kling
parent f4a941a5d7
commit e5ea243842
2 changed files with 3 additions and 1 deletions

View file

@ -127,6 +127,7 @@ int main(int argc, char** argv)
create_new_tab = [&](auto url, auto activate) {
auto& new_tab = tab_widget.add_tab<Browser::Tab>("New tab");
tab_widget.set_bar_visible(!window->is_fullscreen() && tab_widget.children().size() > 1);
tab_widget.set_tab_icon(new_tab, default_favicon);
new_tab.on_title_change = [&](auto title) {
@ -146,6 +147,7 @@ int main(int argc, char** argv)
new_tab.on_tab_close_request = [&](auto& tab) {
tab_widget.deferred_invoke([&](auto&) {
tab_widget.remove_tab(tab);
tab_widget.set_bar_visible(!window->is_fullscreen() && tab_widget.children().size() > 1);
if (tab_widget.children().is_empty())
app.quit();
});