Manual image loading action

This commit is contained in:
Mark Qvist
2026-09-06 12:29:52 +02:00
parent 05b968ecf6
commit 6451d7fa7f
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -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:
+1 -1
View File
@@ -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):