summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2021-02-17 12:01:22 -0500
committerAndreas Kling <kling@serenityos.org>2021-02-20 22:27:52 +0100
commit8789a91a4efe59ba3b151fc152995d7fe6dd4248 (patch)
treea9f4ef39cde63564f7e7c8777c93acf56de54fd8 /Userland
parent08476e7fe7b5265e87fd594f9e9b96c644d86434 (diff)
downloadserenity-8789a91a4efe59ba3b151fc152995d7fe6dd4248.zip
LibGUI: Set IconView content width to actual content only
Fixes incorrect excess size reporting when updating scrollbars and allows horizontal scrolling if IconView is resized smaller than a single column
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGUI/IconView.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp
index 5026073027..d3ac1e84b7 100644
--- a/Userland/Libraries/LibGUI/IconView.cpp
+++ b/Userland/Libraries/LibGUI/IconView.cpp
@@ -163,7 +163,7 @@ void IconView::update_content_size()
m_visual_row_count = ceil_div(model()->row_count(), m_visual_column_count);
else
m_visual_row_count = 0;
- content_width = available_size().width();
+ content_width = m_visual_column_count * effective_item_size().width();
content_height = m_visual_row_count * effective_item_size().height();
} else {
m_visual_row_count = max(1, available_size().height() / effective_item_size().height());