unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* NS port menus (was: bug#44333: 27.1; macOS menu bar 2-clicks)
       [not found]                 ` <A4CDFBE9-02AA-401F-8A14-120E7B9EB41D@acm.org>
@ 2020-12-27 18:21                   ` Alan Third
  2020-12-28 17:38                     ` Mattias Engdegård
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Third @ 2020-12-27 18:21 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: emacs-devel

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: NS port menus (was: bug#44333: 27.1; macOS menu bar 2-clicks)
  2020-12-27 18:21                   ` NS port menus (was: bug#44333: 27.1; macOS menu bar 2-clicks) Alan Third
@ 2020-12-28 17:38                     ` Mattias Engdegård
  0 siblings, 0 replies; 2+ messages in thread
From: Mattias Engdegård @ 2020-12-28 17:38 UTC (permalink / raw)
  To: Alan Third; +Cc: emacs-devel

27 dec. 2020 kl. 19.21 skrev Alan Third <alan@idiocy.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.

Agreed; this is now bug#45502.

> 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.

It didn't look obvious how to do it, but I could use some help.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-28 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201101172843.GQ59267@breton.holly.idiocy.org>
     [not found] ` <X+OptV8iYiz+KFc3@breton.holly.idiocy.org>
     [not found]   ` <40B4784A-74FF-4021-B51C-2E80801483BE@acm.org>
     [not found]     ` <X+Yg2S1k6HVBx2o2@breton.holly.idiocy.org>
     [not found]       ` <X+Y7d2co3tjJmog2@breton.holly.idiocy.org>
     [not found]         ` <A100BF7C-C688-4C4B-873B-6F6B9B5DC633@acm.org>
     [not found]           ` <X+dt7qND/U5z5Zt0@breton.holly.idiocy.org>
     [not found]             ` <44D6C180-9C74-4B2D-BCB8-683FC4A84091@acm.org>
     [not found]               ` <X+ewiv9xczTPCKDh@breton.holly.idiocy.org>
     [not found]                 ` <A4CDFBE9-02AA-401F-8A14-120E7B9EB41D@acm.org>
2020-12-27 18:21                   ` NS port menus (was: bug#44333: 27.1; macOS menu bar 2-clicks) Alan Third
2020-12-28 17:38                     ` Mattias Engdegård

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).