all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Manuel Giraud <manuel@ledu-giraud.fr>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] Fix placement of toggle and radio button in Lucid menu.
Date: Fri, 25 Feb 2022 12:16:32 +0100	[thread overview]
Message-ID: <878rtzb3hr.fsf@elite.giraud> (raw)
In-Reply-To: <87k0dk7ejd.fsf@yahoo.com> (Po Lu's message of "Thu, 24 Feb 2022 18:19:18 +0800")

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

Hi,

Ok so here is a new patch that I think fixes this issue. The first line
of the patch sets the toggle to size to be 2/3 of the ascent (and not
height) of the font: it seems more logical if those buttons resides on
the baseline.

As you can see in the following zoomed screenshots, the base of the
pseudo-3d box is now on the same line of the bottom horizontal bar of a
'i' for instance.

Best regards,

Before patch:

[-- Attachment #2: orig-small-bitmap.png --]
[-- Type: image/png, Size: 2050 bytes --]

[-- Attachment #3: orig-small-vector.png --]
[-- Type: image/png, Size: 9359 bytes --]

[-- Attachment #4: orig-big-bitmap.png --]
[-- Type: image/png, Size: 2448 bytes --]

[-- Attachment #5: orig-big-vector.png --]
[-- Type: image/png, Size: 10295 bytes --]

[-- Attachment #6: Type: text/plain, Size: 13 bytes --]


With patch:

[-- Attachment #7: patch-small-bitmap.png --]
[-- Type: image/png, Size: 2000 bytes --]

[-- Attachment #8: patch-small-vector.png --]
[-- Type: image/png, Size: 9427 bytes --]

[-- Attachment #9: patch-big-bitmap.png --]
[-- Type: image/png, Size: 2519 bytes --]

[-- Attachment #10: patch-big-vector.png --]
[-- Type: image/png, Size: 13519 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #11: 0001-fix-toggle-radio-button-on-lucid.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]

From 1c56fbc1e294e1ed273d8f0f6a5b71b26047d004 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
Date: Fri, 25 Feb 2022 12:04:37 +0100
Subject: [PATCH] fix toggle/radio button on lucid.

---
 lwlib/xlwmenu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index ace5141cdb..f49fc3697a 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -393,7 +393,7 @@ arrow_width (XlwMenuWidget mw)
 static int
 toggle_button_width (XlwMenuWidget mw)
 {
-  return (MENU_FONT_HEIGHT (mw) * 2 / 3) | 1;
+  return (MENU_FONT_ASCENT (mw) * 2 / 3) | 1;
 }
 
 
@@ -793,7 +793,7 @@ draw_toggle (XlwMenuWidget mw, Window window, int x, int y, int selected_p)
   width = toggle_button_width (mw);
   height = width;
   x += mw->menu.horizontal_spacing;
-  y += (MENU_FONT_ASCENT (mw) - height) / 2;
+  y += (MENU_FONT_ASCENT (mw) - height);
   draw_shadow_rectangle (mw, window, x, y, width, height, False, selected_p);
 }
 
@@ -810,7 +810,7 @@ draw_radio (XlwMenuWidget mw, Window window, int x, int y, int selected_p)
   width = radio_button_width (mw);
   height = width;
   x += mw->menu.horizontal_spacing;
-  y += (MENU_FONT_ASCENT (mw) - height) / 2;
+  y += (MENU_FONT_ASCENT (mw) - height);
   draw_shadow_rhombus (mw, window, x, y, width, height, False, selected_p);
 }
 
-- 
2.35.1


[-- Attachment #12: Type: text/plain, Size: 18 bytes --]

-- 
Manuel Giraud

  parent reply	other threads:[~2022-02-25 11:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24  9:01 [PATCH] Fix placement of toggle and radio button in Lucid menu Manuel Giraud
2022-02-24 10:06 ` Po Lu
2022-02-24 10:19   ` Po Lu
2022-02-24 10:36     ` Eli Zaretskii
2022-02-24 14:09     ` Manuel Giraud
2022-02-25 11:16     ` Manuel Giraud [this message]
2022-02-25 11:50       ` Po Lu
2022-02-26 17:38         ` Manuel Giraud
2022-02-25 12:18       ` Eli Zaretskii
2022-02-25 12:52         ` Manuel Giraud
2022-02-25 13:05           ` Eli Zaretskii
2022-02-25 13:46             ` Po Lu
2022-02-25 14:10               ` Eli Zaretskii
2022-02-26  0:20                 ` Po Lu
2022-02-26  6:24                   ` Eli Zaretskii
2022-02-26  7:33                     ` Po Lu
2022-02-26  7:51                       ` Eli Zaretskii
2022-02-26  8:35                         ` Po Lu
2022-02-26  8:53                           ` Eli Zaretskii
2022-02-25 14:46             ` Manuel Giraud
2022-02-25 14:57               ` Eli Zaretskii
2022-02-25 15:38                 ` Manuel Giraud
2022-02-25 16:35                   ` Eli Zaretskii
2022-02-26  0:21                     ` Po Lu
2022-02-26  6:26                       ` Eli Zaretskii
2022-02-26  7:35                         ` Po Lu
2022-02-28  8:45                           ` Manuel Giraud
2022-02-28 13:21                             ` Eli Zaretskii
2022-02-28 21:19                               ` Manuel Giraud
2022-03-01  3:33                                 ` Eli Zaretskii
2022-03-02 12:06                                   ` Manuel Giraud
2022-02-28 18:35                             ` chad
2022-03-02 12:10                               ` Manuel Giraud

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=878rtzb3hr.fsf@elite.giraud \
    --to=manuel@ledu-giraud.fr \
    --cc=emacs-devel@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 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.