[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix placement of toggle and radio button in Lucid menu.
From: |
Po Lu |
Subject: |
Re: [PATCH] Fix placement of toggle and radio button in Lucid menu. |
Date: |
Fri, 25 Feb 2022 19:50:44 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) |
Manuel Giraud <manuel@ledu-giraud.fr> writes:
> 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
This isn't right at all, since now the button will not be centered
between the origin and the baseline, and will instead be drawn directly
above the baseline. It doesn't show up with your font, but that will
lose with a larger font.
- [PATCH] Fix placement of toggle and radio button in Lucid menu., Manuel Giraud, 2022/02/24
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Po Lu, 2022/02/24
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Po Lu, 2022/02/24
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Eli Zaretskii, 2022/02/25
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Manuel Giraud, 2022/02/25
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Eli Zaretskii, 2022/02/25
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Po Lu, 2022/02/25
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Eli Zaretskii, 2022/02/25
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Po Lu, 2022/02/25
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Eli Zaretskii, 2022/02/26
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Po Lu, 2022/02/26
- Re: [PATCH] Fix placement of toggle and radio button in Lucid menu., Eli Zaretskii, 2022/02/26