Skip to content

Commit

Permalink
Migrate to SFSymbols.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Oct 8, 2023
1 parent 3ccbd04 commit 11a4793
Show file tree
Hide file tree
Showing 34 changed files with 239 additions and 129 deletions.
78 changes: 78 additions & 0 deletions Boxer.xcodeproj/xcshareddata/xcschemes/Boxer Bundler.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FB4538B16442CDD00BCF63B"
BuildableName = "Boxer Bundler.app"
BlueprintName = "Boxer Bundler"
ReferencedContainer = "container:Boxer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FB4538B16442CDD00BCF63B"
BuildableName = "Boxer Bundler.app"
BlueprintName = "Boxer Bundler"
ReferencedContainer = "container:Boxer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FB4538B16442CDD00BCF63B"
BuildableName = "Boxer Bundler.app"
BlueprintName = "Boxer Bundler"
ReferencedContainer = "container:Boxer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
44 changes: 32 additions & 12 deletions Boxer/BXBezelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,33 @@ - (void) showVolumeBezelForVolume: (float)volume

level.floatValue = volume;

NSString *iconName;
if (volume > 0.66f)
iconName = @"Volume100PercentTemplate";
else if (volume > 0.33f)
iconName = @"Volume66PercentTemplate";
else if (volume > 0.0f)
iconName = @"Volume33PercentTemplate";
else
iconName = @"Volume0PercentTemplate";

icon.image = [NSImage imageNamed: iconName];
if (@available(macOS 13.0, *)) {
icon.image = [NSImage imageWithSymbolName: @"speaker.wave.3.fill" variableValue: volume];
} else if (@available(macOS 11.0, *)) {
NSImage *image;
if (volume > 0.66f)
image = [NSImage imageWithSystemSymbolName: @"speaker.wave.3.fill" accessibilityDescription:@"full volume"];
else if (volume > 0.33f)
image = [NSImage imageWithSystemSymbolName: @"speaker.wave.2.fill" accessibilityDescription:@"66% volume"];
else if (volume > 0.0f)
image = [NSImage imageWithSystemSymbolName: @"speaker.wave.1.fill" accessibilityDescription:@"33% volume"];
else
image = [NSImage imageWithSystemSymbolName: @"speaker.fill" accessibilityDescription:@"no volume"];

icon.image = image;
} else {
NSString *iconName;
if (volume > 0.66f)
iconName = @"speaker.wave.3.fill";
else if (volume > 0.33f)
iconName = @"Volume66PercentTemplate";
else if (volume > 0.0f)
iconName = @"Volume33PercentTemplate";
else
iconName = @"Volume0PercentTemplate";

icon.image = [NSImage imageNamed: iconName];
}

[self showBezel: bezel
forDuration: BXVolumeBezelDuration
Expand Down Expand Up @@ -455,7 +471,11 @@ - (void) showDriveRemovedBezelForDrive: (BXDrive *)drive

actionLabel.stringValue = [NSString stringWithFormat: actionFormat, drive.letter];
titleLabel.stringValue = drive.title;
icon.image = [NSImage imageNamed: @"EjectTemplate"];
if (@available(macOS 11.0, *)) {
icon.image = [NSImage imageWithSystemSymbolName: @"eject.fill" accessibilityDescription: nil];
} else {
icon.image = [NSImage imageNamed: @"eject.fill"];
}

[self showBezel: bezel
forDuration: BXDriveBezelDuration
Expand Down
4 changes: 2 additions & 2 deletions Other Sources/ADBToolkit/ADBSwiftHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ extension ADBBinCueImage {
static func isCue(at cueURL: URL) throws -> Bool {
var outError: NSError? = nil
let isACue = __isCue(at: cueURL, error: &outError)
if !isACue, let err = outError {
throw err
if !isACue, let outError {
throw outError
}
return isACue
}
Expand Down
30 changes: 17 additions & 13 deletions Resources/Base.lproj/Bezel.xib
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ Cmd+click to access the menu bar.</string>
</levelIndicatorCell>
</levelIndicator>
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="15">
<rect key="frame" x="16" y="40" width="24" height="24"/>
<rect key="frame" x="16" y="40.5" width="24" height="24"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="TurtleTemplate" id="16" customClass="BXHUDImageCell"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="tortoise.fill" catalog="system" id="16" customClass="BXHUDImageCell"/>
</imageView>
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="17">
<rect key="frame" x="260" y="41" width="24" height="24"/>
<rect key="frame" x="260" y="38" width="24.5" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="BunnyTemplate" id="18" customClass="BXHUDImageCell"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="hare.fill" catalog="system" id="18" customClass="BXHUDImageCell"/>
</imageView>
</subviews>
<point key="canvasLocation" x="14" y="135"/>
</customView>
<customView id="19" userLabel="Throttle Bezel" customClass="BXBezelView">
<rect key="frame" x="0.0" y="0.0" width="240" height="80"/>
Expand Down Expand Up @@ -146,9 +147,9 @@ Cmd+click to access the menu bar.</string>
</textFieldCell>
</textField>
<imageView fixedFrame="YES" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="39">
<rect key="frame" x="59" y="75" width="102" height="102"/>
<rect key="frame" x="59" y="72.5" width="102.5" height="107"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="EjectTemplate" id="42" customClass="BXHUDImageCell"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="eject.fill" catalog="system" id="42" customClass="BXHUDImageCell"/>
</imageView>
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="69" customClass="BXHUDLabel">
<rect key="frame" x="17" y="24" width="186" height="18"/>
Expand All @@ -160,6 +161,7 @@ Cmd+click to access the menu bar.</string>
</textFieldCell>
</textField>
</subviews>
<point key="canvasLocation" x="-121" y="-70"/>
</customView>
<customView id="44" userLabel="Drive Imported Bezel" customClass="BXBezelView">
<rect key="frame" x="0.0" y="0.0" width="220" height="200"/>
Expand Down Expand Up @@ -410,9 +412,10 @@ in Boxer’s Audio preferences.</string>
<imageView fixedFrame="YES" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="126">
<rect key="frame" x="29" y="29" width="102" height="102"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="ScreenshotTemplate" id="127" customClass="BXHUDImageCell"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="camera.fill" catalog="system" id="127" customClass="BXHUDImageCell"/>
</imageView>
</subviews>
<point key="canvasLocation" x="14" y="135"/>
</customView>
<customView id="129" userLabel="Fast Forward Bezel" customClass="BXBezelView">
<rect key="frame" x="0.0" y="0.0" width="160" height="160"/>
Expand Down Expand Up @@ -440,9 +443,10 @@ in Boxer’s Audio preferences.</string>
<imageView fixedFrame="YES" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="142">
<rect key="frame" x="69" y="50" width="102" height="102"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="Volume0PercentTemplate" id="143" customClass="BXHUDImageCell"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="speaker.fill" catalog="system" id="143" customClass="BXHUDImageCell"/>
</imageView>
</subviews>
<point key="canvasLocation" x="14" y="135"/>
</customView>
<customView id="145" userLabel="Mouse Locked bezel" customClass="BXBezelView">
<rect key="frame" x="0.0" y="0.0" width="434" height="65"/>
Expand All @@ -466,8 +470,6 @@ in Boxer’s Audio preferences.</string>
</customView>
</objects>
<resources>
<image name="BunnyTemplate" width="13" height="14"/>
<image name="EjectTemplate" width="15" height="13"/>
<image name="FastForwardBezelTemplate" width="102" height="70"/>
<image name="NSLockLockedTemplate" width="19" height="19"/>
<image name="NSRightFacingTriangleTemplate" width="12" height="17"/>
Expand All @@ -477,8 +479,10 @@ in Boxer’s Audio preferences.</string>
<image name="NumpadInactiveTemplate" width="112" height="112"/>
<image name="PauseBezelTemplate" width="79" height="102"/>
<image name="PlayBezelTemplate" width="79" height="102"/>
<image name="ScreenshotTemplate" width="16" height="12"/>
<image name="TurtleTemplate" width="18" height="10"/>
<image name="Volume0PercentTemplate" width="17" height="16"/>
<image name="camera.fill" catalog="system" width="19" height="15"/>
<image name="eject.fill" catalog="system" width="16" height="14"/>
<image name="hare.fill" catalog="system" width="23" height="16"/>
<image name="speaker.fill" catalog="system" width="14" height="14"/>
<image name="tortoise.fill" catalog="system" width="24" height="13"/>
</resources>
</document>
20 changes: 10 additions & 10 deletions Resources/Base.lproj/DOSImportWindow.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17132.0.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17132.0.2"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -25,7 +25,7 @@
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="1" customClass="BXDOSWindow">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="400" y="200" width="640" height="570"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="640" height="570"/>
<autoresizingMask key="autoresizingMask"/>
Expand All @@ -41,7 +41,7 @@
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="986">
<rect key="frame" x="0.0" y="4" width="19" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="recessed" bezelStyle="recessed" image="Volume0PercentCroppedTemplate" imagePosition="only" alignment="center" controlSize="small" state="on" borderStyle="border" inset="2" id="991">
<buttonCell key="cell" type="recessed" bezelStyle="recessed" image="speaker.fill" catalog="system" imagePosition="only" alignment="center" controlSize="small" state="on" borderStyle="border" inset="2" id="991">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="systemBold" size="12"/>
</buttonCell>
Expand All @@ -52,7 +52,7 @@
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="987">
<rect key="frame" x="95" y="4" width="27" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="recessed" bezelStyle="recessed" image="Volume100PercentTemplate" imagePosition="only" alignment="center" controlSize="small" state="on" borderStyle="border" inset="2" id="990">
<buttonCell key="cell" type="recessed" bezelStyle="recessed" image="speaker.wave.3.fill" catalog="system" imagePosition="only" alignment="center" controlSize="small" state="on" borderStyle="border" inset="2" id="990">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="systemBold" size="12"/>
</buttonCell>
Expand Down Expand Up @@ -91,7 +91,7 @@
<action selector="performSegmentedButtonAction:" target="926" id="929"/>
</connections>
</segmentedControl>
<textField verticalHuggingPriority="750" fixedFrame="YES" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="909">
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="909">
<rect key="frame" x="185" y="6" width="270" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Cmd-click to lock the mouse to the window." id="910">
Expand Down Expand Up @@ -167,10 +167,10 @@
</viewController>
</objects>
<resources>
<image name="NSLockUnlockedTemplate" width="18" height="13"/>
<image name="NSRevealFreestandingTemplate" width="15" height="13"/>
<image name="NSLockUnlockedTemplate" width="21" height="19"/>
<image name="NSRevealFreestandingTemplate" width="20" height="20"/>
<image name="PanelExpandTemplate" width="13" height="12"/>
<image name="Volume0PercentCroppedTemplate" width="7" height="12"/>
<image name="Volume100PercentTemplate" width="17" height="16"/>
<image name="speaker.fill" catalog="system" width="14" height="14"/>
<image name="speaker.wave.3.fill" catalog="system" width="22" height="15"/>
</resources>
</document>
Loading

0 comments on commit 11a4793

Please sign in to comment.