Skip to content

Commit

Permalink
feat: Open directories by drag-n-drop
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlin7 committed Apr 4, 2024
1 parent 4e179c5 commit 2f9ccee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion biscuit/core/components/editors/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def ondrop(self, event):
if not event.data:
return

self.base.open_editor(event.data)
self.base.open(event.data, warn_for_directory=True)

def add_button(self, *args):
self.__buttons__.append(args)
Expand Down
6 changes: 5 additions & 1 deletion biscuit/core/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ def set_title(self, title: str = None) -> None:
self.menubar.set_title(title)
self.menubar.reposition_title()

def open(self, path: str) -> None:
def open(self, path: str, warn_for_directory=False) -> None:
"""Opens file/directory based on path.
TODO: Open directory in new window if warn_for_directory is True.
"""
if not path:
return

Expand Down

0 comments on commit 2f9ccee

Please sign in to comment.