summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier De Canniere <olivier.decanniere96@gmail.com>2021-06-30 12:32:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-30 15:15:25 +0200
commita4c1666b71e4b72fac860af4c31aa2ca8749b0e9 (patch)
tree6fd5e7da9cad7ec442b5548ca71edec7f438fa1a
parentc1fbfdc164ce8a1e977ca43279a70d2243aa6c61 (diff)
downloadserenity-a4c1666b71e4b72fac860af4c31aa2ca8749b0e9.zip
HeaderView: Fix horizonal section size miscalculation
When calculating the horizonal size of a section in `HeaderView::visible_section_range()`, the horizonal padding is now correctly taken into account. This fixes header missalignment issues in Spreadsheet, SystemMonitor and maybe also the playlist tab of SoundPlayer closes #8268
-rw-r--r--Userland/Libraries/LibGUI/HeaderView.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/HeaderView.cpp b/Userland/Libraries/LibGUI/HeaderView.cpp
index bc97177fd3..39401c02b1 100644
--- a/Userland/Libraries/LibGUI/HeaderView.cpp
+++ b/Userland/Libraries/LibGUI/HeaderView.cpp
@@ -93,6 +93,8 @@ HeaderView::VisibleSectionRange HeaderView::visible_section_range() const
for (; range.end < section_count; ++range.end) {
auto& section = section_data(range.end);
int section_size = section.size;
+ if (orientation() == Gfx::Orientation::Horizontal)
+ section_size += m_table_view.horizontal_padding() * 2;
if (offset + section_size < start) {
if (section.visibility)
offset += section_size;