mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibGUI+Apps: Adjust Splitter spacings
Different thread highlights between widgets lead to different visual weights between splitters, even when they have the same width or height. This means some splitters look best at odd sizes while others even. This sets the default spacing to the most commonly used, depending on orientation, and adjusts spacing for a few apps based on the new paint rect. The most consistent look across apps requires some manual tweaking occassionally. Knurlheads, use your discretion!
This commit is contained in:
parent
fe864af0dc
commit
653f01616c
Notes:
sideshowbarker
2024-07-17 18:21:28 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/653f01616c Pull-request: https://github.com/SerenityOS/serenity/pull/12681 Issue: https://github.com/SerenityOS/serenity/issues/12561 Reviewed-by: https://github.com/IdanHo ✅
@ -100,7 +100,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
auto toolbar = TRY(toolbar_container->try_add<GUI::Toolbar>());
|
||||
|
||||
auto splitter = TRY(widget->try_add<GUI::HorizontalSplitter>());
|
||||
splitter->layout()->set_spacing(5);
|
||||
splitter->layout()->set_spacing(4);
|
||||
|
||||
auto manual_model = ManualModel::create();
|
||||
|
||||
|
@ -11,7 +11,9 @@
|
||||
}
|
||||
|
||||
@GUI::HorizontalSplitter {
|
||||
layout: @GUI::HorizontalBoxLayout {}
|
||||
layout: @GUI::HorizontalBoxLayout {
|
||||
spacing: 4
|
||||
}
|
||||
|
||||
@GUI::Frame {
|
||||
name: "label_frame"
|
||||
|
@ -91,10 +91,10 @@ HackStudioWidget::HackStudioWidget(String path_to_project)
|
||||
auto& toolbar_container = add<GUI::ToolbarContainer>();
|
||||
|
||||
auto& outer_splitter = add<GUI::HorizontalSplitter>();
|
||||
outer_splitter.layout()->set_spacing(5);
|
||||
outer_splitter.layout()->set_spacing(4);
|
||||
|
||||
auto& left_hand_splitter = outer_splitter.add<GUI::VerticalSplitter>();
|
||||
left_hand_splitter.layout()->set_spacing(5);
|
||||
left_hand_splitter.layout()->set_spacing(6);
|
||||
left_hand_splitter.set_fixed_width(150);
|
||||
create_project_tab(left_hand_splitter);
|
||||
m_project_tree_view_context_menu = create_project_tree_view_context_menu();
|
||||
@ -110,7 +110,6 @@ HackStudioWidget::HackStudioWidget(String path_to_project)
|
||||
m_diff_viewer = m_right_hand_stack->add<DiffViewer>();
|
||||
|
||||
m_editors_splitter = m_right_hand_stack->add<GUI::VerticalSplitter>();
|
||||
m_editors_splitter->layout()->set_spacing(5);
|
||||
m_editors_splitter->layout()->set_margins({ 3, 0, 0 });
|
||||
add_new_editor(*m_editors_splitter);
|
||||
|
||||
|
@ -27,7 +27,10 @@ Splitter::Splitter(Orientation orientation)
|
||||
set_background_role(ColorRole::Button);
|
||||
set_layout<BoxLayout>(orientation);
|
||||
set_fill_with_background_color(true);
|
||||
layout()->set_spacing(3);
|
||||
if (m_orientation == Gfx::Orientation::Horizontal)
|
||||
layout()->set_spacing(3);
|
||||
else
|
||||
layout()->set_spacing(4);
|
||||
}
|
||||
|
||||
Splitter::~Splitter()
|
||||
|
Loading…
Reference in New Issue
Block a user