Mouse focus styling update

This commit is contained in:
itdominator 2023-11-12 14:44:48 -06:00
parent b6df886864
commit 2b50afe14d
2 changed files with 12 additions and 2 deletions

View File

@ -28,7 +28,16 @@ class ControllerData:
def set_active_src_view(self, source_view):
if self.active_src_view:
self.active_src_view.get_parent().is_editor_focused = False
old_notebook = self.active_src_view.get_parent().get_parent()
old_notebook.is_editor_focused = False
ctx = old_notebook.get_style_context()
ctx.remove_class("notebook-selected-focus")
notebook = source_view.get_parent().get_parent()
ctx = notebook.get_style_context()
ctx.add_class("notebook-selected-focus")
self.active_src_view = source_view

View File

@ -80,7 +80,8 @@ class EditorNotebook(EditorControllerMixin, Gtk.Notebook):
def _focused_target_changed(self, target):
self.is_editor_focused = True if target == self.NAME else False
self.grab_focus()
if self.is_editor_focused:
self.grab_focus()
def _add_action_widgets(self):
start_box = Gtk.Box()