Ver código fonte

LibGUI: Correct inline editor placement in ColumnsView

Thanks to @bugaevc for noticing that I didn't account for the 1px space
between columns, and for the space occupied by the item icon.
Andreas Kling 4 anos atrás
pai
commit
9225bfa95e
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      Libraries/LibGUI/ColumnsView.cpp

+ 2 - 2
Libraries/LibGUI/ColumnsView.cpp

@@ -323,8 +323,8 @@ Gfx::IntRect ColumnsView::content_rect(const ModelIndex& index) const
     int column_x = 0;
     for (auto& column : m_columns) {
         if (column.parent_index == index.parent())
-            return { column_x, index.row() * item_height(), column.width, item_height() };
-        column_x += column.width;
+            return { column_x + icon_size(), index.row() * item_height(), column.width - icon_size(), item_height() };
+        column_x += column.width + 1;
     }
 
     return {};