Closed ttscoff closed 5 years ago
Hi Brett, does heightAnchor
help?
Hi. I'm working with Brett on this project. I'll take a look at heightAnchor, but is it correct that the MASShortcutView doesn't have an intrinsic size that provides a minimum height? Putting the MASShortcutView inside of an NSStackView with other items (e.g. NSTextField, NSButton, etc.) results in a view that shows everything else, but the MASShortcutView ends up with a height of 0, making it invisible. Forcing the NSStackView to be taller (by adding a second column with more content) makes the MASShortcutView visible, assuming there is enough room. Attempting to set the frameSize directly did not work.
Thanks!!
Hey Fletcher, that’s right. Auto Layout was introduced later than MASShortcut
was born. Maybe frameSize
works if you disable translating autoresizing masks into constraints?
So is there any reason not to provide an intrinsicContentSize
to make MASShortcutView
more compatible with auto layout?
The intrinsic content size is depending on the control style which may influent the cell appearance. If handled properly, it can definitely be implemented. Pull Request is welcome 👌
Done.
Merged in #125, thank you!
I'm attempting to instantiate a MASShortcutView programmatically and insert into an autolayout stack. The button always shows up with the view slightly short so the top and bottom lines of the button are cut off. Any chance of a fix for the intrinsic size of the view?