Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 19624:3c038da18218 gui-release
cleanup of focus function in gui editor
* file-editor-interface.h: remove function set_focus
* file-editor.cc (focus): call common function and extra code for the editor;
(set_focus): removed, all code now in focus ();
(request_new_file, request_open_file): replaced set_focus by focus
* file-editor.h: removed set_focus
author | Torsten <ttl@justmail.de> |
---|---|
date | Thu, 25 Dec 2014 08:31:31 +0100 |
parents | ed0df431631b |
children | be7ac98fab43 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -116,18 +116,9 @@ void file_editor::focus (void) { - set_focus (); -} + octave_dock_widget::focus (); -// set focus to editor and its current tab -void -file_editor::set_focus (void) -{ - if (!isVisible ()) - setVisible (true); - setFocus (); - activateWindow (); - raise (); +// set focus to current tab QWidget *fileEditorTab = _tab_widget->currentWidget (); if (fileEditorTab) emit fetab_set_focus (fileEditorTab); @@ -174,7 +165,7 @@ { add_file_editor_tab (fileEditorTab, ""); // new tab with empty title fileEditorTab->new_file (commands); // title is updated here - set_focus (); // focus editor and new tab + focus (); // focus editor and new tab } } @@ -372,7 +363,7 @@ if (! ((breakpoint_marker || debug_pointer) && is_editor_console_tabbed ())) { emit fetab_set_focus (tab); - set_focus (); + focus (); } } else @@ -479,7 +470,7 @@ if (! ((breakpoint_marker || debug_pointer) && is_editor_console_tabbed ())) { // really show editor and the current editor tab - set_focus (); + focus (); emit file_loaded_signal (); } }