diff --git a/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift b/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift index 7327fc5f..9c27e098 100644 --- a/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift +++ b/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift @@ -238,6 +238,7 @@ struct DisplaySettingsView: View { } Toggle("settings.display.show-account-popover", isOn: $userPreferences.showAccountPopover) Toggle("Show Content Gradient", isOn: $theme.showContentGradient) + Toggle("Compact Layout", isOn: $theme.compactLayoutPadding) } #if !os(visionOS) .listRowBackground(theme.primaryBackgroundColor) diff --git a/IceCubesApp/Resources/Localization/Localizable.xcstrings b/IceCubesApp/Resources/Localization/Localizable.xcstrings index 09e42eb4..3525c08a 100644 --- a/IceCubesApp/Resources/Localization/Localizable.xcstrings +++ b/IceCubesApp/Resources/Localization/Localizable.xcstrings @@ -20951,6 +20951,9 @@ } } } + }, + "Compact Layout" : { + }, "Compose a post" : { "localizations" : { diff --git a/Packages/DesignSystem/Sources/DesignSystem/DesignSystem.swift b/Packages/DesignSystem/Sources/DesignSystem/DesignSystem.swift index 2c8e3d6f..ce06be8a 100644 --- a/Packages/DesignSystem/Sources/DesignSystem/DesignSystem.swift +++ b/Packages/DesignSystem/Sources/DesignSystem/DesignSystem.swift @@ -2,7 +2,10 @@ import Foundation @MainActor public extension CGFloat { - static let layoutPadding: CGFloat = 20 + static var layoutPadding: CGFloat { + Theme.shared.compactLayoutPadding ? 20 : 8 + } + static let dividerPadding: CGFloat = 2 static let scrollToViewHeight: CGFloat = 1 static let statusColumnsSpacing: CGFloat = 8 diff --git a/Packages/DesignSystem/Sources/DesignSystem/Theme.swift b/Packages/DesignSystem/Sources/DesignSystem/Theme.swift index e23a29dd..35847a22 100644 --- a/Packages/DesignSystem/Sources/DesignSystem/Theme.swift +++ b/Packages/DesignSystem/Sources/DesignSystem/Theme.swift @@ -14,6 +14,7 @@ public final class Theme { case lineSpacing case statusActionSecondary case contentGradient + case compactLayoutPadding } @AppStorage("is_previously_set") public var isThemePreviouslySet: Bool = false @@ -32,6 +33,7 @@ public final class Theme { @AppStorage(ThemeKey.lineSpacing.rawValue) public var lineSpacing: Double = 1.2 @AppStorage(ThemeKey.statusActionSecondary.rawValue) public var statusActionSecondary: StatusActionSecondary = .share @AppStorage(ThemeKey.contentGradient.rawValue) public var showContentGradient: Bool = true + @AppStorage(ThemeKey.compactLayoutPadding.rawValue) public var compactLayoutPadding: Bool = true @AppStorage("font_size_scale") public var fontSizeScale: Double = 1 @AppStorage("chosen_font") public var chosenFontData: Data? @@ -290,7 +292,13 @@ public final class Theme { themeStorage.showContentGradient = showContentGradient } } - + + public var compactLayoutPadding: Bool { + didSet { + themeStorage.compactLayoutPadding = compactLayoutPadding + } + } + public var selectedSet: ColorSetName = .iceCubeDark public static let shared = Theme() @@ -332,6 +340,7 @@ public final class Theme { chosenFontData = themeStorage.chosenFontData statusActionSecondary = themeStorage.statusActionSecondary showContentGradient = themeStorage.showContentGradient + compactLayoutPadding = themeStorage.compactLayoutPadding selectedSet = storedSet computeContrastingTintColor()