refactor: make focus_termimal a toggle
This commit is contained in:
parent
3d1658541a
commit
613b95c2af
2 changed files with 10 additions and 3 deletions
|
|
@ -148,6 +148,10 @@ pub fn receive(self: *Self, _: tp.pid_ref, m: tp.message) error{Exit}!bool {
|
|||
return true;
|
||||
}
|
||||
|
||||
pub fn toggle_focus(self: *Self) void {
|
||||
if (self.focused) self.unfocus() else self.focus();
|
||||
}
|
||||
|
||||
pub fn focus(self: *Self) void {
|
||||
self.focused = true;
|
||||
tui.set_keyboard_focus(Widget.to(self));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue