generated from itdominator/Python-With-Gtk-Template
Mouse focus styling update
This commit is contained in:
parent
b6df886864
commit
2b50afe14d
@ -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
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user