The text-size used is now configurable as a key argument.
Thu Apr 24 12:01:12 PDT 2008 Thomas Persson <tompa.persson@gmail.com>
* The text-size used is now configurable as a key argument.
Warning: CRC errors found. These are probably harmless but should be repaired.
See 'darcs gzcrcs --help' for more information.
diff -rN -u old-climplayer/directory-browser.lisp new-climplayer/directory-browser.lisp
--- old-climplayer/directory-browser.lisp 2014-07-24 01:30:32.000000000 -0700
+++ new-climplayer/directory-browser.lisp 2014-07-24 01:30:32.000000000 -0700
@@ -1,5 +1,7 @@
(in-package :climplayer)
+(defvar *climplayer-text-size* :small)
+
(defvar *climplayer-conf-directories-file* nil)
(define-application-frame select ()
@@ -57,10 +59,13 @@
(with-output-as-presentation (stream path 'pathname)
(multiple-value-bind (x y)
(stream-cursor-position stream)
- (draw-pattern* stream pattern
- x
- (- y 2))
- (stream-increment-cursor-position stream
+ (draw-pattern* stream pattern
+ x
+ (- y (ceiling (/ (- 16
+ (text-style-height (make-text-style nil nil *climplayer-text-size*)
+ stream))
+ 2))))
+ (stream-increment-cursor-position stream
(+ (pattern-width pattern)
2)
0))
@@ -68,7 +73,7 @@
(defun display-browser (frame pane)
(with-end-of-line-action (pane :allow)
- (with-text-size (pane :small)
+ (with-text-size (pane *climplayer-text-size*)
(print-pathname (make-pathname
:directory (reverse (cdr (reverse (pathname-directory (current-directory *application-frame*))))))
pane
@@ -87,7 +92,7 @@
(defun display-selected (frame pane)
(with-end-of-line-action (pane :allow)
- (with-text-size (pane :small)
+ (with-text-size (pane *climplayer-text-size*)
(write-string "selected:"
pane)
(terpri pane)
diff -rN -u old-climplayer/gui.lisp new-climplayer/gui.lisp
--- old-climplayer/gui.lisp 2014-07-24 01:30:32.000000000 -0700
+++ new-climplayer/gui.lisp 2014-07-24 01:30:32.000000000 -0700
@@ -221,12 +221,14 @@
`(:ink ,+dark-green+
:text-style ,(make-text-style nil :bold nil)))))
-(defun climplayer (&key new-process)
+(defun climplayer (&key new-process (text-size :small))
"Start climplayer."
(flet ((run-climplayer ()
(setf *climplayer-conf-directory*
(merge-pathnames (pathname ".climplayer/")
(user-homedir-pathname))
+ *climplayer-text-size*
+ text-size
*climplayer-conf-file*
(merge-pathnames (pathname "climplayer-conf.lisp")
*climplayer-conf-directory*)
@@ -315,8 +317,15 @@
(call-next-method))
(call-next-method)))
+(defun line-height (pane)
+ (+ (text-style-height (make-text-style nil nil *climplayer-text-size*) pane)
+ (if (equal pane
+ (find-pane-named *climplayer-frame* 'browser))
+ 4
+ 2)))
+
(defun display-info (frame pane)
- (with-text-size (pane :small)
+ (with-text-size (pane *climplayer-text-size*)
(let ((node (currently-playing frame)))
(updating-output (pane :unique-id node
:id-test #'eq
@@ -342,7 +351,7 @@
(+ y 10))))
(defun display-controls (frame pane)
- (with-text-size (pane :small)
+ (with-text-size (pane *climplayer-text-size*)
(with-text-face (pane :bold)
(write-string " " pane)
(with-output-as-presentation (pane `(com-previous) 'command)
@@ -428,13 +437,12 @@
(defun display-extended-info (frame pane)
(let ((speed (format nil "~A" (float (player-speed frame)))))
- (with-text-size (pane :small)
- (write-string "Speed: "
- pane)
- (write-string (if (< 5 (length speed))
- (subseq speed 0 5)
- speed)
- pane))))
+ (write-string "Speed: "
+ pane)
+ (write-string (if (< 5 (length speed))
+ (subseq speed 0 5)
+ speed)
+ pane)))
(defun node-status (node)
(cond ((eq node (currently-playing *climplayer-frame*))
@@ -452,7 +460,10 @@
(stream-cursor-position stream)
(draw-pattern* stream pattern
x
- (- y 2))
+ (- y (ceiling (/ (- 16
+ (text-style-height (make-text-style nil nil *climplayer-text-size*)
+ stream))
+ 2))))
(stream-increment-cursor-position stream
(+ (pattern-width pattern)
2)
@@ -463,7 +474,7 @@
(defun display-file-browser (frame pane)
(with-end-of-line-action (pane :allow)
- (with-text-size (pane :small)
+ (with-text-size (pane *climplayer-text-size*)
(let ((contents (node-contents (currently-browsing frame))))
(if (eq (type-of (currently-browsing frame))
'container-node)
@@ -691,9 +702,9 @@
(< current-y min-y))
(scroll-y pane
current-y))
- ((> current-y (- max-y 15))
+ ((> current-y (- max-y (line-height pane)))
(scroll-y pane
- (+ 15
+ (+ (line-height pane)
(- current-y
(- max-y
min-y))))))))
@@ -706,8 +717,10 @@
(max-y (rectangle-max-y (pane-viewport-region pane)))
(current-y (+ (* (position node
(node-contents (node-parent node)))
- 17)
- 28)))
+ (line-height pane))
+ (- (* (line-height pane)
+ 2)
+ 6))))
(scroll)))
(when (and (or (eq tabs :all)
(eq tabs :search))
@@ -719,7 +732,7 @@
(max-y (rectangle-max-y (pane-viewport-region pane)))
(current-y (* (position node
(current-playlist *application-frame*))
- 15)))
+ (line-height pane))))
(scroll))))))
(defun stream-to-string (stream)
@@ -1299,7 +1312,7 @@
(defun display-results (frame pane)
(when (sheet-parent pane)
(with-end-of-line-action (pane :allow)
- (with-text-size (pane :small)
+ (with-text-size (pane *climplayer-text-size*)
(let* ((page (sheet-to-page (sheet-parent (sheet-parent (sheet-parent (sheet-parent pane))))))
(matching (find-node (play-list frame)
(gadget-value (search-field page)))))