From 418f61e01c5c4440573ef4e2ec0a0855514196fb Mon Sep 17 00:00:00 2001 From: Billy Date: Sun, 10 Mar 2024 18:41:49 +0530 Subject: [PATCH] feat: Implement explorer popup menus --- biscuit/__init__.py | 2 +- biscuit/core/components/views/sidebar/explorer/__init__.py | 4 ++-- biscuit/core/utils/events.py | 6 ++++++ pyproject.toml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/biscuit/__init__.py b/biscuit/__init__.py index 80836252..ad56c192 100644 --- a/biscuit/__init__.py +++ b/biscuit/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.65.0" +__version__ = "2.65.1" __version_info__ = tuple([int(num) for num in __version__.split(".")]) # For tests to run successfully diff --git a/biscuit/core/components/views/sidebar/explorer/__init__.py b/biscuit/core/components/views/sidebar/explorer/__init__.py index 812f21f6..0c78a730 100644 --- a/biscuit/core/components/views/sidebar/explorer/__init__.py +++ b/biscuit/core/components/views/sidebar/explorer/__init__.py @@ -15,9 +15,9 @@ def __init__(self, master, *args, **kwargs) -> None: self.name = 'Explorer' self.menu = ExplorerMenu(self, 'files') - self.menu.add_item("Open Editors") + self.menu.add_item("Open Editors", self.base.events.show_active_editors) self.menu.add_separator(10) - self.menu.add_item("Folders") + self.menu.add_item("Search", self.base.events.show_file_search_palette) self.add_button('ellipsis', self.menu.show) self.directory = DirectoryTree(self, observe_changes=True) diff --git a/biscuit/core/utils/events.py b/biscuit/core/utils/events.py index 71da11bd..1d8abff3 100644 --- a/biscuit/core/utils/events.py +++ b/biscuit/core/utils/events.py @@ -235,6 +235,12 @@ def show_command_palette(self, *_) -> None: def show_symbol_palette(self, *_) -> None: self.base.palette.show("@") + def show_active_editors(self, *_) -> None: + self.base.palette.show("active:") + + def show_file_search_palette(self, *_) -> None: + self.base.palette.show("") + def documentation(self, *_) -> None: web.open("https://billyeatcookies.github.io/biscuit/") diff --git a/pyproject.toml b/pyproject.toml index 8c751f53..e5e98095 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "biscuit" -version = "2.65.0" +version = "2.65.1" description = "The uncompromising code editor" authors = ["Billy "] license = "MIT"