]> gitweb.factorcode.org Git - factor.git/commitdiff
images.viewer.prettyprint: don't default to prettyprinting images this way, make...
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 14 Jul 2015 23:21:35 +0000 (16:21 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 14 Jul 2015 23:21:35 +0000 (16:21 -0700)
extra/images/viewer/prettyprint/prettyprint.factor

index 7398cf078d99a8f83c7584e9d5c7d4773caaa8f8..d35b1da3c027a16f3bb064a517b0bc7ef2303d5a 100644 (file)
@@ -4,8 +4,7 @@ sequences ui.gadgets.panes ;
 FROM: images => image ;
 IN: images.viewer.prettyprint
 
-TUPLE: image-section < section
-    image ;
+TUPLE: image-section < section image ;
 
 CONSTANT: approx-pixels-per-cell 8
 
@@ -16,8 +15,13 @@ CONSTANT: approx-pixels-per-cell 8
 
 M: image-section long-section
     short-section ;
+
 M: image-section short-section
     image>> <image-gadget> output-stream get write-gadget ;
 
+SYMBOL: prettyprint-images?
+
 M: image pprint*
-    <image-section> add-section ;
+    prettyprint-images? get
+    [ <image-section> add-section ]
+    [ call-next-method ] if ;