unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 43405@debbugs.gnu.org
Subject: bug#43405: Tool bar item doesn't align to the right edge
Date: Tue, 15 Sep 2020 21:39:22 +0300	[thread overview]
Message-ID: <83a6xq995x.fsf@gnu.org> (raw)
In-Reply-To: <87r1r3ncwq.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 15 Sep 2020 21:14:45 +0300)

> From: Juri Linkov <juri@linkov.net>
> 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).





  reply	other threads:[~2020-09-15 18:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwvd02uygtp.fsf-monnier+emacs@gnu.org>
     [not found] ` <87mu1xrjqw.fsf@gkayaalp.com>
     [not found]   ` <48ed4897-356c-4669-a330-1fdb5d65402b@default>
     [not found]     ` <CAP_d_8VYOrFJ6=3boUDvdxTQkEm=ZdUtE+nm2M+kuZdoCBg48g@mail.gmail.com>
     [not found]       ` <83lfhhijbl.fsf@gnu.org>
     [not found]         ` <871rj9uz12.fsf@gkayaalp.com>
     [not found]           ` <alpine.NEB.2.22.394.2009102307230453.22593@sdf.lonestar.org>
     [not found]             ` <E1kGaUK-0004lt-IG@fencepost.gnu.org>
     [not found]               ` <875z8k4wv8.fsf@posteo.net>
     [not found]                 ` <83pn6shjni.fsf@gnu.org>
     [not found]                   ` <20200911074445.GB5194@tuxteam.de>
     [not found]                     ` <87zh5uqdqm.fsf@mail.linkov.net>
     [not found]                       ` <834ko1da33.fsf@gnu.org>
     [not found]                         ` <87sgbloe5z.fsf@mail.linkov.net>
     [not found]                           ` <83een5bkja.fsf@gnu.org>
     [not found]                             ` <87v9ghlc5c.fsf@mail.linkov.net>
     [not found]                               ` <83d02pbhny.fsf@gnu.org>
2020-09-14 19:18                                 ` bug#43405: Tool bar item doesn't align to the right edge Juri Linkov
2020-09-14 19:34                                   ` Eli Zaretskii
2020-09-15 18:14                                     ` Juri Linkov
2020-09-15 18:39                                       ` Eli Zaretskii [this message]
2020-09-16 19:29                                         ` Juri Linkov
2020-09-17  9:03                                         ` Robert Pluim
2020-09-17 13:45                                           ` Eli Zaretskii
2020-09-17 14:43                                             ` Robert Pluim
2020-09-17 14:54                                               ` Eli Zaretskii
2020-09-17 15:24                                                 ` Robert Pluim
2020-09-17 15:33                                                   ` Eli Zaretskii
2020-09-18  8:38                                                     ` Robert Pluim
2020-09-18  8:58                                                       ` Eli Zaretskii
2020-09-21 18:30                                                         ` Robert Pluim
2020-09-21 19:04                                                           ` Eli Zaretskii
2020-09-21 20:07                                                             ` Robert Pluim
2020-09-22 14:39                                                               ` Eli Zaretskii
2020-09-22 15:14                                                                 ` Robert Pluim
2020-09-22 15:26                                                                   ` Eli Zaretskii
2020-09-14 19:53                                   ` spvk

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=83a6xq995x.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=43405@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /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).