mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
GWidget: Remove unnecessary extra parent lookup in move_to_{back,front}().
This commit is contained in:
parent
52e846df87
commit
c812d63ea6
Notes:
sideshowbarker
2024-07-19 14:41:20 +09:00
Author: https://github.com/awesomekling
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