From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43405: Tool bar item doesn't align to the right edge Date: Tue, 15 Sep 2020 21:39:22 +0300 Message-ID: <83a6xq995x.fsf@gnu.org> References: <87mu1xrjqw.fsf@gkayaalp.com> <48ed4897-356c-4669-a330-1fdb5d65402b@default> <83lfhhijbl.fsf@gnu.org> <871rj9uz12.fsf@gkayaalp.com> <875z8k4wv8.fsf@posteo.net> <83pn6shjni.fsf@gnu.org> <20200911074445.GB5194@tuxteam.de> <87zh5uqdqm.fsf@mail.linkov.net> <834ko1da33.fsf@gnu.org> <87sgbloe5z.fsf@mail.linkov.net> <83een5bkja.fsf@gnu.org> <87v9ghlc5c.fsf@mail.linkov.net> <83d02pbhny.fsf@gnu.org> <87een4qi9i.fsf_-_@mail.linkov.net> <837dsw9mpu.fsf@gnu.org> <87r1r3ncwq.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40666"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43405@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 15 20:40:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kIFsA-000ATm-To for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Sep 2020 20:40:10 +0200 Original-Received: from localhost ([::1]:53668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIFs9-0007tJ-Kp for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Sep 2020 14:40:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIFs2-0007sw-9R for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2020 14:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIFs2-0005tR-0W for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2020 14:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kIFs1-0008Mz-SR for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2020 14:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Sep 2020 18:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43405 X-GNU-PR-Package: emacs Original-Received: via spool by 43405-submit@debbugs.gnu.org id=B43405.160019516532124 (code B ref 43405); Tue, 15 Sep 2020 18:40:01 +0000 Original-Received: (at 43405) by debbugs.gnu.org; 15 Sep 2020 18:39:25 +0000 Original-Received: from localhost ([127.0.0.1]:60563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIFrR-0008M4-4F for submit@debbugs.gnu.org; Tue, 15 Sep 2020 14:39:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIFrO-0008Lq-Au for 43405@debbugs.gnu.org; Tue, 15 Sep 2020 14:39:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51319) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIFrI-0005qV-Fg; Tue, 15 Sep 2020 14:39:16 -0400 Original-Received: from [176.228.60.248] (port=4666 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kIFrH-0004kb-Ov; Tue, 15 Sep 2020 14:39:16 -0400 In-Reply-To: <87r1r3ncwq.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 15 Sep 2020 21:14:45 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188147 Archived-At: > From: Juri Linkov > Cc: 43405@debbugs.gnu.org > Date: Tue, 15 Sep 2020 21:14:45 +0300 > > > Btw, are you trying this in a GTK build or with some other toolkit? > > I tried both GTK and no-toolkit, and it can't align the icon to the right > on the tool-bar. > > Whereas the same code nicely alights the icon on the tab-bar: > > (progn > (tab-bar-mode) > (advice-add > 'tab-bar-make-keymap-1 :around > (lambda (orig-fun) > (append (funcall orig-fun) > `((menu-bar > menu-item > ,(concat > (propertize " " 'display '(space :align-to (- right 5))) > (propertize " " 'display > '(image :type xpm > :file "newsticker/narrow.xpm"))) > (lambda () > (interactive) > (popup-menu (mouse-menu-bar-map))))))) > '((name . tab-bar-menu-bar)))) I think you forget how the tool bar is displayed. In the versions of Emacs that produce our native tool bar, the tool bar is displayed by displaying a Lisp string made of spaces, where each space has a display property which specifies the icon to display. Your code puts the :align-to properties on menu item's name, but that name is not used at all for the display of tool bar, so it has no effect. What you need is to put the :align-to property on the respective space of the Lisp string used to display the tool bar. I don't think this can be done in Lisp, we need support on the C level. In the versions of Emacs that use the so-called "external tool bar", like the GTK build, I don't see how :align-to can have any effect at all; we need instead to use GTK facilities to arrange the buttons (assuming that such facilities exist and are available to Emacs).