Mercurial > octave
diff libgui/src/m-editor/file-editor.cc @ 29199:0b18887bc997
simplify initialization of gui dock widgets
* file-editor.cc (handle_visibility): call common part of this slot
instead of repeating its contents here
* main-window.cc (main_window): do not connect visibility changed
signal from dock widgets since this is done in the dock widget
constructors; instead emit new signal for initialization of the
window menu and setup editor shortcuts
(connect_visibility_changed): removed obsolete method
* main-window.h: new signal init_window_menu, removed method
connect_visibility_changed
* octave-dock-widget.cc (octave_dock_widget): rename slot for
visibilityChanged signal, connect new slot for initialization of
the window menu
(connect_visibility_changed): remove obsolete method;
(init_window_menu_entry): new slot for dis/enabling related menu
window entry;
(handle_visibility): combine contents from former two slots
* octave-dock-widget.h: removed slot connect_visibility_changed,
new signal init_window_menu_entry, removed slot
handle_visibility_changed
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sat, 19 Dec 2020 10:49:43 +0100 |
parents | 1ac5a76ae91d |
children | 7854d5752dd2 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc Fri Dec 18 16:16:53 2020 -0800 +++ b/libgui/src/m-editor/file-editor.cc Sat Dec 19 10:49:43 2020 +0100 @@ -1408,6 +1408,8 @@ // files and is made visible. void file_editor::handle_visibility (bool visible) { + octave_dock_widget::handle_visibility (visible); + if (m_closed && visible) { m_closed = false; @@ -1417,9 +1419,6 @@ } empty_script (false, visible); - - if (visible && ! isFloating ()) - setFocus (); } // This slot is a reimplementation of the virtual slot in octave_dock_widget.