From 1029069ad62904ec1e4709b49f5eb69efe8c2b80 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 9 Apr 2021 22:23:32 +0200 Subject: [PATCH] Browser: Add a separator line below the menu while in multi-tab mode --- Userland/Applications/Browser/BrowserWindow.gml | 8 ++++++-- Userland/Applications/Browser/main.cpp | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/Browser/BrowserWindow.gml b/Userland/Applications/Browser/BrowserWindow.gml index f6ec7ef1af..42aee5bf40 100644 --- a/Userland/Applications/Browser/BrowserWindow.gml +++ b/Userland/Applications/Browser/BrowserWindow.gml @@ -2,8 +2,12 @@ name: "browser" fill_with_background_color: true - layout: @GUI::VerticalBoxLayout { - spacing: 2 + layout: @GUI::VerticalBoxLayout + + @GUI::HorizontalSeparator { + name: "top_line" + fixed_height: 2 + visible: false } @GUI::TabWidget { diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 77a11934d2..b4edd2dc97 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -155,8 +156,14 @@ int main(int argc, char** argv) auto& widget = window->set_main_widget(); widget.load_from_gml(browser_window_gml); + auto& top_line = *widget.find_descendant_of_type_named("top_line"); + auto& tab_widget = *widget.find_descendant_of_type_named("tab_widget"); + tab_widget.on_tab_count_change = [&](size_t tab_count) { + top_line.set_visible(tab_count > 1); + }; + auto default_favicon = Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"); VERIFY(default_favicon);