From 801f75a2309df27f76fa73739b0950707bd9be6a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 13 Jan 2023 13:31:31 -0600 Subject: [PATCH] added IconSize Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 4 +++ VDS/Components/Icon/IconSize.swift | 39 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 VDS/Components/Icon/IconSize.swift diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 6292a189..488ac69e 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -65,6 +65,7 @@ EA985C23296E033A00F2FF2E /* TextArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985C22296E033A00F2FF2E /* TextArea.swift */; }; EA985C2D296F03FE00F2FF2E /* TiletIconModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985C2C296F03FE00F2FF2E /* TiletIconModels.swift */; }; EA985C672970C21600F2FF2E /* VDSLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985C662970C21600F2FF2E /* VDSLayout.swift */; }; + EA985C692971B90B00F2FF2E /* IconSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985C682971B90B00F2FF2E /* IconSize.swift */; }; EAA5EEB528ECBFB4003B3210 /* ImageLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */; }; EAA5EEB728ECC03A003B3210 /* ToolTipLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */; }; EAA5EEB928ECD24B003B3210 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAA5EEB828ECD24B003B3210 /* Icons.xcassets */; }; @@ -179,6 +180,7 @@ EA985C22296E033A00F2FF2E /* TextArea.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextArea.swift; sourceTree = ""; }; EA985C2C296F03FE00F2FF2E /* TiletIconModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TiletIconModels.swift; sourceTree = ""; }; EA985C662970C21600F2FF2E /* VDSLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSLayout.swift; sourceTree = ""; }; + EA985C682971B90B00F2FF2E /* IconSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconSize.swift; sourceTree = ""; }; EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageLabelAttribute.swift; sourceTree = ""; }; EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolTipLabelAttribute.swift; sourceTree = ""; }; EAA5EEB828ECD24B003B3210 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = ""; }; @@ -523,6 +525,7 @@ EA985BF4296C60C000F2FF2E /* Icon.swift */, EA985BF8296C710100F2FF2E /* IconColor.swift */, EA985BF6296C665E00F2FF2E /* IconName.swift */, + EA985C682971B90B00F2FF2E /* IconSize.swift */, ); path = Icon; sourceTree = ""; @@ -824,6 +827,7 @@ EAB5FED429267EB300998C17 /* UIView.swift in Sources */, EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */, EA33623E2892EE950071C351 /* UIDevice.swift in Sources */, + EA985C692971B90B00F2FF2E /* IconSize.swift in Sources */, EA985C672970C21600F2FF2E /* VDSLayout.swift in Sources */, EA3362302891EB4A0071C351 /* Fonts.swift in Sources */, EAF7F0AD289B142900B287F5 /* StrikeThroughLabelAttribute.swift in Sources */, diff --git a/VDS/Components/Icon/IconSize.swift b/VDS/Components/Icon/IconSize.swift new file mode 100644 index 00000000..ca1b8548 --- /dev/null +++ b/VDS/Components/Icon/IconSize.swift @@ -0,0 +1,39 @@ +// +// IconSize.swift +// VDS +// +// Created by Matt Bruce on 1/13/23. +// + +import Foundation + +extension Icon { + public enum Size: String, CaseIterable, Codable { + case xsmall + case small + case medium + case large + case XLarge + + public var dimensions: CGSize { + switch self { + + case .xsmall: + return .init(width: 12, height: 12) + + case .small: + return .init(width: 16, height: 16) + + case .medium: + return .init(width: 20, height: 20) + + case .large: + return .init(width: 24, height: 24) + + case .XLarge: + return .init(width: 28, height: 28) + + } + } + } +}