Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions datashuttle/tui/custom_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from collections.abc import Iterable

from textual import events
from textual.events import MouseMove
from textual.validation import Validator

from datashuttle.tui.app import TuiApp
Expand Down Expand Up @@ -146,6 +147,15 @@ def __init__(

self.mainwindow = mainwindow

def on_mouse_move(self, event: MouseMove) -> None:
"""Handle focus for this widget.

Explicitly grab focus when mouse moves into widget so that
keyboard shortcuts work without having to click the folder.
"""
if not self.has_focus: # type: ignore
self.focus()

def filter_paths(self, paths: Iterable[Path]) -> Iterable[Path]:
"""Filter out all hidden folders and files from CustomDirectoryTree display.

Expand Down
Loading