mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
LibGUI: Merge two loops over the segments in Breadcrummbar::relayout()
This commit is contained in:
parent
eb9d2c64c8
commit
63ac6ced31
|
@ -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…
Reference in a new issue