Does Glyphs 3 modify the internals of NSTokenField?

I am currently fixing the remaining bug for my first plugin Guten Tag. The issue I am currently facing is that Glyphs 3 seems to modify the internals of the NSTokenField class such that the menu chevron sits atop the token text:

↑ The disclosure chevron sits atop the text of the token, partially hiding the g and s, respectively.

I can see no such visual bug in other applications. Glyphs 2 does this instead:

The tokens are quite wide by default but their style can be changed to this:

Much nicer than the overlap in Glyphs 3:

3

Currently I circumvent the issue by adding three spaces to the end of the token string, as shown in the GitHub issue.

That works, but feels hacky. Is Glyphs 3 changing the internals of how some parts of NSTokenField work? I see the compact token style all over Glyphs 3 as compared to version 2. For example, Glyphs 2:

… vs. Glyphs 3:

B

Does this mean that Glyphs 3 is somehow globally removing the spacing left and right and thereby breaking the disclosure chevron?


I do like the compact style (NSTokenStyleSquared) over the Glyphs 2 style (NSTokenStyleRounded), but the disclosure chevron is now broken in Glyphs 3.

Here is the test-plugin that works in both Glyphs 2 and Glyphs 3:
Test.glyphsPalette.zip (176.2 KB)


Glyphs 3.0.3 (3065) & 2.6.7 (1354), macOS 11.2.1 (20D74)

Yes, in Glyphs 3 I mess with the token cell size. TokenFields are notorious bad to customize so I needed to do that in a very intrusive way.
I added some space when there is a menu:
Screenshot

How did you change the style in the example?

I used [tokenField setTokenStyle:NSTokenStyleRounded] to get the wide tokens:

and [tokenField setTokenStyle:NSTokenStyleSquared] for the compact style:

Glyphs 2 would not load the plugin if I used the NSTokenStyleSquared constant, so I set the value directly (line 23 of plugin.py in the test plugin):

self.tokenField.setTokenStyle_(3)

(There is also a delegate method to change the style on a token by token basis, but I don’t need that; a uniform token style is what I am looking for.)

In my testing [tokenField setTokenStyle:NSTokenStyleSquared] should suffice to make tokens more compact while retaining the extra space for the
disclosure chevron, no intrusive code needed. But you would need to call that for each token field and it’s also the only customization, so maybe Glyphs still needs the intrusive code for other customizations.

Thanks for the tip. I didn’t found this. For some reason, this option is not shown in Interfacebuilder. I removed the hack and used that setting.