about summary refs log tree commit diff stats
path: root/src/server/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-27 17:34:02 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-27 17:34:53 +0200
commit3f5135204c0902e2123194e0319fda7afd57bd81 (patch)
treefc9958a2c405e94419580c837c20564b08d69dd8 /src/server/buffer.nim
parent4b4b95b6e1c366fbd4e73f5bd0c0ea555bf77490 (diff)
downloadchawan-3f5135204c0902e2123194e0319fda7afd57bd81.tar.gz
buffer: add toggleImages
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r--src/server/buffer.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 56ad946f..1bdf1c30 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -67,7 +67,7 @@ type
     bcReadCanceled, bcClick, bcFindNextLink, bcFindPrevLink, bcFindNthLink,
     bcFindRevNthLink, bcFindNextMatch, bcFindPrevMatch, bcGetLines,
     bcUpdateHover, bcGotoAnchor, bcCancel, bcGetTitle, bcSelect, bcClone,
-    bcFindPrevParagraph, bcFindNextParagraph, bcMarkURL
+    bcFindPrevParagraph, bcFindNextParagraph, bcMarkURL, bcToggleImages
 
   BufferState = enum
     bsLoadingPage, bsLoadingResources, bsLoaded
@@ -1816,6 +1816,9 @@ proc markURL*(buffer: Buffer; schemes: seq[string]) {.proxy.} =
           stack.add(element)
   buffer.do_reshape()
 
+proc toggleImages*(buffer: Buffer) {.proxy.} =
+  buffer.config.images = not buffer.config.images
+
 macro bufferDispatcher(funs: static ProxyMap; buffer: Buffer;
     cmd: BufferCommand; packetid: int; r: var BufferedReader) =
   let switch = newNimNode(nnkCaseStmt)