Mercurial > emacs
comparison lisp/frame.el @ 35856:41652bd90468
(frame-notice-user-settings): When resizing the initial
frame because the tool bar is off, also change the frame's top
position if a negative top position was specified.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 02 Feb 2001 13:55:42 +0000 |
parents | 7b487e845547 |
children | 620c4b282fce |
comparison
equal
deleted
inserted
replaced
35855:6b4581bb1cfa | 35856:41652bd90468 |
---|---|
286 (when (frame-live-p frame-initial-frame) | 286 (when (frame-live-p frame-initial-frame) |
287 | 287 |
288 ;; When tool-bar has been switched off, correct the frame size | 288 ;; When tool-bar has been switched off, correct the frame size |
289 ;; by the lines added in x-create-frame for the tool-bar and | 289 ;; by the lines added in x-create-frame for the tool-bar and |
290 ;; switch `tool-bar-mode' off. | 290 ;; switch `tool-bar-mode' off. |
291 (when (and (display-graphic-p) | 291 (when (display-graphic-p) |
292 (or (eq 0 (cdr (assq 'tool-bar-lines initial-frame-alist))) | 292 (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist) |
293 (eq 0 (cdr (assq 'tool-bar-lines default-frame-alist))))) | 293 (assq 'tool-bar-lines default-frame-alist)))) |
294 (let* ((char-height (frame-char-height frame-initial-frame)) | 294 (when (or (null tool-bar-lines) |
295 (image-height 24) | 295 (null (cdr tool-bar-lines)) |
296 (margin (cond ((and (consp tool-bar-button-margin) | 296 (eq 0 (cdr tool-bar-lines))) |
297 (integerp (cdr tool-bar-button-margin)) | 297 (let* ((char-height (frame-char-height frame-initial-frame)) |
298 (> tool-bar-button-margin 0)) | 298 (image-height 24) |
299 (cdr tool-bar-button-margin)) | 299 (margin (cond ((and (consp tool-bar-button-margin) |
300 ((and (integerp tool-bar-button-margin) | 300 (integerp (cdr tool-bar-button-margin)) |
301 (> tool-bar-button-margin 0)) | 301 (> tool-bar-button-margin 0)) |
302 tool-bar-button-margin) | 302 (cdr tool-bar-button-margin)) |
303 (t 0))) | 303 ((and (integerp tool-bar-button-margin) |
304 (relief (if (and (integerp tool-bar-button-relief) | 304 (> tool-bar-button-margin 0)) |
305 (> tool-bar-button-relief 0)) | 305 tool-bar-button-margin) |
306 tool-bar-button-relief 3)) | 306 (t 0))) |
307 (lines (/ (+ image-height | 307 (relief (if (and (integerp tool-bar-button-relief) |
308 (* 2 margin) | 308 (> tool-bar-button-relief 0)) |
309 (* 2 relief) | 309 tool-bar-button-relief 3)) |
310 (1- char-height)) | 310 (lines (/ (+ image-height |
311 char-height)) | 311 (* 2 margin) |
312 (height (frame-parameter frame-initial-frame 'height))) | 312 (* 2 relief) |
313 (modify-frame-parameters frame-initial-frame | 313 (1- char-height)) |
314 (list (cons 'height (- height lines)))) | 314 char-height)) |
315 (tool-bar-mode -1))) | 315 (height (frame-parameter frame-initial-frame 'height)) |
316 | 316 (newparms (list (cons 'height (- height lines)))) |
317 (initial-top (cdr (assq 'top | |
318 frame-initial-geometry-arguments))) | |
319 (top (frame-parameter frame-initial-frame 'top))) | |
320 (when (and (consp initial-top) (eq '- (car initial-top))) | |
321 (setq newparms | |
322 (append newparms | |
323 `((top . ,(+ top (* lines char-height)))) | |
324 nil))) | |
325 (modify-frame-parameters frame-initial-frame newparms) | |
326 (tool-bar-mode -1))))) | |
317 | 327 |
318 ;; The initial frame we create above always has a minibuffer. | 328 ;; The initial frame we create above always has a minibuffer. |
319 ;; If the user wants to remove it, or make it a minibuffer-only | 329 ;; If the user wants to remove it, or make it a minibuffer-only |
320 ;; frame, then we'll have to delete the current frame and make a | 330 ;; frame, then we'll have to delete the current frame and make a |
321 ;; new one; you can't remove or add a root window to/from an | 331 ;; new one; you can't remove or add a root window to/from an |