소스 검색

LibGUI: Center TreeView item icons vertically

This makes tree views with icons look a lot better at larger font sizes.
Andreas Kling 2 년 전
부모
커밋
eb9d2c64c8
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      Userland/Libraries/LibGUI/TreeView.cpp

+ 1 - 0
Userland/Libraries/LibGUI/TreeView.cpp

@@ -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()