Mercurial > octave-nkf
diff libgui/src/m-editor/file-editor-tab.cc @ 15980:6c0fce0632a4
gui: set keyboard focus when switching between dock widgets (bug #36957)
* main-window.cc (handle_command_window_visible, handle_command_history_visible,
handle_current_directory_visible, handle_workspace_visible,
handle_editor_visible, handle_documentation_visible): slots for signal
visibilityChanged, emitted when widgets get visible
* main-window.cc (construct): connect signal visibilityChanged to slots
* main-window.cc (focus_editor): call editor's own function for setting focus
* main-window.h: declaration of new slots
* file-editor.cc (set_focus): new function: setting focus to actual editor tab
* file-editor.cc (add_file_editor_tab): connect signal fetab_set_focus to the
slot set_focus of file_editor_tab
* file-editor.h: new function set_focus and new signal fetab_set_focus
* file-editor-interface.h: new virtual function set_focus
* file-editor-tab.cc (set_focus): new slot for singal fetab_set_focus from
file_editor, setting the focus to edit area
* file-edtortab.h: new slot set_focus
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 26 Jan 2013 20:33:46 +0100 |
parents | 9cd14e53e906 |
children | e3873531dd7c |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc Thu Jan 24 17:13:15 2013 -0500 +++ b/libgui/src/m-editor/file-editor-tab.cc Sat Jan 26 20:33:46 2013 +0100 @@ -259,6 +259,15 @@ _edit_area->setLexer (lexer); } +// slot for fetab_set_focus: sets the focus to the current edit area +void +file_editor_tab::set_focus (const QWidget* ID) +{ + if (ID != this) + return; + _edit_area->setFocus (); +} + void file_editor_tab::undo (const QWidget* ID) {