Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for binding NSToolbarItemVisibilityPriority #21298

Closed
tipa opened this issue Sep 25, 2024 · 2 comments · Fixed by #21304
Closed

Request for binding NSToolbarItemVisibilityPriority #21298

tipa opened this issue Sep 25, 2024 · 2 comments · Fixed by #21304
Labels
binding-projects Issue or PR that affects binding projects missing-api-bindings
Milestone

Comments

@tipa
Copy link

tipa commented Sep 25, 2024

Apple platform

macOS

Framework version

net8.0-*

Affected platform version

.NET 8

Description

It looks like NSToolbarItemVisibilityPriority is not bound. It would be nice if it was, similar to NSStackViewVisibilityPriority.

This is used to assign visibilityPriority

Steps to Reproduce

var toolbarItem = new NSMenuToolbarItem("id");
toolbarItem.VisibilityPriority = NSToolbarItemVisibilityPriority.Low;

Did you find any workaround?

I can still assign an integer, but using an enum or constant would be more explanatory.

Build logs

No response

@tipa tipa added the binding-projects Issue or PR that affects binding projects label Sep 25, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Sep 25, 2024
@rolfbjarne
Copy link
Member

Unfortunately we can't change the property type of the "VisibilityProperty" in order to keep binary compatibility (unless we introduce a different property, but that's somewhat clunky).

However, I can add some documentation to the property, so hopefully that alleviates the problem.

@tipa
Copy link
Author

tipa commented Sep 25, 2024

No, the property type is fine (just like NSStackView.VisibilityPriority also is of type float), but maybe the constants could be specified somewhere, like this:

public enum NSToolbarItemVisibilityPriority : int
{
    Standard = 0,
    Low = -1000,
    High = 1000,
    User = 2000,
}

Similar to:

public enum NSStackViewVisibilityPriority : int {
MustHold = 1000,
#if !NET
[Obsolete ("Use 'MustHold' instead.")]
Musthold = MustHold,
#endif
DetachOnlyIfNecessary = 900,
NotVisible = 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding-projects Issue or PR that affects binding projects missing-api-bindings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants