Mercurial > octave
diff libgui/src/variable-editor.cc @ 25199:8cff7eceee87 stable
Do Variable Editor focus retention and titlebar highlight properly (bug #53410).
* variable_editor.cc (variable_editor::variable_editor): Remove the m_main
QMainWindow proxy.
(variable_editor::focusInEvent): Added. Add after the base class virtual
focusInEvent() by setting the focus to the active variable widget.
* variable_editor.h (variable_editor::focusInEvent): Added. Declaration of
overriding virtual function.
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Mon, 09 Apr 2018 18:35:45 -0500 |
parents | 8cc3213f788f |
children | 07bddddc5856 565d724ecf50 |
line wrap: on
line diff
--- a/libgui/src/variable-editor.cc Tue Apr 10 12:19:02 2018 -0400 +++ b/libgui/src/variable-editor.cc Mon Apr 09 18:35:45 2018 -0500 @@ -1029,12 +1029,21 @@ m_main->setCentralWidget (central_mdiarea); setWidget (m_main); - setFocusProxy (m_main); connect (this, SIGNAL (command_signal (const QString&)), p, SLOT (execute_command_in_terminal (const QString&))); } + void variable_editor::focusInEvent (QFocusEvent *ev) + { + octave_dock_widget::focusInEvent (ev); + + // set focus to the current variable + QWidget *fw = m_main->focusWidget (); + if (fw != nullptr) + fw->setFocus (); + } + // Add an action to a menu or the widget itself. QAction*