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

[AppKit] Implement NSToolbarItemVisibilityPriority. Fixes #21298. #21304

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20503,8 +20503,23 @@ interface NSToolbarItem : NSCopying, NSMenuItemValidation, NSValidatedUserInterf
[Export ("maxSize")]
CGSize MaxSize { get; set; }

#if XAMCORE_5_0
[Export ("visibilityPriority")]
NSToolbarItemVisibilityPriority VisibilityPriority { get; set; }
#else
/// <summary>Indicate which toolbar items should be kept when the toolbar space is limited.</summary>
/// <remarks>
/// <para>The valid values come from the <see cref="NSToolbarItemVisibilityPriority" /> enum, and they can be referenced as follows:</para>
/// <example>
/// <code lang="csharp lang-csharp"><![CDATA[
/// NSToolbarItem item = GetItem ();
/// item.VisibilityPriority = (nint) (long) NSToolbarItemVisibilityPriority.High;
/// ]]></code>
/// </example>
/// <remarks>
[Export ("visibilityPriority")]
nint VisibilityPriority { get; set; }
#endif

[Export ("autovalidates")]
bool Autovalidates { get; set; }
Expand Down Expand Up @@ -28838,4 +28853,12 @@ interface NSViewContentSelectionInfo {
[Export ("selectionAnchorRect")]
CGRect /* NSRect */ SelectionAnchorRect { get; }
}

[Native]
enum NSToolbarItemVisibilityPriority : long {
Standard = 0,
Low = -1000,
High = 1000,
User = 2000,
}
}
5 changes: 5 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2869,6 +2869,10 @@ F:AppKit.NSToolbarItemGroupControlRepresentation.Expanded
F:AppKit.NSToolbarItemGroupSelectionMode.Momentary
F:AppKit.NSToolbarItemGroupSelectionMode.SelectAny
F:AppKit.NSToolbarItemGroupSelectionMode.SelectOne
F:AppKit.NSToolbarItemVisibilityPriority.High
F:AppKit.NSToolbarItemVisibilityPriority.Low
F:AppKit.NSToolbarItemVisibilityPriority.Standard
F:AppKit.NSToolbarItemVisibilityPriority.User
F:AppKit.NSToolbarSizeMode.Default
F:AppKit.NSToolbarSizeMode.Regular
F:AppKit.NSToolbarSizeMode.Small
Expand Down Expand Up @@ -80962,6 +80966,7 @@ T:AppKit.NSToolbarImmovableItemIdentifiers
T:AppKit.NSToolbarItemEventArgs
T:AppKit.NSToolbarItemGroupControlRepresentation
T:AppKit.NSToolbarItemGroupSelectionMode
T:AppKit.NSToolbarItemVisibilityPriority
T:AppKit.NSToolbarSizeMode
T:AppKit.NSToolbarWillInsert
T:AppKit.NSTouch_NSTouchBar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
!missing-field! NSTypeIdentifierTransitInformationText not bound
!missing-protocol! NSAnimatablePropertyContainer not bound
!missing-selector! NSTouchBar::itemIdentifiers not bound

# NSToolbarItemVisibilityPriority is a collection of constants we've bound as an enum.
!unknown-native-enum! NSToolbarItemVisibilityPriority bound
Loading