mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
PixelPaint: Reset layer widgets when closing last tab
When closing the last tab the layer list widget and layer properties widget did not reset since they still had a pointer to the image.
This commit is contained in:
parent
54d4df668a
commit
05e8bea736
Notes:
sideshowbarker
2024-07-18 11:06:52 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/05e8bea7368 Pull-request: https://github.com/SerenityOS/serenity/pull/8376
@ -553,6 +553,12 @@ int main(int argc, char** argv)
|
||||
|
||||
tab_widget.on_tab_close_click = [&](auto& widget) {
|
||||
auto& image_editor = verify_cast<PixelPaint::ImageEditor>(widget);
|
||||
|
||||
if (tab_widget.children().size() == 1) {
|
||||
layer_list_widget.set_image(nullptr);
|
||||
layer_properties_widget.set_layer(nullptr);
|
||||
}
|
||||
|
||||
tab_widget.deferred_invoke([&](auto&) {
|
||||
tab_widget.remove_tab(image_editor);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user