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

Support tab-bar and tab-bar-tab* faces separately #7

Open
alphapapa opened this issue Apr 21, 2024 · 3 comments
Open

Support tab-bar and tab-bar-tab* faces separately #7

alphapapa opened this issue Apr 21, 2024 · 3 comments

Comments

@alphapapa
Copy link

Hi again Prot,

As I mentioned in #6, the new support for the tab-bar face is helpful, but it precludes the user from applying a different face to tab-bar-tab* faces (e.g. to have tabs themselves in one font and other, non-tab text in the tab bar in another).

Could the tab-bar and tab-bar-tab* faces be handled separately in the next version of Fontaine? i.e. I'd suggest that tab-bar-tab inherit from tab-bar by default, and that tab-bar-tab* faces inherit from tab-bar-tab, but that they be specified in a way so that tab-bar could be set to a different font than tab-bar-tab if desired.

Thanks for your work on Fontaine.

@protesilaos
Copy link
Owner

Hello Adam!

Yes, sure! Can you list all the faces you are interested in? We will take it from there.

I guess this extends to the tab-line as well?

@alphapapa
Copy link
Author

I don't know if I have a list of faces per se. But if it helps, here's the code I currently use to customize these faces when changing theme:

(progn
  ;; NOTE: If Fontaine gains support for the :width attribute, this
  ;; code would likely be unnecessary. See
  ;; <https://github.com/protesilaos/fontaine/issues/6> and
  ;; <https://github.com/protesilaos/fontaine/issues/7>.
  (defun ap/modify-faces (&rest faces)
    (pcase-dolist (`(,face . ,spec) faces)
      (map-do (lambda (attribute value)
                (set-face-attribute face nil attribute value))
              spec)))

  (defun ap/modify-tab-bar-faces (&rest _)
    (ap/modify-faces
     '(tab-bar :family nil :inherit (variable-pitch))
     '(tab-bar-tab :family "NK57 Monospace" :width condensed :weight bold
                   :inherit (tab-bar))
     '(tab-bar-tab-inactive :inherit (tab-bar-tab))))

  (defun ap/modify-tab-line-faces (&rest _)
    (ap/modify-faces
     '(tab-line-tab-special :slant italic)))

  ;; The tab-bar tabs should be "NK57 Monospace" condensed, but
  ;; the rest of the tab-bar line should be variable-pitch to
  ;; save space.
  (add-hook 'enable-theme-functions #'ap/modify-tab-bar-faces)
  (add-hook 'enable-theme-functions #'ap/modify-tab-line-faces)
  (ap/modify-tab-bar-faces)
  (ap/modify-tab-line-faces))

Please let me know if you have any other thoughts or questions.

@protesilaos
Copy link
Owner

Okay, I will look into this. I am not using either of those bars so I have to test that we do not get into some awkward scenario by using different fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants