From 90337bd3ea0d92d3b73cab55dd3797a731b4441e Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 20 Sep 2023 08:20:01 +0200 Subject: [PATCH] Bump version to 1.8.2 --- IceCubesApp.xcodeproj/project.pbxproj | 16 ++++++++-------- .../App/Tabs/Settings/DisplaySettingsView.swift | 3 +-- .../Sources/DesignSystem/Theme.swift | 5 +++++ .../Sources/DesignSystem/ThemeApplier.swift | 9 +++------ .../DesignSystem/Views/ThemePreviewView.swift | 3 +-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/IceCubesApp.xcodeproj/project.pbxproj b/IceCubesApp.xcodeproj/project.pbxproj index be3cc015..98285b94 100644 --- a/IceCubesApp.xcodeproj/project.pbxproj +++ b/IceCubesApp.xcodeproj/project.pbxproj @@ -981,7 +981,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesNotifications"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1011,7 +1011,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesNotifications"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1042,7 +1042,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1072,7 +1072,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1244,7 +1244,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -1297,7 +1297,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -1331,7 +1331,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesActionExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1362,7 +1362,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.8.1; + MARKETING_VERSION = 1.8.2; PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesActionExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; diff --git a/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift b/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift index 66d8e75b..dcd23e0d 100644 --- a/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift +++ b/IceCubesApp/App/Tabs/Settings/DisplaySettingsView.swift @@ -232,8 +232,7 @@ struct DisplaySettingsView: View { Section { Button { theme.followSystemColorScheme = true - theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight - theme.setColor(withName: theme.selectedSet) + theme.applySet(set: colorScheme == .dark ? .iceCubeDark : .iceCubeLight) theme.avatarShape = .rounded theme.avatarPosition = .top theme.statusActionsDisplay = .full diff --git a/Packages/DesignSystem/Sources/DesignSystem/Theme.swift b/Packages/DesignSystem/Sources/DesignSystem/Theme.swift index 092ea174..c8478f53 100644 --- a/Packages/DesignSystem/Sources/DesignSystem/Theme.swift +++ b/Packages/DesignSystem/Sources/DesignSystem/Theme.swift @@ -287,6 +287,11 @@ import SwiftUI ConstellationDark(), ] } + + public func applySet(set: ColorSetName) { + selectedSet = set + setColor(withName: set) + } public func setColor(withName name: ColorSetName) { let colorSet = Theme.allColorSet.filter { $0.name == name }.first ?? IceCubeDark() diff --git a/Packages/DesignSystem/Sources/DesignSystem/ThemeApplier.swift b/Packages/DesignSystem/Sources/DesignSystem/ThemeApplier.swift index bbf2e3c4..cf47fab9 100644 --- a/Packages/DesignSystem/Sources/DesignSystem/ThemeApplier.swift +++ b/Packages/DesignSystem/Sources/DesignSystem/ThemeApplier.swift @@ -30,15 +30,13 @@ struct ThemeApplier: ViewModifier { .onAppear { // If theme is never set before set the default store. This should only execute once after install. if !theme.isThemePreviouslySet { - theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight - theme.setColor(withName: theme.selectedSet) + theme.applySet(set: colorScheme == .dark ? .iceCubeDark : .iceCubeLight) theme.isThemePreviouslySet = true } else if theme.followSystemColorScheme, theme.isThemePreviouslySet, let sets = availableColorsSets .first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet }) { - theme.selectedSet = colorScheme == .dark ? sets.dark.name : sets.light.name - theme.setColor(withName: theme.selectedSet) + theme.applySet(set: colorScheme == .dark ? sets.dark.name : sets.light.name) } setWindowTint(theme.tintColor) setWindowUserInterfaceStyle(from: theme.selectedScheme) @@ -58,8 +56,7 @@ struct ThemeApplier: ViewModifier { let sets = availableColorsSets .first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet }) { - theme.selectedSet = newColorScheme == .dark ? sets.dark.name : sets.light.name - theme.setColor(withName: theme.selectedSet) + theme.applySet(set: newColorScheme == .dark ? sets.dark.name : sets.light.name) } } #endif diff --git a/Packages/DesignSystem/Sources/DesignSystem/Views/ThemePreviewView.swift b/Packages/DesignSystem/Sources/DesignSystem/Views/ThemePreviewView.swift index 1aa577d0..6c50ada8 100644 --- a/Packages/DesignSystem/Sources/DesignSystem/Views/ThemePreviewView.swift +++ b/Packages/DesignSystem/Sources/DesignSystem/Views/ThemePreviewView.swift @@ -89,8 +89,7 @@ struct ThemeBoxView: View { if color.scheme != currentScheme { theme.followSystemColorScheme = false } - theme.selectedSet = color.name - theme.setColor(withName: theme.selectedSet) + theme.applySet(set: color.name) } } }