all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: emacs-devel@gnu.org
Subject: NS port menus (was: bug#44333: 27.1; macOS menu bar 2-clicks)
Date: Sun, 27 Dec 2020 18:21:44 +0000	[thread overview]
Message-ID: <X+jQuKKUhR40W6tu@breton.holly.idiocy.org> (raw)
In-Reply-To: <A4CDFBE9-02AA-401F-8A14-120E7B9EB41D@acm.org>

I've moved this to Emacs Devel because that bug report is closed now
and it didn't seem like the right place to discuss it.

On Sun, Dec 27, 2020 at 06:14:25PM +0100, Mattias Engdegård wrote:
> 26 dec. 2020 kl. 22.52 skrev Alan Third <alan@idiocy.org>:
> 
> > It's actually almost possible to copy the Mac port code in verbatim,
> > the NS port's code is based on it after all, but I feel it may be
> > neater to use a custom view for the NSMenuItems. That would give us
> > complete control over the layout.
> 
> We should, but because I was lazy and impatient, I wrote the
> attached (terrible) hack just to see what right-justification would
> look like.
> 
> The right margin is slightly ragged because I'm using plain spaces
> to offset the key binding from the menu text, but I still think it's
> better than what we have now. I tried using U+2009 THIN SPACE and
> even U+200A HAIR SPACE instead but somehow the result became worse;
> no doubt a silly mistake somewhere.

It looks pretty good as is! Slightly off, though, as you say.

I'd wondered about using NSAttributedString and NSParagraphStyle to
set a tab stop at a specific pixel point, that should allow perfect
alignment, or, and this is a bit hackier, display the binding in a
monospace font. Then you could use (variable space font) spaces and
tabs to line up the start of the binding text, then use (monospace
font) spaces to align the bindings. That's maybe a bit too much work,
though, and I'm not at all knowledgeable about how NSAttributedStrings
actually work, so maybe it's impossible.

> I also removed the special hack for s- bindings because it broke the
> nice alignment. If we want, we could translate modifiers into the
> standard symbols (⌘, ⌃, ⇧ and ⌥) depending on these are assigned, or
> just keep using the Emacs notation. We could also translate <right>
> into → and so on.

I think whatever we do it's probably best to be consistent, so losing
the special hack for s- bindings sounds good.

-- 
Alan Third



  reply	other threads:[~2020-12-27 18:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 17:53 bug#44333: 27.1; macOS menu bar 2-clicks Viktor Kharitonovich
2020-10-30 22:42 ` Alan Third
2020-10-31 14:08 ` Mattias Engdegård
2020-10-31 15:01   ` Alan Third
2020-11-01 10:50     ` Mattias Engdegård
2020-11-01 17:28       ` Alan Third
2020-12-23 20:33         ` Alan Third
2020-12-25 16:06           ` Mattias Engdegård
2020-12-25 17:26             ` Alan Third
2020-12-25 19:20               ` Alan Third
2020-12-25 22:28                 ` Mattias Engdegård
2020-12-26 17:07                   ` Alan Third
2020-12-26 17:42                     ` Mattias Engdegård
2020-12-26 21:52                       ` Alan Third
2020-12-27 16:56                         ` Alan Third
2020-12-27 17:14                         ` Mattias Engdegård
2020-12-27 18:21                           ` Alan Third [this message]
2020-12-28 17:38                             ` NS port menus (was: bug#44333: 27.1; macOS menu bar 2-clicks) Mattias Engdegård

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=X+jQuKKUhR40W6tu@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    /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.