GNU bug report logs -
#50798
28.0.50; Tab line close button is off-center until it is highlighted with the mouse
Previous Next
Reported by: Po Lu <luangruo <at> yahoo.com>
Date: Sat, 25 Sep 2021 06:55:02 UTC
Severity: normal
Found in version 28.0.50
Fixed in version 28.0.60
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
> I'm not sure I follow: it is your code in
> tab-line-tab-name-format-default that applies the tab-line-highlight
> as mouse-face to the button:
>
> (apply 'propertize
> (concat (propertize name
> 'keymap tab-line-tab-map
> ;; Don't turn mouse-1 into mouse-2 (bug#49247)
> 'follow-link 'ignore)
> (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab))
> tab-line-close-button-show
> (not (eq tab-line-close-button-show
> (if selected-p 'non-selected 'selected)))
> tab-line-close-button)
> ""))
> `(
> tab ,tab
> ,@(if selected-p '(selected t))
> face ,face
> mouse-face tab-line-highlight))))
>
> You should be able not to do that for the close button. Or am I
> missing something?
It's possible to put properties on the close button only, but wouldn't this be
too ugly? This means that hovering the mouse over the tab name will highlight only
the tab name without highlighting the close button. And hovering the mouse
over the close button will highlight only the close button without highlighting
the tab name. So highlighting will be separate for the close button and
the rest of the tab with such patch:
[tab-line-close-highlight.patch (text/x-diff, inline)]
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 4a751b384e..daaa5531ef 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -125,7 +125,11 @@ tab-line-highlight
:group 'tab-line-faces)
(defface tab-line-close-highlight
- '((t :foreground "red"))
+ '((((class color) (min-colors 88))
+ :box (:line-width 1 :style released-button)
+ :background "grey85"
+ :foreground "black")
+ (t :inverse-video nil))
"Tab line face for highlighting of the close button."
:version "27.1"
:group 'tab-line-faces)
@@ -481,22 +485,23 @@ tab-line-tab-name-format-default
'tab-line-tab-inactive)))
(dolist (fn tab-line-tab-face-functions)
(setf face (funcall fn tab tabs face buffer-p selected-p)))
- (apply 'propertize
- (concat (propertize name
- 'keymap tab-line-tab-map
- ;; Don't turn mouse-1 into mouse-2 (bug#49247)
- 'follow-link 'ignore)
- (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab))
- tab-line-close-button-show
- (not (eq tab-line-close-button-show
- (if selected-p 'non-selected 'selected)))
- tab-line-close-button)
- ""))
- `(
- tab ,tab
- ,@(if selected-p '(selected t))
- face ,face
- mouse-face tab-line-highlight))))
+ (concat
+ (apply 'propertize name
+ `(
+ tab ,tab
+ ,@(if selected-p '(selected t))
+ face ,face
+ mouse-face tab-line-highlight
+ keymap ,tab-line-tab-map
+ ;; Don't turn mouse-1 into mouse-2 (bug#49247)
+ follow-link ignore
+ ))
+ (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab))
+ tab-line-close-button-show
+ (not (eq tab-line-close-button-show
+ (if selected-p 'non-selected 'selected)))
+ (propertize tab-line-close-button 'face face))
+ ""))))
(defun tab-line-format-template (tabs)
"Template for displaying tab line for selected window."
This bug report was last modified 3 years and 227 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.