mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibGUI: Center TreeView item icons vertically
This makes tree views with icons look a lot better at larger font sizes.
This commit is contained in:
parent
797a53b307
commit
eb9d2c64c8
1 changed files with 1 additions and 0 deletions
|
@ -325,6 +325,7 @@ void TreeView::paint_event(PaintEvent& event)
|
|||
int indent_width = indent_width_in_pixels() * indent_level;
|
||||
|
||||
Gfx::IntRect icon_rect = { rect.x(), rect.y(), icon_size(), icon_size() };
|
||||
icon_rect.center_vertically_within(rect);
|
||||
Gfx::IntRect background_rect = {
|
||||
icon_rect.right() + 1 + icon_spacing(), rect.y(),
|
||||
min(rect.width(), column_width - indent_width) - icon_size() - icon_spacing(), rect.height()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue