diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-12-24 11:43:15 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-12-24 11:43:15 -0500 |
| commit | 2278c712768e9cda62844aa1fd9281d94f540463 (patch) | |
| tree | 04d1ca126859a5563d2391cfba47cf722c713937 /browset.py | |
| parent | 09b393bf5de74e11a4a46ab4c697175e4ca8a480 (diff) | |
| download | browset-2278c712768e9cda62844aa1fd9281d94f540463.tar.gz | |
Toolbar buttons: Make refresh and up buttons work
Diffstat (limited to 'browset.py')
| -rw-r--r-- | browset.py | 8 |
1 files changed, 6 insertions, 2 deletions
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) |
