Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for tab-line. #6

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions spacious-padding.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
:header-line-width 4
:mode-line-width 6
:tab-width 4
:tab-line-width 4
:right-divider-width 30
:scroll-bar-width 8
:left-fringe-width 8
Expand All @@ -79,8 +80,9 @@ following:
fringes on each side of the window (the area where line
wrapping and other indicators are displayed).

- `:tab-width' concerns the padding around tab buttons. For the
time being, `tab-bar-mode' is the only one affected.
- `:tab-width' concerns the padding around buttons of the tab-bar.

- `:tab-line-width' concerns the padding around buttons of the tab-line.

- `:header-line-width', `mode-line-width', `scroll-bar-width'
point to the header-line, mode-line, and scroll-bar,
Expand All @@ -93,6 +95,7 @@ For the technicalities, read Info node `(elisp) Frame Layout'."
(const :left-fringe-width)
(const :right-fringe-width)
(const :tab-width)
(const :tab-line-width)
(const :header-line-width)
(const :mode-line-width)
(const :scroll-bar-width))
Expand Down Expand Up @@ -176,11 +179,14 @@ Examples of valid configurations:
'(header-line header-line-highlight)
"Header line faces relevant to `spacious-padding-mode'.")

;; TODO 2023-11-16: Cover `tab-line-mode'.
(defvar spacious-padding--tab-faces
'(tab-bar tab-bar-tab tab-bar-tab-inactive)
"Tab faces relevant to `spacious-padding-mode'.")

(defvar spacious-padding--tab-line-faces
'(tab-line tab-line-tab tab-line-tab-inactive)
"Tab faces relevant to `spacious-padding-mode'.")

(defun spacious-padding--get-box-width (key)
"Get width for :box of face represented by KEY in `spacious-padding-widths'.
Return 4 if KEY does not have a value."
Expand All @@ -195,6 +201,8 @@ Return 4 if KEY does not have a value."
(spacious-padding--get-box-width :header-line-width))
((memq face spacious-padding--tab-faces)
(spacious-padding--get-box-width :tab-width))
((memq face spacious-padding--tab-line-faces)
(spacious-padding--get-box-width :tab-line-width))
(t (error "`%s' is not relevant to `spacious-padding-mode'" face))))

(defun spacious-padding--get-face-overline-color (face fallback subtle-key)
Expand Down Expand Up @@ -251,6 +259,9 @@ overline."
`(mode-line-highlight ((t :box (:color ,fg-main))))
`(tab-bar-tab ((t ,@(spacious-padding-set-face-box-padding 'tab-bar-tab 'tab-bar))))
`(tab-bar-tab-inactive ((t ,@(spacious-padding-set-face-box-padding 'tab-bar-tab-inactive 'tab-bar))))
`(tab-line-tab ((t ,@(spacious-padding-set-face-box-padding 'tab-line-tab 'tab-line))))
`(tab-line-tab-inactive ((t ,@(spacious-padding-set-face-box-padding 'tab-line-tab-inactive 'tab-line))))
`(tab-line-tab-active ((t ,@(spacious-padding-set-face-box-padding 'tab-line-tab-active 'tab-line))))
`(vertical-border ((t :background ,bg-main :foreground ,bg-main)))
`(,@(spacious-padding-set-window-divider 'window-divider bg-main))
`(,@(spacious-padding-set-window-divider 'window-divider-first-pixel bg-main))
Expand All @@ -270,6 +281,8 @@ overline."
'(mode-line-highlight (( )))
'(tab-bar-tab (( )))
'(tab-bar-tab-inactive (( )))
'(tab-line-tab (( )))
'(tab-line-tab-inactive (( )))
`(vertical-border (( )))
'(window-divider (( )))
'(window-divider-first-pixel (( )))
Expand Down