mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +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:
parent
54d4df668a
commit
05e8bea736
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue