From 2278c712768e9cda62844aa1fd9281d94f540463 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 24 Dec 2022 11:43:15 -0500 Subject: Toolbar buttons: Make refresh and up buttons work --- browset.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'browset.py') diff --git a/browset.py b/browset.py index c316c1d..3b32939 100644 --- a/browset.py +++ b/browset.py @@ -18,9 +18,9 @@ class Browset(App): yield Footer() yield Container( Button("🔙"), # ⏪ - Button("🔝"), # ⏫ + Button("🔝", name='../'), # ⏫ Button("🔜"), # ⏩ - Button("🔄"), # 🔁 + Button("🔄", variant='primary', name='refresh'), # 🔁 Input(placeholder="Enter URI", id="url"), id="toolbar" @@ -30,6 +30,10 @@ class Browset(App): self._do_url(message.value) async def on_button_pressed(self, event: Button.Pressed) -> None: + if event.button.variant == 'primary': + if event.button.name == "refresh": + self._do_url(self.url) + else: url = event.button.name if not ":" in url: url = GeminiProtocol.relativeURL(url, self.url) -- cgit 1.4.1