]> git.eshelyaron.com Git - emacs.git/commitdiff
(tool-bar-images-pixel-height): New variable.
authorGerd Moellmann <gerd@gnu.org>
Wed, 24 Jan 2001 15:38:36 +0000 (15:38 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 24 Jan 2001 15:38:36 +0000 (15:38 +0000)
(command-line): After loading the user's init file, when
tool-bar-mode is on, increase the frame's size by some lines for
the tool-bar.

lisp/ChangeLog
lisp/startup.el

index 94bfdad322bb4f44c93bd319f418598edf3ffb35..2595c257b855cb5c9556d0e9b4c7e66c1b57a986 100644 (file)
@@ -1,3 +1,12 @@
+2001-01-24  Gerd Moellmann  <gerd@gnu.org>
+
+       * startup.el (tool-bar-images-pixel-height): New variable.
+       (command-line): After loading the user's init file, when
+       tool-bar-mode is on, increase the frame's size by some lines for
+       the tool-bar.
+
+       * frame.el (frame-initialize): Create the initial frame invisible.
+       
 2001-01-24  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * language/chinese.el (chinese-iso-8bit): MIME:GB2312.
index d11ffba48fd5eac916115aeb6d8ce3a2ebb0279a..d11b9945b0f4e6fa226f7851ce9222f218dd87e3 100644 (file)
@@ -529,6 +529,9 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     ("--foreground-color" . "-fg")
     ("--background-color" . "-bg")))
 
+(defconst tool-bar-images-pixel-height 24
+  "Height in pixels of images in the tool bar.")
+
 ;; Handle the X-like command line parameters "-fg", "-bg", "-name", etc.
 (defun tty-handle-args (args)
   (let ((rest nil))
@@ -758,7 +761,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   (when (and (not noninteractive)
             (display-graphic-p)
             (> (frame-parameter nil 'tool-bar-lines) 0))
-    (tool-bar-mode t))
+    (tool-bar-mode 1))
 
   ;; Can't do this init in defcustom because window-system isn't set.
   (when (and (not noninteractive)
@@ -932,6 +935,23 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 
   (run-hooks 'after-init-hook)
 
+  ;; When the tool-bar is on, increase the frame's height by the
+  ;; number of lines it usually occupies.  The normal height of images
+  ;; in the tool bar is assumed to be `tool-bar-images-pixel-height'.
+  (when tool-bar-mode
+    (let* ((char-height (frame-char-height))
+          (bar-height (+ tool-bar-images-pixel-height
+                         tool-bar-button-margin
+                         tool-bar-button-relief))
+          (lines (/ (+ bar-height (1- char-height)) char-height)))
+      (set-frame-height nil (+ (frame-height) lines))))
+
+  ;; Now, make the frame visible.  If we make it visible before this
+  ;; point, ugly flickering can happens because of possibly changing
+  ;; frame heights.  Note that any message or error make the frame
+  ;; visible automatically.
+  (make-frame-visible)
+
   ;; If *scratch* exists and init file didn't change its mode, initialize it.
   (if (get-buffer "*scratch*")
       (save-excursion