From b02be11a6f59a719f297f4b18dabea74f49e32f3 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 18 Mar 2021 22:49:44 -0400 Subject: [PATCH] LibGUI: Add corresponding padding to ListView content width Fixes clipped text in list items --- Userland/Libraries/LibGUI/ListView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/ListView.cpp b/Userland/Libraries/LibGUI/ListView.cpp index a1cd030f96..27091e1e19 100644 --- a/Userland/Libraries/LibGUI/ListView.cpp +++ b/Userland/Libraries/LibGUI/ListView.cpp @@ -62,7 +62,7 @@ void ListView::update_content_size() int content_width = 0; for (int row = 0, row_count = model()->row_count(); row < row_count; ++row) { auto text = model()->index(row, m_model_column).data(); - content_width = max(content_width, font().width(text.to_string())); + content_width = max(content_width, font().width(text.to_string()) + horizontal_padding() + 1); } content_width = max(content_width, widget_inner_rect().width());