mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
LibGUI: Introduce widget content margins + improve splitters
A GUI::Widget can now set an optional content margin (4x0 by default.) Pixels in the content margin will be ignored for hit testing purposes. Use this to allow frame-like widgets (like GUI::Frame!) to ignore any mouse events in the frame area, and instead let those go to parent. This allows GUI::Splitter to react "sooner" to mouse events that were previously swallowed by the child widgets instead of ending up in the splitter. The net effect is that 2 more pixels on each side of a splitter handle are now interactive and usable for splitting! :^)
This commit is contained in:
@@ -39,6 +39,7 @@ namespace GUI {
|
||||
MultiView::MultiView()
|
||||
{
|
||||
set_active_widget(nullptr);
|
||||
set_content_margins({ 2, 2, 2, 2 });
|
||||
m_item_view = add<ItemView>();
|
||||
m_table_view = add<TableView>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user