1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

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.
This commit is contained in:
Andreas Kling 2020-09-28 12:27:56 +02:00
parent ceda137bf2
commit 9225bfa95e

View file

@ -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 {};