diff --git a/nomadnet/ui/textui/Browser.py b/nomadnet/ui/textui/Browser.py index 7c355cc..1b57133 100644 --- a/nomadnet/ui/textui/Browser.py +++ b/nomadnet/ui/textui/Browser.py @@ -31,6 +31,8 @@ class BrowserFrame(urwid.Frame): self.delegate.reload() elif key == "ctrl u": self.delegate.url_dialog() + elif key == "ctrl l": + self.delegate.load_images() elif key == "ctrl s": self.delegate.save_node_dialog() elif key == "ctrl b": @@ -644,7 +646,7 @@ class Browser: self.page_images = {} self.browser_body = urwid.AttrMap(ScrollBar(Scrollable(pile, force_forward_keypress=True), thumb_char="\u2503", trough_char=" "), "scrollbar") self.detect_partials() - self.detect_images() + if self.should_load_images(): self.detect_images() self.init_folds() def image_cache_path(self, url): @@ -668,6 +670,13 @@ class Browser: if hasattr(screen, "purge_images"): screen.purge_images() except Exception: pass + def should_load_images(self): + return False + + def load_images(self): + if not self.image_rendering_supported: return + else: self.detect_images() + def detect_images(self): if not self.image_rendering_supported: return for w in self.attr_maps: diff --git a/nomadnet/ui/textui/Network.py b/nomadnet/ui/textui/Network.py index 9f65266..24c315c 100644 --- a/nomadnet/ui/textui/Network.py +++ b/nomadnet/ui/textui/Network.py @@ -30,7 +30,7 @@ class BrowserShortcuts(): shortcut_text = "[C-w] Disconnect [C-d] Back [C-f] Forward [C-r] Reload [C-u] URL " if app.config["textui"]["clipboard_copy"]: shortcut_text += "[C-y] Copy " shortcut_text += "[C-g] Fullscreen [C-s / C-b] Save Node" - if browser.image_rendering_supported: shortcut_text += " [C-i] Load Images" + if browser.image_rendering_supported: shortcut_text += " [C-l] Load Images" self.widget = urwid.AttrMap(urwid.Text(shortcut_text), "shortcutbar") class DialogLineBox(urwid.LineBox):