1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

LibGUI: Add a ToolBarContainer widget and put most ToolBars in one

This mimics the Explorer toolbar container from Windows 2000 and looks
pretty neat! :^)
This commit is contained in:
Andreas Kling 2020-04-23 17:44:49 +02:00
parent 5b6c2f3bd6
commit ab336e895f
12 changed files with 179 additions and 18 deletions

View file

@ -39,10 +39,10 @@ ToolBar::ToolBar(Orientation orientation, int button_size)
{
if (orientation == Orientation::Horizontal) {
set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
set_preferred_size(0, button_size + 10);
set_preferred_size(0, button_size + 8);
} else {
set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
set_preferred_size(button_size + 10, 0);
set_preferred_size(button_size + 8, 0);
}
set_layout<BoxLayout>(orientation);
layout()->set_spacing(0);
@ -111,9 +111,9 @@ void ToolBar::paint_event(PaintEvent& event)
Painter painter(*this);
painter.add_clip_rect(event.rect());
if (m_has_frame)
Gfx::StylePainter::paint_surface(painter, rect(), palette(), x() != 0, y() != 0);
else
//if (m_has_frame)
// Gfx::StylePainter::paint_surface(painter, rect(), palette(), x() != 0, y() != 0);
// else
painter.fill_rect(event.rect(), palette().button());
}