Commit ba8b57a2 authored by Roman Alifanov's avatar Roman Alifanov

widgets: fix focus-out warning on set_sensitive

parent f7cdfca4
......@@ -35,6 +35,12 @@ class BaseWidget:
self.row.set_visible(visible)
def set_enabled(self, enabled: bool):
if not enabled:
root = self.row.get_root()
if root:
focus = root.get_focus()
if focus and focus.is_ancestor(self.row):
root.set_focus(None)
self.row.set_sensitive(enabled)
def set_busy(self, busy: bool):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment