Skip to content

Commit

Permalink
take closer into account when expanding tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidswelt committed May 4, 2008
1 parent 3eead55 commit b82ed49
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions aquamacs-tabbar.el
Expand Up @@ -5,7 +5,7 @@
;; Author: Nathaniel Cunningham <nathaniel.cunningham@gmail.com>
;; Maintainer: Nathaniel Cunningham <nathaniel.cunningham@gmail.com>
;; Created: February 2008
;; Revision: $Id: aquamacs-tabbar.el,v 1.22 2008/05/03 09:13:49 davidswelt Exp $
;; Revision: $Id: aquamacs-tabbar.el,v 1.23 2008/05/04 12:59:15 davidswelt Exp $

;; load original tabbar-mode
(require 'tabbar)
Expand Down Expand Up @@ -602,14 +602,22 @@ buffer; see also `char-width'."
(i 0))
(cond
((< sw width)
(let ((sp (propertize
" " 'display
`(space
:width
(,(max 4 (min (- 75 (/ (* tabbar-char-width n) 2) )
(floor (/ (* (frame-char-width) (- width sw)) 2)))))))))
(concat sp str sp)))
(t str))))
(let* ((l-l (max 4 (min (- 75 (/ (* tabbar-char-width n) 2) )
(floor (/ (* (frame-char-width) (- width sw)) 2)))))
(sp-r (propertize
" " 'display
`(space
:width
(, l-l))))
(sp-l (propertize
" " 'display
`(space
:width
;; subtract half the width of closer button
;; the full width wouldn't look as good
(,(max 4 (- l-l 7)))))))
(concat sp-l str sp-r)))
(t str))))


;; function to unconditionally open a new tab
Expand Down

0 comments on commit b82ed49

Please sign in to comment.