LibGUI: Don't include invisible widgets in BoxLayout preferred size
This commit is contained in:
parent
4f4e6bc61b
commit
1e4b9a9cd9
Notes:
sideshowbarker
2024-07-19 00:07:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1e4b9a9cd97
1 changed files with 2 additions and 2 deletions
|
@ -57,7 +57,7 @@ int BoxLayout::preferred_primary_size() const
|
|||
int size = 0;
|
||||
|
||||
for (auto& entry : m_entries) {
|
||||
if (!entry.widget)
|
||||
if (!entry.widget || !entry.widget->is_visible())
|
||||
continue;
|
||||
int min_size = entry.widget->min_size().primary_size_for_orientation(orientation());
|
||||
int max_size = entry.widget->max_size().primary_size_for_orientation(orientation());
|
||||
|
@ -87,7 +87,7 @@ int BoxLayout::preferred_secondary_size() const
|
|||
{
|
||||
int size = 0;
|
||||
for (auto& entry : m_entries) {
|
||||
if (!entry.widget)
|
||||
if (!entry.widget || !entry.widget->is_visible())
|
||||
continue;
|
||||
int min_size = entry.widget->min_size().secondary_size_for_orientation(orientation());
|
||||
int preferred_secondary_size = -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue