all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: luangruo@yahoo.com, larsi@gnus.org, 50798@debbugs.gnu.org
Subject: bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse
Date: Sun, 03 Oct 2021 14:49:07 +0300	[thread overview]
Message-ID: <83pmsm8h1o.fsf@gnu.org> (raw)
In-Reply-To: <87ee93fbw8.fsf@mail.linkov.net> (message from Juri Linkov on Sat, 02 Oct 2021 22:36:15 +0300)

> From: Juri Linkov <juri@linkov.net>
> Cc: larsi@gnus.org,  luangruo@yahoo.com,  50798@debbugs.gnu.org
> Date: Sat, 02 Oct 2021 22:36:15 +0300
> 
> >   (defvar tab-line-close-button
> >     (propertize " x"
> > 		'display '(image :type xpm
> > 				 :file "tabs/close.xpm"
> > 				 :margin (2 . 0)
> > 				 :ascent center)
> > 		'keymap tab-line-tab-close-map
> > 		'mouse-face 'tab-line-close-highlight
> > 		'help-echo "Click to close tab")
> >     "Button for closing the clicked tab.")
> >
> > which seems to mean we should use 'tab-line-close-highlight' as the
> > mouse-face for this button.  But if I invoke (tab-line-format), which
> > seems to be what calculates the tab-line-format, I see this:
> >
> > (#(" xdisp.c x"
> >  1 8
> >    (tab #<buffer xdisp.c>
> >     face tab-line-tab-inactive
> >     mouse-face tab-line-highlight
> >     follow-link ignore)
> >  8 10
> >    (tab #<buffer xdisp.c>
> >     face tab-line-tab-inactive
> >     display (image :type xpm :file "tabs/close.xpm" :margin (2 . 0) :ascent center)
> >     mouse-face tab-line-highlight ...
> >
> > which seems to say we actually use the 'tab-line-highlight' face
> > instead for the close button?
> >
> > Could you please describe how mouse-highlight faces are supposed to
> > work with tab-line close buttons, and preferably walk me through the
> > relevant code?
> 
> 'tab-line-close-highlight' was supposed to be applied to the close button
> to emulate how the close button behaves on the tab bar where hovering mouse
> over the button displays it with the face style 'released-button'.
> 
> But mouse-face of the face 'tab-line-highlight' overrides the mouse-face
> 'tab-line-close-highlight' in 'tab-line-tab-name-format-default'
> that applies 'propertize' with 'mouse-face tab-line-highlight'.
> And I can't find a way how to keep the existing 'mouse-face' property on
> the close button while applying 'mouse-face tab-line-highlight' to the
> rest of the tab.

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?





  reply	other threads:[~2021-10-03 11:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8735ptxhzs.fsf.ref@yahoo.com>
2021-09-25  6:54 ` bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-25  7:17   ` Lars Ingebrigtsen
2021-09-25  8:00     ` Eli Zaretskii
2021-09-25  8:19       ` Lars Ingebrigtsen
2021-09-25  8:22         ` Eli Zaretskii
2021-09-25  8:30           ` Lars Ingebrigtsen
2021-09-25 18:53             ` Juri Linkov
2021-09-25 19:44               ` Eli Zaretskii
2021-09-26  5:33                 ` Lars Ingebrigtsen
2021-09-27 15:39                 ` Juri Linkov
2021-09-27 18:40                   ` Eli Zaretskii
2021-09-28 18:46                     ` Juri Linkov
2021-10-02 10:08                       ` Eli Zaretskii
2021-10-02 19:36                         ` Juri Linkov
2021-10-03 11:49                           ` Eli Zaretskii [this message]
2021-10-03 16:51                             ` Juri Linkov
2021-10-03 17:22                               ` Eli Zaretskii
2021-10-03 17:42                                 ` Juri Linkov
2021-10-03 18:00                                   ` Eli Zaretskii
2021-10-04 17:41                                     ` Juri Linkov
2021-10-04 17:52                                       ` Eli Zaretskii
2021-10-06  7:16                                         ` Juri Linkov
2021-10-07 10:13                                           ` Eli Zaretskii
2021-10-07 12:52                                             ` Eli Zaretskii
2021-10-10 17:04                                             ` Juri Linkov
2021-10-10 17:58                                               ` Eli Zaretskii
2021-10-11 18:28                                                 ` Juri Linkov
2021-09-25  8:30           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-25  7:59   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83pmsm8h1o.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=50798@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.