diff libgui/src/octave-dock-widget.cc @ 27089:9326c2258e60

fix visibility of find dialog when editor is docked/undocked (bug #5) * file-editor-interface.h: implementation of virtual slot toplevel_change * file-editor-tab.cc (handle_toplevel_changed): new slot for editor singal when editor toplevel changed, destroying and re-creating find dialog where the state of the dialog is saved in a new structure; (handle_find_dialog_finished): store geometry and visibility in the new data structure of the find dialog; (find_create): new method with the main actions for creating the find dialog moved from find (), this method is called for re-creating the dialog (find): move most of this slot into new method find_create, only leave actions for very first initialization of the dialog; (change_editor_state): use new data struct instead of separate variables for saving and restoring dialog data * file-editor-tab.h: new slot handle_toplevel_changed, new method find_create, new structure for saving dialog data * file-editor.cc (toplevel_changed): implementation of new slot for signal on toplevel changed; (add_file_editor_tab): connect editor signal on toplevel changed to the related slot in file_editor_tab * file-editor.h: new signal fetab_toplevel_changed, new slot toplevel_change * find-dialog.cc (save_data): new method for saving the current state of the find dialog in a structure passed by the caller; (restore_data): new method for restoring the current state from a given data structure; * find-dialog.h: typedef of data structure with enum for the binary options, new methods for saving and restoring data in/from the structure * octave-dock-widget.cc (make_window): manually emit toplevelChanged signal in case we undock a widget since our methid seems to prevent qt from doing so * octave-dock-widget.h: make slot toplevel_changed protected and virtual allowing a re-implementation in specific widgets
author Torsten Lilge <ttl-octave@mailbox.org>
date Tue, 14 May 2019 22:41:32 +0200
parents f7b10bd40045
children 420611c61298
line wrap: on
line diff
--- a/libgui/src/octave-dock-widget.cc	Fri May 10 22:15:37 2019 +0200
+++ b/libgui/src/octave-dock-widget.cc	Tue May 14 22:41:32 2019 +0200
@@ -305,6 +305,8 @@
       focus ();
       set_style (true);
     }
+
+    emit topLevelChanged (true);  // Be sure signal is emitted
   }
 
   // dock the widget