summaryrefslogtreecommitdiffstats
path: root/girok/calendar_cli/calendar_app.py
diff options
context:
space:
mode:
Diffstat (limited to 'girok/calendar_cli/calendar_app.py')
-rw-r--r--girok/calendar_cli/calendar_app.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/girok/calendar_cli/calendar_app.py b/girok/calendar_cli/calendar_app.py
index 443aba6..fc1d27d 100644
--- a/girok/calendar_cli/calendar_app.py
+++ b/girok/calendar_cli/calendar_app.py
@@ -1,37 +1,37 @@
+from rich.style import Style
+from rich.table import Table
+from textual import log
from textual.app import App, ComposeResult
from textual.containers import Container, Horizontal, Vertical
-from textual.widgets import Button, Footer, Header, Static, Label, Placeholder, Tree
from textual.messages import Message
from textual.widget import Widget
+from textual.widgets import Button, Footer, Header, Label, Placeholder, Static, Tree
import girok.api.category as category_api
-import girok.utils.calendar as calendar_utils
-from rich.table import Table
-from rich.style import Style
-from textual import log
-
-from girok.calendar_cli.sidebar import SidebarContainer, CategoryTree
+import girok.calendar_cli.utils as calendar_utils
from girok.calendar_cli.calendar_container import CalendarContainer
-import girok.constants as constants
-
+from girok.calendar_cli.sidebar import CategoryTree, SidebarContainer
+from girok.calendar_cli.entity import Category
+from girok.constants import Emoji
+
class CalendarApp(Horizontal):
CSS_PATH = "./demo_dock.css"
-
+
def compose(self):
yield SidebarContainer(id="sidebar-container")
yield CalendarContainer(id="calendar-container")
-
- def on_category_tree_category_changed(self, event):
- self.query_one(CalendarContainer).update_cat_path(event.cat_path)
+
+ def on_category_tree_category_changed(self, event: CategoryTree.CategoryChanged):
+ self.query_one(CalendarContainer).update_category(event.category)
cat_tree = self.query_one(CategoryTree)
-
+
def on_tag_tree_tag_changed(self, event):
tag = event.tag
- if tag.endswith(" " + constants.LEFT_ARROW_EMOJI):
+ if tag.endswith(" " + Emoji.LEFT_ARROW):
tag = tag[:-2]
if tag == "All Tags":
- tag = ""
+ tag = None
self.query_one(CalendarContainer).update_tag(tag)
-
+
def on_category_tree_custom_test_message(self, event):
- self.refresh() \ No newline at end of file
+ self.refresh()