mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
LibGUI: Calculate width of table headers when there is no content
In order to correctly calculate the width of the header add the top left x coordinate + the width of the content. Previously was using the width returned by the visible_content_rect(), which when there was no content would be null. This would be problematic as it would lead to not rendering the headers of tables when there was no content (for example in the SystemsMonitor in the Networks tab). Now, regardless of whether there is content or not in the table, the header is visible.
This commit is contained in:
parent
1682b0b6d8
commit
472a3df03b
Notes:
sideshowbarker
2024-07-17 14:14:10 +09:00
Author: https://github.com/martinfalisse
Commit: 472a3df03b
Pull-request: https://github.com/SerenityOS/serenity/pull/13593
1 changed files with 1 additions and 1 deletions
|
@ -82,7 +82,7 @@ HeaderView::VisibleSectionRange HeaderView::visible_section_range() const
|
|||
auto is_horizontal = m_orientation == Orientation::Horizontal;
|
||||
auto rect = m_table_view.visible_content_rect();
|
||||
auto start = is_horizontal ? rect.top_left().x() : rect.top_left().y();
|
||||
auto end = is_horizontal ? rect.top_right().x() : rect.bottom_left().y();
|
||||
auto end = is_horizontal ? (rect.top_left().x() + m_table_view.content_width()) : rect.bottom_left().y();
|
||||
auto offset = 0;
|
||||
VisibleSectionRange range;
|
||||
for (; range.end < section_count; ++range.end) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue