Skip to content

Commit

Permalink
invalidate app state when output is toggled
Browse files Browse the repository at this point in the history
  • Loading branch information
psethwick committed Feb 27, 2022
1 parent 526df4c commit 69a0ed6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plover_console_ui/console_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def status_bar_text(engine) -> str:


class ConsoleEngine(StenoEngine, Thread):
def __init__(self, config, keyboard_emulation, layout: ConsoleLayout, controller=None):
def __init__(
self, config, keyboard_emulation, layout: ConsoleLayout, controller=None
):
if controller:
StenoEngine.__init__(self, config, controller, keyboard_emulation)
else:
Expand All @@ -41,6 +43,11 @@ def __init__(self, config, keyboard_emulation, layout: ConsoleLayout, controller
self.hook_connect("add_translation", partial(layout.on_add_translation, self))
self.cmder = Commander(build_commands(self, layout), layout.output_to_console)

def on_output_changed(_):
get_app().invalidate()

self.hook_connect("output_changed", on_output_changed)

def on_lookup():
focus_console()
layout.cmder_input.text = ""
Expand Down

0 comments on commit 69a0ed6

Please sign in to comment.