mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-04-27 23:31:20 -07:00
feat(doom): tab-bar: add basic theming
This commit is contained in:
parent
9c3d762f39
commit
80c220a36e
1 changed files with 41 additions and 0 deletions
|
|
@ -1,10 +1,51 @@
|
|||
;;; ui/doom/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +doom-padding 6)
|
||||
|
||||
|
||||
;;
|
||||
;;; Configuration
|
||||
|
||||
;;;###package pos-tip
|
||||
(setq pos-tip-internal-border-width 6
|
||||
pos-tip-border-width 1)
|
||||
|
||||
|
||||
(when (modulep! +tabs)
|
||||
(after! tab-bar
|
||||
;; Add some left-side padding to tab bar labels.
|
||||
(setq tab-bar-tab-name-format-function #'+doom-tab-name-format-fn)
|
||||
(defun +doom-tab-name-format-fn (tab i)
|
||||
(let ((name (concat " " (copy-sequence (alist-get 'name tab)))))
|
||||
(run-hook-wrapped 'tab-bar-tab-name-format-functions
|
||||
(lambda (fun)
|
||||
(setq name (funcall fun name tab i))
|
||||
nil))
|
||||
name))
|
||||
|
||||
;; Give the tab bar some artifical height.
|
||||
(defvar +doom-tab-bar-height (+ (window-font-height nil 'tab-bar-tab) +doom-padding))
|
||||
(defadvice! +doom-tab-bar-separator-a ()
|
||||
:override #'tab-bar-separator
|
||||
(or tab-bar-separator
|
||||
(if (window-system)
|
||||
(if (image-type-available-p 'pbm)
|
||||
(with-memoization (frame-parameter nil 'tab-bar-separator)
|
||||
(propertize
|
||||
" " 'display
|
||||
(ignore-errors
|
||||
(create-image
|
||||
(concat (format "P1\n%i %i\n" 2 +doom-tab-bar-height)
|
||||
(make-string (* 2 +doom-tab-bar-height) ?1)
|
||||
"\n")
|
||||
'pbm t :scale 1 :foreground "None" :ascent 'center))))
|
||||
" ")
|
||||
"|")))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(use-package! doom-themes
|
||||
;; improve integration w/ org-mode
|
||||
:hook (doom-load-theme . doom-themes-org-config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue