Manual image loading action

This commit is contained in:
Mark Qvist 2026-09-06 12:29:52 +02:00
parent 05b968ecf6
commit 6451d7fa7f
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

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: