mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
Browser: Add a separator line below the menu while in multi-tab mode
This commit is contained in:
parent
c8ff507534
commit
1029069ad6
Notes:
sideshowbarker
2024-07-18 20:36:53 +09:00
Author: https://github.com/awesomekling
Commit: 1029069ad6
2 changed files with 13 additions and 2 deletions
|
@ -2,8 +2,12 @@
|
||||||
name: "browser"
|
name: "browser"
|
||||||
fill_with_background_color: true
|
fill_with_background_color: true
|
||||||
|
|
||||||
layout: @GUI::VerticalBoxLayout {
|
layout: @GUI::VerticalBoxLayout
|
||||||
spacing: 2
|
|
||||||
|
@GUI::HorizontalSeparator {
|
||||||
|
name: "top_line"
|
||||||
|
fixed_height: 2
|
||||||
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
@GUI::TabWidget {
|
@GUI::TabWidget {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/BoxLayout.h>
|
#include <LibGUI/BoxLayout.h>
|
||||||
#include <LibGUI/Icon.h>
|
#include <LibGUI/Icon.h>
|
||||||
|
#include <LibGUI/SeparatorWidget.h>
|
||||||
#include <LibGUI/TabWidget.h>
|
#include <LibGUI/TabWidget.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
#include <LibGfx/Bitmap.h>
|
#include <LibGfx/Bitmap.h>
|
||||||
|
@ -155,8 +156,14 @@ int main(int argc, char** argv)
|
||||||
auto& widget = window->set_main_widget<GUI::Widget>();
|
auto& widget = window->set_main_widget<GUI::Widget>();
|
||||||
widget.load_from_gml(browser_window_gml);
|
widget.load_from_gml(browser_window_gml);
|
||||||
|
|
||||||
|
auto& top_line = *widget.find_descendant_of_type_named<GUI::HorizontalSeparator>("top_line");
|
||||||
|
|
||||||
auto& tab_widget = *widget.find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
|
auto& tab_widget = *widget.find_descendant_of_type_named<GUI::TabWidget>("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");
|
auto default_favicon = Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png");
|
||||||
VERIFY(default_favicon);
|
VERIFY(default_favicon);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue