diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-12-04 16:05:39 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-12-04 16:05:39 +0100 |
| commit | e18926ec76105161258707e077e5b19e08bd235f (patch) | |
| tree | f679cfbe3d9b0ba129fb5ee01d67cf5ba6c3102d | |
| parent | b315422a372b5589392ba46c27a95eb8f3b49b72 (diff) | |
FLUID: Fixes more places to clear cached pointers.
| -rw-r--r-- | fluid/Fl_Type.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index eada84e5e..6287e714f 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -387,6 +387,11 @@ static void delete_children(Fl_Type *p) { don't reset the project. */ void delete_all(int selected_only) { + if (widget_browser) { + if (selected_only) + widget_browser->save_scroll_position(); + widget_browser->new_list(); + } for (Fl_Type *f = Fl_Type::first; f;) { if (f->selected || !selected_only) { delete_children(f); @@ -404,15 +409,21 @@ void delete_all(int selected_only) { g_shell_config->rebuild_shell_menu(); g_shell_config->update_settings_dialog(); } - widget_browser->hposition(0); - widget_browser->vposition(0); + if (widget_browser) { + widget_browser->hposition(0); + widget_browser->vposition(0); + } g_layout_list.remove_all(FD_STORE_PROJECT); g_layout_list.current_suite(0); g_layout_list.current_preset(0); g_layout_list.update_dialogs(); } selection_changed(0); - widget_browser->redraw(); + if (widget_browser) { + if (selected_only) + widget_browser->restore_scroll_position(); + widget_browser->rebuild(); + } } /** Update a string. |
