Repository navigation
Discoveries Settings
Part of Discoveries.
A symbol name that's new in macOS 27, such as circle.on.app.liquid.glass.fill, gives nil on macOS 26, and +[NSImageView imageViewWithImage:nil] throws, which took down the whole Settings pane. Give each icon older fallbacks and use the first that exists.
/System/Library/CoreServices/CoreGlyphs.bundle/Contents/Resources/name_availability.plist lists the year each symbol arrived, and its year_to_release maps each year to a macOS version (2025 is macOS 26, 2026 is macOS 27), so you can check a name without an older Mac.
macOS 26's hints, the glass bubbles with an arrow that System Settings shows, are an NSPopover with a label in it. A few things it needs:
- Give the content view its
fittingSizeas its frame, and the view controller itspreferredContentSize, before showing it. Otherwise a wrapping label lays out at zero width and the popover opens as a tall sliver. -
NSPopoverBehaviorTransientcloses it on any click, and the click still reaches what it was aimed at, such as a Settings row. - An
NSTrackingAreadoesn't retain its owner. Keep the owner alive with the view, and remove the area before letting the owner go.
DPSetHint in StdPatch does all of this.
The Patches pane makes the Settings window resizable so it can grow taller, and that turns on the green button, which then zooms or goes full screen. Disable NSWindowZoomButton and set NSWindowCollectionBehaviorFullScreenNone while the pane shows, and put both back when it goes.
Unhiding a row in an NSStackView while an animation is running makes it ride down from the top of its group over the row above, and hiding one inside an animation fades it out while it moves, which leaves a ghost behind. Hide or unhide inside an NSAnimationContext group with a duration of 0 and allowsImplicitAnimation off, so only the rows around it slide. A row that appears starts at alpha 0 and fades in once the gap has opened, about 0.2 seconds later. Take its separator with it, the view before it in arrangedSubviews.
Settings' shortcut field, like the one on Dia's Shortcuts page, records with a local NSEvent monitor for key-down events while it's recording, and returns nil from it so the keys don't reach Dia. It saves the key code, the modifier flags masked to ⌘⌃⌥⇧, and the characters for showing it. Ask for ⌘, ⌃ or ⌥ unless it's a function key, or plain letters get taken from text fields. Delete clears it and Escape cancels. DPShortcutField and DPShortcutMatches in StdPatch do this.
Settings sorts its sections by the order of each section's first tweak, and lists Hide tweaks last in each, shortest title first. An option, a tweak with requires, shows on its parent's page instead, under a heading named by its own section, or Options if it has none. A parent's own rows go under the heading their view's identifier names. Options this Dia can't use go in Not Available in This Version, last.
- Page
- Toolbar
- Sidebar & Tab Bar
- Tabs
- Command Bar
- New Tab Page
- Window
- Passwords
- Links
- Making tweaks