mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
VisualBuilder: Make widget deletion work properly.
This commit is contained in:
parent
440700b4cb
commit
b64408a564
Notes:
sideshowbarker
2024-07-19 14:39:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b64408a5644
@ -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…
Reference in New Issue
Block a user