From e2aa9a7a7bd360f46f5343c556c70081979fcddc Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 27 Jun 2005 23:53:02 +0000 Subject: (chess-images-determine-size): On Macs and Windows, reduce the screen height by 80 instead of just 20, to account for the Start/Status bar. (chess-images-popup): Pass in a `font' to `chess-display-popup-in-frame', so that the pixel height for each graphical piece is computed correctly. (chess-images-change-size): Foricbly popup the chess buffer when changing the size of graphical pieces. --- chess-images.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'chess-images.el') diff --git a/chess-images.el b/chess-images.el index 58ddcd4..45259a3 100644 --- a/chess-images.el +++ b/chess-images.el @@ -197,7 +197,11 @@ called." chess-images-size (chess-images-best-size (- (if display (x-display-pixel-height display) - (display-pixel-height)) 20) + (display-pixel-height)) + ;; On Macs and Windows, account for + ;; the Start/Status bar + (if (memq window-system '(mac windows w32)) + 80 20)) (- (if display (x-display-pixel-width display) (display-pixel-width)) 20))))) @@ -224,7 +228,8 @@ called." chess-images-separate-frame))) ;; create the frame whenever necessary (chess-display-popup-in-frame (+ max-char-height 2) - max-char-width)) + max-char-width + (cdr (assq 'font (frame-parameters))))) (chess-display-popup-in-window))) (defun chess-images-piece-image (piece rank file) @@ -313,11 +318,12 @@ Common modes are: (window (get-buffer-window buffer)) (frame (and window (window-frame window)))) (setq chess-images-size size - chess-images-cache nil ) + chess-images-cache nil) (if frame (delete-frame frame t)) (chess-message 'redrawing-frame) (chess-display-update buffer t) + (chess-display-popup buffer) (chess-message 'redrawing-frame-done))) (defun chess-images-resize () -- cgit v1.2.3