mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:57:35 +00:00
LibGUI: Merge two loops over the segments in Breadcrummbar::relayout()
This commit is contained in:
parent
eb9d2c64c8
commit
63ac6ced31
1 changed files with 4 additions and 4 deletions
|
@ -171,6 +171,7 @@ void Breadcrumbbar::did_change_font()
|
|||
|
||||
void Breadcrumbbar::relayout()
|
||||
{
|
||||
auto total_width = 0;
|
||||
for (auto& segment : m_segments) {
|
||||
VERIFY(segment.button);
|
||||
auto& button = *segment.button;
|
||||
|
@ -185,12 +186,11 @@ void Breadcrumbbar::relayout()
|
|||
|
||||
button.set_max_size(segment.width, 16 + 8);
|
||||
button.set_min_size(segment.shrunken_width, 16 + 8);
|
||||
|
||||
total_width += segment.width;
|
||||
}
|
||||
|
||||
auto remaining_width = 0;
|
||||
|
||||
for (auto& segment : m_segments)
|
||||
remaining_width += segment.width;
|
||||
auto remaining_width = total_width;
|
||||
|
||||
for (auto& segment : m_segments) {
|
||||
if (remaining_width > width() && !segment.button->is_checked()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue