1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00: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:
Marcus Nilsson 2021-07-01 23:31:23 +02:00 committed by Andreas Kling
parent 54d4df668a
commit 05e8bea736

View file

@ -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);
});