From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix placement of toggle and radio button in Lucid menu. Date: Fri, 25 Feb 2022 19:50:44 +0800 Message-ID: <87zgmf5fmz.fsf@yahoo.com> References: <87sfs87i5o.fsf@elite.giraud> <87pmnc7f5c.fsf@yahoo.com> <87k0dk7ejd.fsf@yahoo.com> <878rtzb3hr.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4365"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: emacs-devel To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 25 12:53:43 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNZAN-0000zh-74 for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Feb 2022 12:53:43 +0100 Original-Received: from localhost ([::1]:34410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNZAL-0007Yp-SJ for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Feb 2022 06:53:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNZ7j-0004iZ-1u for emacs-devel@gnu.org; Fri, 25 Feb 2022 06:51:03 -0500 Original-Received: from sonic312-23.consmr.mail.ne1.yahoo.com ([66.163.191.204]:41574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNZ7h-0003Ct-3c for emacs-devel@gnu.org; Fri, 25 Feb 2022 06:50:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1645789854; bh=CzLN+RzqdsJLFeQyurUXch2A8nDCim3wOVL7KnSEmQw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=MURVDqY09ZGYzxXjoWjpQ9oou/gBvb0FTxb1+ZMw3dJ2RigRFOSS7bnrBCWX60RG6U/XoQdamCBq//21X6MYwpQDqHsPJRRG4o/guoYwvWS6iVJwZwZhRMWfs04qcTn/ZKXiYgEZ8mj6YwbRdawHDLMOl2USPRrDTvhcx2iyg8VFyswMei5O9ZR41/TJTPj6sGBQte4r5LIAKBhaz5ZwjQUtGAVTakg77NWSJkQWX8fH6uUdAiiU6xHkbwxcJjcBagqEruScUSmXUmM8TQIgZHbSYU0BVw3IdOXFsFr/OSnAcT2x82OQP+ETQCM7xm3xN+Eitz9k4Qqx07bBpuR7uQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1645789854; bh=z4SO0p2s3EKY4V3zSwuTZJkWg6dAhCIpvgD2BpFLicd=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Js5MiCv+OaCKHr6YVR5oujecjNWcBxmwTPtBjSozNJGL6kVbFIcybAWHlXmPD1WreuzWqedCxAuD5HzE30i+Ytj3LOKN89rkaPMpoqnNH9DaOCzp4LNLmeQOiO1ukDpLKSQ4eV+7qQzOKeSzseSQHKw9DUd1s7ytC6jTWsLfGubNhS+vyYYGrve8RmFnsqnXpFR/vdx/w7KzyttTJOkZvC78tEscGZT/HCaIWmTKThHPKyVNs3XqVKfrrVcK7Qau/AAyj47q5GMLKUU9TQRJG/yH3jmPHId8SuTTsTfBrHdWkCaeb1WXZRjxqNhEX+RRgR74Nt8QI6s9tkgoECG3cA== X-YMail-OSG: AIfkw2YVM1kUAnHYlu78utankcDNtO2NQ0pMXz3CiIFSugex2VInkWO77n5ARyk eUXo8aEeSWzgSUbF1kUqeUdaJNtJHJ6w8cxBIlgAKUSrFt9dyMJZRfY4aUAw8mi4c.ECEQ6pRwlq Cahlb8O.JZ6Vi32wxna0m2cjcNAhDRXASHCMrRkNAV4ah6ymj1VfSeQuhwE7jwHZ5ztqqBCop_rv 53ZUioaZWClknU7hX66mZyftLj7wPfqHgaLvopuBFFUsPfR1Av8R7364n39LjkWB5Mgbg8.dXJ3r jN7Gyx7UyPbX5YxuEJz3US.kw_dQ4CvH1Uda7mPYSvMIDufO3oa2uqJAaLY6tRqtAltHvCwh1l4O SlheNoQokUEXrjJD26yfoihYhQrF2YuFkW7RHKyXOQ2U7hfSZOAzMnBbZJIB4I6S8xx4vM.L9Ex1 7yXby5X5jyR9Ucb8Rtm5IwSsBS4EsKBeG0JIVzACs7nCwdwtd.5QEhjhnZRlE_gVbjQpX5tONmiM OE07Rh_QrzeeSRxPOP9ZqDsLxuXWz4UtccJzeFDhxWDEQz_cDEDHq2H_EhxHyRl7Ptc5PDzniur9 Kj0qeUSIZiGtEdV.GXTh5XLzpnip9EkwsXLzSECYyRbOZyAiPHS4M4QjlAjyuDH.1paypebA6ZXd truvdLjK0CY9ggbisEzJIBain4.w7CGqglQA6Fu1UvpommJVto4CwW8NWiv551nTyE2x_.OvWLdQ v6c9uITAbszqFqCwDj_I_IZdASK5QN5f7pqBhLj5OPccY7scV47gKBQorIv8XGVA.00zX3CNL9D. nGAeHSmZgP3G3yvmXvoSaPJ9fepw4GNpECqxVUMWYJ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Fri, 25 Feb 2022 11:50:54 +0000 Original-Received: by kubenode502.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 2bb95a76a7b1fd4e142e8f670cf26917; Fri, 25 Feb 2022 11:50:51 +0000 (UTC) In-Reply-To: <878rtzb3hr.fsf@elite.giraud> (Manuel Giraud's message of "Fri, 25 Feb 2022 12:16:32 +0100") X-Mailer: WebService/1.1.19797 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.204; envelope-from=luangruo@yahoo.com; helo=sonic312-23.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286678 Archived-At: Manuel Giraud 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.