manateelazycat / awesome-tab

Emacs package to provide out-of-the-box configuration to use tabs.
384 stars 38 forks source link

wrong icon color and font face #96

Closed Eason0210 closed 3 years ago

Eason0210 commented 3 years ago

When update to new version. The font of Tab doesn't follow theme's setting. And the color of icon shows black color when the buffer is dired mode or log message.

image

AmaiKinono commented 3 years ago

I noticed similar problems using the default theme:

image

But the color shows correctly on my side.

It works with doom-themes:

image

That's why I didn't notice the problem when I submit the patch.

The following code solves the font problem:

(set-face-attribute 'tab-line nil :inherit 'default)

You see sans-serif fonts because the face tab-line inherits variable-pitch by default.

I have no idea on the color problem. Does it happen with $ emacs -Q?

Edit: I didn't notice that you said the color problem only happens to dired mode and log message. My fault. I can confirm this happens to $ emacs -Q.

Eason0210 commented 3 years ago

@AmaiKinono You are right. (set-face-attribute 'tab-line nil :inherit 'default) solves the font face issue. Thanks

manateelazycat commented 3 years ago

Newest version has fixed this issue.

AmaiKinono commented 3 years ago

There's still the color problem. It can be easily solved by:

(set-face-attribute 'tab-line nil
                    :inherit 'default
                    :foreground 'unspecified)

Emacs specifies foreground and background for tab-line, but not for header-line (I don't know why the have such a strong opinion on what should tab-line look like). I suspect the background color would also cause problems later. And, if Emacs people decide to add more attributes, then we'll have to deal with them.

To solve it once and for all:

(face-spec-set awesome-tab-display-line
               '((t :inherit 'default))
               'face-defface-spec)

Which redefines the face, rather then overriding the attributes of it.

cc @manateelazycat

Edit: For whoever is interested, If you are writing a mode that sets some faces like this when enabled, and want to restore them when disabled, you could cache the original value beforehand:

(get awesome-tab-display-line 'face-defface-spec)

and set the faces to the cached values later. Awesome-tab could also do this, but maybe it's not that necessary since tab-line are not likely to be used for other things.

manateelazycat commented 3 years ago

Thanks for tips, I have commit new patch to fix this issue.