diff libgui/src/main-window.cc @ 19460:f90bb1e30de2 gui-release

switching between edit and main shortcuts depending on active dock widget now * file-editor-tab.cc (ctor): do not connect removed signal from edit area; (edit_area_has_focus): removed this related slot * file-editor-tab.h: remove slot * octave-qscintilla.cc (focusInEvent, focusOutEvent): removed event handlers * octave-qscintilla.h (focusInEvent, focusOutEvent): removed event handlers * main-window.cc (focus_changed): call set_global_edit_shortcuts depending on new active dock
author Torsten <ttl@justmail.de>
date Wed, 24 Dec 2014 15:07:31 +0100
parents 5e93d228ff6b
children be53bf420464
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Wed Dec 24 13:58:00 2014 +0100
+++ b/libgui/src/main-window.cc	Wed Dec 24 15:07:31 2014 +0100
@@ -184,7 +184,17 @@
   // if new dock has focus, emit signal and store active focus
   if (dock != _active_dock)
     {
+      // signal to all dock widgets for updating the style
       emit active_dock_changed (_active_dock, dock);
+
+      // if editor gets/loses focus, shortcuts and menus have to be updated
+      octave_dock_widget *edit_dock_widget =
+                        static_cast <octave_dock_widget *> (editor_window);
+      if (edit_dock_widget == dock)
+        set_global_edit_shortcuts (false);
+      else if (edit_dock_widget == _active_dock)
+        set_global_edit_shortcuts (true);
+
       _active_dock = dock;
     }
 }