Skip to content

Commit

Permalink
[AppKit] Implement NSToolbarItemVisibilityPriority. Fixes #21298. (#2…
Browse files Browse the repository at this point in the history
…1304)

Fixes #21298.
  • Loading branch information
rolfbjarne authored Sep 30, 2024
1 parent 5470132 commit f657ca9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
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

10 comments on commit f657ca9

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ API diff for current PR / commit

.NET (No breaking changes)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: vsdrops gist (No breaking changes)
  • macOS: vsdrops gist (No breaking changes)

✅ API diff vs stable

.NET (No breaking changes)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests on macOS M1 - Mac Big Sur (11) failed ❌

Tests timed out

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Windows Integration Tests failed ❌

❌ Failed ❌

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 97 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 40 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

1 tests crashed, 0 tests failed, 96 tests passed.

Failures

❌ dotnettests tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - dotnettests_tvos (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 40 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: f657ca9fcad91727d3cefb812c036a9bf39813be [CI build]

Please sign in to comment.