~nhanb/mcross

dde42d2fcb0e1a0d853199ab07449cb09273b061 — Bùi Thành Nhân 11 months ago 701c862
more lenient address input
2 files changed, 15 insertions(+), 2 deletions(-)

M src/mcross/gui/controller.py
M src/mcross/gui/view.py
M src/mcross/gui/controller.py => src/mcross/gui/controller.py +1 -1
@@ 114,7 114,7 @@ class Controller:
            self.model.history.visit(resp.url)
            await self.put_gui_op(self.view.render_page)

        except ConnectionError as e:
        except (ConnectionError, OSError) as e:
            await self.put_gui_op(statusbar_logger.info, str(e))
            raise


M src/mcross/gui/view.py => src/mcross/gui/view.py +14 -1
@@ 174,8 174,21 @@ class View:
        style.theme_use(TTK_THEME)

    def _on_go(self, ev=None):
        orig_url = self.address_bar.get()
        url = orig_url.strip()

        if url.startswith("gemini://"):
            url = url[9:]

        if not url:
            return

        if url != orig_url:
            self.address_bar.delete(0, "end")
            self.address_bar.insert(0, url)

        if self.go_callback is not None:
            self.go_callback("gemini://" + self.address_bar.get())
            self.go_callback("gemini://" + url)

    def _on_link_enter(self, ev):
        if self.allow_changing_cursor: