Преглед на файлове

LibGUI: Respect per-index font when computing TreeView item rects

This makes the selected (currently shown in bold) item in HackStudio's
project file view show up at the correct position.
Andreas Kling преди 5 години
родител
ревизия
c6c71b0fcc
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      Libraries/LibGUI/TreeView.cpp

+ 1 - 1
Libraries/LibGUI/TreeView.cpp

@@ -167,7 +167,7 @@ void TreeView::traverse_in_paint_order(Callback callback) const
             auto node_text = model.data(index, Model::Role::Display).to_string();
             auto node_text = model.data(index, Model::Role::Display).to_string();
             Gfx::IntRect rect = {
             Gfx::IntRect rect = {
                 x_offset, y_offset,
                 x_offset, y_offset,
-                icon_size() + icon_spacing() + text_padding() + font().width(node_text) + text_padding(), item_height()
+                icon_size() + icon_spacing() + text_padding() + font_for_index(index)->width(node_text) + text_padding(), item_height()
             };
             };
             Gfx::IntRect toggle_rect;
             Gfx::IntRect toggle_rect;
             if (row_count_at_index > 0) {
             if (row_count_at_index > 0) {