Skip to content

Commit

Permalink
More SFSymbols.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Oct 11, 2023
1 parent 31db71b commit 2912f8b
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 31 deletions.
19 changes: 14 additions & 5 deletions Boxer/BXBezelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,29 @@ @implementation BXBezelController

+ (NSImage *) bezelIconForDrive: (BXDrive *)drive
{
NSString *iconName;
NSImage *icon;
switch (drive.type)
{
case BXDriveCDROM:
iconName = @"CDROMTemplate";
if (@available(macOS 13.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"opticaldisc.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"CDROMTemplate"];
}
break;
case BXDriveFloppyDisk:
iconName = @"DisketteTemplate";
icon = [NSImage imageNamed: @"DisketteTemplate"];
break;
default:
iconName = @"HardDiskTemplate";
if (@available(macOS 11.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"internaldrive.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"HardDiskTemplate"];
}
break;
}

return [NSImage imageNamed: iconName];
return icon;
}

+ (id) controller
Expand Down
19 changes: 14 additions & 5 deletions Boxer/DOS window/BXLaunchPanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -460,20 +460,29 @@ - (NSDictionary *) _listItemForProgramAtURL: (NSURL *)URL

+ (NSImage *) _headingIconForDriveType: (BXDriveType)type
{
NSString *iconName;
NSImage *icon;
switch (type)
{
case BXDriveCDROM:
iconName = @"CDROMTemplate";
if (@available(macOS 13.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"opticaldisc.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"CDROMTemplate"];
}
break;
case BXDriveFloppyDisk:
iconName = @"DisketteTemplate";
icon = [NSImage imageNamed: @"DisketteTemplate"];
break;
default:
iconName = @"HardDiskTemplate";
if (@available(macOS 11.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"internaldrive.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"HardDiskTemplate"];
}
break;
}

return [NSImage imageNamed: iconName];
return icon;
}

- (NSDictionary *) _listItemForDrive: (BXDrive *)drive
Expand Down
19 changes: 14 additions & 5 deletions Boxer/Inspector Panel/BXDriveItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,29 @@ + (NSSet *) keyPathsForValuesAffectingMounted { return [NSSet setWithObject: @"d

- (NSImage *) driveImage
{
NSString *iconName;
NSImage *icon;
switch (self.drive.type)
{
case BXDriveCDROM:
iconName = @"CDROMTemplate";
if (@available(macOS 13.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"opticaldisc.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"CDROMTemplate"];
}
break;
case BXDriveFloppyDisk:
iconName = @"DisketteTemplate";
icon = [NSImage imageNamed: @"DisketteTemplate"];
break;
default:
iconName = @"HardDiskTemplate";
if (@available(macOS 11.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"internaldrive.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"HardDiskTemplate"];
}
break;
}

return [NSImage imageNamed: iconName];
return icon;
}
+ (NSSet *) keyPathsForValuesAffectingDriveImage { return [NSSet setWithObject: @"drive.type"]; }

Expand Down
33 changes: 17 additions & 16 deletions Resources/Base.lproj/InspectorDriveItem.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="14269.14" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<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="14269.14"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -28,7 +28,7 @@
<rect key="frame" x="0.0" y="0.0" width="284" height="48"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" tag="5" id="3" userLabel="Import Progress Description" customClass="BXThemedLabel">
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="3" userLabel="Import Progress Description" customClass="BXThemedLabel">
<rect key="frame" x="51" y="8" width="93" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="100% of 999MB" id="21">
Expand All @@ -40,11 +40,11 @@
<userDefinedRuntimeAttribute type="string" keyPath="themeKey" value="BXInspectorListTheme"/>
</userDefinedRuntimeAttributes>
</textField>
<progressIndicator hidden="YES" verticalHuggingPriority="750" maxValue="1" bezeled="NO" indeterminate="YES" controlSize="small" style="bar" id="8" userLabel="Import Progress" customClass="BXThemedProgressIndicator">
<progressIndicator hidden="YES" verticalHuggingPriority="750" fixedFrame="YES" maxValue="1" bezeled="NO" indeterminate="YES" controlSize="small" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="8" userLabel="Import Progress" customClass="BXThemedProgressIndicator">
<rect key="frame" x="141" y="9" width="114" height="12"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
</progressIndicator>
<textField verticalHuggingPriority="750" tag="3" id="4" userLabel="Drive Type" customClass="BXThemedLabel">
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="4" userLabel="Drive Type" customClass="BXThemedLabel">
<rect key="frame" x="51" y="8" width="216" height="14"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="[Drive type]" id="20">
Expand All @@ -64,7 +64,7 @@
</binding>
</connections>
</textField>
<button hidden="YES" toolTip="Cancel Import" tag="6" id="9" userLabel="Cancel Import">
<button hidden="YES" toolTip="Cancel Import" tag="6" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9" userLabel="Cancel Import">
<rect key="frame" x="256" y="7" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSStopProgressFreestandingTemplate" imagePosition="only" scrollable="YES" lineBreakMode="clipping" imageScaling="proportionallyDown" inset="2" id="16" customClass="BXDriveItemButtonCell">
Expand All @@ -75,7 +75,7 @@
<action selector="cancelImport:" target="-2" id="132"/>
</connections>
</button>
<button hidden="YES" tag="7" id="11" userLabel="Insert/Eject">
<button hidden="YES" tag="7" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="11" userLabel="Insert/Eject">
<rect key="frame" x="255" y="23" width="18" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="EjectFreestandingTemplate" imagePosition="only" scrollable="YES" lineBreakMode="clipping" imageScaling="proportionallyDown" inset="2" id="14" customClass="BXDriveItemButtonCell">
Expand All @@ -88,7 +88,7 @@
<binding destination="-2" name="toolTip" keyPath="tooltipForToggle" previousBinding="117" id="118"/>
</connections>
</button>
<button hidden="YES" toolTip="Show in Finder" tag="8" id="10" userLabel="Show in Finder">
<button hidden="YES" toolTip="Show in Finder" tag="8" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="10" userLabel="Show in Finder">
<rect key="frame" x="236" y="23" width="18" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSRevealFreestandingTemplate" imagePosition="only" scrollable="YES" lineBreakMode="clipping" imageScaling="proportionallyDown" inset="2" id="15" customClass="BXDriveItemButtonCell">
Expand All @@ -99,7 +99,7 @@
<action selector="revealInFinder:" target="-2" id="129"/>
</connections>
</button>
<button hidden="YES" toolTip="Import into Gamebox" tag="9" id="6" userLabel="Import">
<button hidden="YES" toolTip="Import into Gamebox" tag="9" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6" userLabel="Import">
<rect key="frame" x="217" y="23" width="18" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="BundleFreestandingTemplate" imagePosition="only" scrollable="YES" lineBreakMode="clipping" imageScaling="proportionallyDown" inset="2" id="18" customClass="BXDriveItemButtonCell">
Expand All @@ -110,10 +110,10 @@
<action selector="import:" target="-2" id="131"/>
</connections>
</button>
<imageView tag="4" id="7">
<rect key="frame" x="10" y="6" width="38" height="38"/>
<imageView fixedFrame="YES" tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="7">
<rect key="frame" x="11" y="8" width="32" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" enabled="NO" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="CDROMTemplate" id="17" customClass="BXThemedImageCell">
<imageCell key="cell" enabled="NO" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="CDROMTemplate" id="17" customClass="BXThemedImageCell">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="themeKey" value="BXInspectorListTheme"/>
</userDefinedRuntimeAttributes>
Expand All @@ -123,7 +123,7 @@
<binding destination="-2" name="enabled" keyPath="mounted" id="93"/>
</connections>
</imageView>
<textField verticalHuggingPriority="750" id="12" userLabel="Drive Letter">
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12" userLabel="Drive Letter">
<rect key="frame" x="48" y="20" width="25" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="W" id="13" customClass="BXDriveLetterCell">
Expand All @@ -139,7 +139,7 @@
<binding destination="-2" name="enabled" keyPath="mounted" id="91"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" tag="2" id="5" userLabel="Drive Name" customClass="BXThemedLabel">
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="5" userLabel="Drive Name" customClass="BXThemedLabel">
<rect key="frame" x="72" y="24" width="140" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingHead" sendsActionOnEndEditing="YES" alignment="left" title="[Display name]" id="19">
Expand All @@ -164,13 +164,14 @@
<connections>
<outlet property="delegate" destination="-2" id="98"/>
</connections>
<point key="canvasLocation" x="14" y="135"/>
</customView>
</objects>
<resources>
<image name="BundleFreestandingTemplate" width="14" height="14"/>
<image name="CDROMTemplate" width="32" height="32"/>
<image name="EjectFreestandingTemplate" width="14" height="14"/>
<image name="NSRevealFreestandingTemplate" width="14" height="14"/>
<image name="NSStopProgressFreestandingTemplate" width="14" height="14"/>
<image name="NSRevealFreestandingTemplate" width="20" height="20"/>
<image name="NSStopProgressFreestandingTemplate" width="20" height="20"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}

0 comments on commit 2912f8b

Please sign in to comment.