Updated screenshots. Fixed URL dialog keypress handler.

This commit is contained in:
Mark Qvist 2021-09-18 15:09:41 +02:00
parent 012721ee57
commit f41d1eecb0
7 changed files with 15 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 86 KiB

BIN
docs/screenshots/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
docs/screenshots/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -1 +1 @@
__version__ = "0.0.8" __version__ = "0.0.9"

View File

@ -429,7 +429,7 @@ class Browser:
self.delegate.columns.contents[1] = (self.display_widget, options) self.delegate.columns.contents[1] = (self.display_widget, options)
def url_dialog(self): def url_dialog(self):
e_url = urwid.Edit(caption="URL : ", edit_text=self.current_url()) e_url = UrlEdit(caption="URL : ", edit_text=self.current_url())
def dismiss_dialog(sender): def dismiss_dialog(sender):
self.close_dialogs() self.close_dialogs()
@ -444,6 +444,7 @@ class Browser:
urwid.Columns([("weight", 0.45, urwid.Button("Cancel", on_press=dismiss_dialog)), ("weight", 0.1, urwid.Text("")), ("weight", 0.45, urwid.Button("Go", on_press=confirmed))]) urwid.Columns([("weight", 0.45, urwid.Button("Cancel", on_press=dismiss_dialog)), ("weight", 0.1, urwid.Text("")), ("weight", 0.45, urwid.Button("Go", on_press=confirmed))])
]), title="Enter URL" ]), title="Enter URL"
) )
e_url.confirmed = confirmed
dialog.confirmed = confirmed dialog.confirmed = confirmed
dialog.delegate = self dialog.delegate = self
bottom = self.display_widget bottom = self.display_widget
@ -848,10 +849,15 @@ def size_str(num, suffix='B'):
return "%.2f%s%s" % (num, last_unit, suffix) return "%.2f%s%s" % (num, last_unit, suffix)
class UrlDialogLineBox(urwid.LineBox): class UrlDialogLineBox(urwid.LineBox):
def keypress(self, size, key): def keypress(self, size, key):
if key == "esc": if key == "esc":
self.delegate.close_dialogs() self.delegate.close_dialogs()
if key == "enter": else:
self.confirmed(self) return super(UrlDialogLineBox, self).keypress(size, key)
else:
return super(UrlDialogLineBox, self).keypress(size, key) class UrlEdit(urwid.Edit):
def keypress(self, size, key):
if key == "enter":
self.confirmed(self)
else:
return super(UrlEdit, self).keypress(size, key)