From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: luangruo@yahoo.com, 50424@debbugs.gnu.org, alan@idiocy.org
Subject: bug#50424: 27.2; Tab bar button mouse face not clearing entirely
Date: Sun, 12 Sep 2021 10:06:09 +0300 [thread overview]
Message-ID: <87zgsii8cy.fsf@mail.linkov.net> (raw)
In-Reply-To: <83zgsifob4.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Sep 2021 06:46:55 +0300")
[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]
>> >> With enlarged height and width, now the buttons are not vertically
>> >> aligned:
>> >
>> > Is this a screenshot of a tab bar or of a tab line?
>>
>> Tab bar. And the change was caused by your commit db74a93659.
>
> Then I don't understand the two horizontally-adjacent images. What
> are they? two separate frame? If they are two frames, then where are
> the frame decorations? In short, I don't understand what am I seeing
> there, and how did you get this display.
These are two separate images that show the changed tab dimensions
before changes when :margin was (2 . 0), and after changes
when now :margin is 4.
> And also, when you say "buttons are not vertically aligned", what
> exactly do you mean? Not aligned with what?
Now buttons are not aligned to the baseline, and thus are
not centered vertically anymore.
>> db74a93659 that contains such changes:
>>
>> - :margin (2 . 0)
>> + :margin ,tab-bar-button-margin
>
> This is to make the code do what the variable's documentation says.
> Without that change, the images were sized using :margin '(2 . 0)',
> but the C code used the value of tab-bar-button-margin, a simple
> scalar, to place the image and clear its background. The way to
> affect the image dimensions is by changing the value of
> tab-bar-button-margin, not by hard-coding the margin in the image
> properties.
This patch restores the original tab dimensions, while also keeps fixed
the reported problem of mouse face not clearing entirely:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tab-bar-button-margin.patch --]
[-- Type: text/x-diff, Size: 2688 bytes --]
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 8be08d4b8b..edbadec09d 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -161,7 +161,7 @@ tab-bar--load-buttons
(add-text-properties 0 (length tab-bar-new-button)
`(display (image :type xpm
:file "tabs/new.xpm"
- :margin ,tab-bar-button-margin
+ :margin ,(cons tab-bar-button-margin 0)
:ascent center))
tab-bar-new-button))
@@ -171,7 +171,7 @@ tab-bar--load-buttons
(add-text-properties 0 (length tab-bar-close-button)
`(display (image :type xpm
:file "tabs/close.xpm"
- :margin ,tab-bar-button-margin
+ :margin ,(cons tab-bar-button-margin 0)
:ascent center))
tab-bar-close-button)))
@@ -1659,7 +1659,7 @@ tab-bar-history-mode
(add-text-properties 0 (length tab-bar-back-button)
`(display (image :type xpm
:file "tabs/left-arrow.xpm"
- :margin ,tab-bar-button-margin
+ :margin ,(cons tab-bar-button-margin 0)
:ascent center))
tab-bar-back-button))
(when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-forward-button)))
@@ -1667,7 +1667,7 @@ tab-bar-history-mode
(add-text-properties 0 (length tab-bar-forward-button)
`(display (image :type xpm
:file "tabs/right-arrow.xpm"
- :margin ,tab-bar-button-margin
+ :margin ,(cons tab-bar-button-margin 0)
:ascent center))
tab-bar-forward-button))
diff --git a/src/dispextern.h b/src/dispextern.h
index f4c7575b35..0ede76ebf5 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3202,7 +3202,7 @@ #define IMAGE_CACHE_BUCKETS_SIZE 1001
/* Default values of the above variables. */
-#define DEFAULT_TAB_BAR_BUTTON_MARGIN 4
+#define DEFAULT_TAB_BAR_BUTTON_MARGIN 2
#define DEFAULT_TAB_BAR_BUTTON_RELIEF 1
/* The height in pixels of the default tab-bar images. */
next prev parent reply other threads:[~2021-09-12 7:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87eea2cebb.fsf.ref@yahoo.com>
2021-09-06 8:12 ` bug#50424: 27.2; Tab bar button mouse face not clearing entirely Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-06 10:50 ` Eli Zaretskii
2021-09-06 11:31 ` Stephen Berman
2021-09-06 11:46 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-06 12:00 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-06 12:30 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-06 17:39 ` Eli Zaretskii
2021-09-07 0:30 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-07 10:41 ` Eli Zaretskii
2021-09-07 13:02 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-07 13:12 ` Eli Zaretskii
2021-09-07 23:13 ` Alan Third
2021-09-08 6:05 ` Eli Zaretskii
2021-09-08 16:57 ` Alan Third
2021-09-11 12:11 ` Eli Zaretskii
2021-09-11 18:49 ` Juri Linkov
2021-09-11 19:41 ` Eli Zaretskii
2021-09-11 19:45 ` Juri Linkov
2021-09-12 3:46 ` Eli Zaretskii
2021-09-12 6:05 ` Eli Zaretskii
2021-09-12 7:06 ` Juri Linkov [this message]
2021-09-12 8:35 ` Eli Zaretskii
2021-09-12 16:06 ` Juri Linkov
2021-09-12 16:25 ` Eli Zaretskii
2021-09-13 7:59 ` Juri Linkov
2021-09-13 11:59 ` Eli Zaretskii
2021-09-11 19:43 ` Juri Linkov
2021-09-12 3:50 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zgsii8cy.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=50424@debbugs.gnu.org \
--cc=alan@idiocy.org \
--cc=eliz@gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).