SubmarinerApp / Submariner

A Subsonic client for macOS
https://submarinerapp.com
BSD 3-Clause "New" or "Revised" License
123 stars 3 forks source link

Sonoma API improvements #135

Open NattyNarwhal opened 1 year ago

NattyNarwhal commented 1 year ago

Refs:

NattyNarwhal commented 7 months ago

I think the way to handle the inspector separation with traditional nibs is making an item in the palette for NSToolbarInspectorTrackingSeparatorItemIdentifier, like we have for NSToolbarSidebarTrackingSeparatorItemIdentifier

NattyNarwhal commented 7 months ago

I'm going to have to be adjust the main window nib too, default toolbar button metrics changed to be a bit longer...

NattyNarwhal commented 7 months ago

I think the toolbar button metrics change if you customize the toolbar.

The font size on the time fields also looks wrong.

NattyNarwhal commented 7 months ago
diff --git a/Submariner/SBDatabaseController.m b/Submariner/SBDatabaseController.m
index c78b8bb..1d1b434 100644
--- a/Submariner/SBDatabaseController.m
+++ b/Submariner/SBDatabaseController.m
@@ -531,7 +531,11 @@ - (IBAction)toggleVolume:(id)sender {
     if (volumePopover.shown) {
         [volumePopover close];
     } else {
-        [volumePopover showRelativeToRect: boundary ofView: view preferredEdge:NSMaxYEdge];
+        if (@available(macOS 14, *)) {
+            [volumePopover showRelativeToToolbarItem: volumeToolbarItem];
+        } else {
+            [volumePopover showRelativeToRect: boundary ofView: view preferredEdge:NSMaxYEdge];
+        }
     }
 }

This works, but you can't set the edge it comes from, which means it's a bit awkward as it'll appear above the toolbar item.