mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
VisualBuilder: Make widget deletion work properly.
This commit is contained in:
parent
440700b4cb
commit
b64408a564
1 changed files with 6 additions and 2 deletions
|
@ -309,9 +309,13 @@ void VBForm::mouseup_event(GMouseEvent& event)
|
|||
|
||||
void VBForm::delete_selected_widgets()
|
||||
{
|
||||
for_each_selected_widget([this] (auto& widget) {
|
||||
m_widgets.remove_first_matching([&widget] (auto& entry) { return entry == &widget; } );
|
||||
Vector<VBWidget*> to_delete;
|
||||
for_each_selected_widget([&] (auto& widget) {
|
||||
to_delete.append(&widget);
|
||||
});
|
||||
for (auto& widget : to_delete)
|
||||
m_widgets.remove_first_matching([&widget] (auto& entry) { return entry == widget; } );
|
||||
on_widget_selected(single_selected_widget());
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Add table
Reference in a new issue