mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 17:25:07 +00:00
GWidget: Remove unnecessary extra parent lookup in move_to_{back,front}().
This commit is contained in:
parent
52e846df87
commit
c812d63ea6
1 changed files with 8 additions and 4 deletions
|
@ -450,9 +450,11 @@ void GWidget::move_to_front()
|
|||
return;
|
||||
if (parent->children().size() == 1)
|
||||
return;
|
||||
parent->children().remove_first_matching([this] (auto& entry) { return entry == this; });
|
||||
parent->children().remove_first_matching([this] (auto& entry) {
|
||||
return entry == this;
|
||||
});
|
||||
parent->children().append(this);
|
||||
parent_widget()->update();
|
||||
parent->update();
|
||||
}
|
||||
|
||||
void GWidget::move_to_back()
|
||||
|
@ -462,9 +464,11 @@ void GWidget::move_to_back()
|
|||
return;
|
||||
if (parent->children().size() == 1)
|
||||
return;
|
||||
parent->children().remove_first_matching([this] (auto& entry) { return entry == this; });
|
||||
parent->children().remove_first_matching([this] (auto& entry) {
|
||||
return entry == this;
|
||||
});
|
||||
parent->children().prepend(this);
|
||||
parent_widget()->update();
|
||||
parent->update();
|
||||
}
|
||||
|
||||
bool GWidget::is_frontmost() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue