core: add chat message tail and roundness settings (#4977)

* core: add chat message tail and roundness settings

* ios: import/export chat message tail and roundness settings (#4978)
This commit is contained in:
Diogo
2024-10-05 19:44:26 +01:00
committed by GitHub
parent bb2a6ec65d
commit 8727d3b91b
3 changed files with 22 additions and 0 deletions
@@ -58,6 +58,8 @@ extension AppSettings {
profileImageCornerRadiusGroupDefault.set(val)
def.setValue(val, forKey: DEFAULT_PROFILE_IMAGE_CORNER_RADIUS)
}
if let val = uiChatItemRoundness { def.setValue(val, forKey: DEFAULT_CHAT_ITEM_ROUNDNESS)}
if let val = uiChatItemTail { def.setValue(val, forKey: DEFAULT_CHAT_ITEM_TAIL)}
if let val = uiColorScheme { currentThemeDefault.set(val) }
if let val = uiDarkColorScheme { systemDarkThemeDefault.set(val) }
if let val = uiCurrentThemeIds { currentThemeIdsDefault.set(val) }
@@ -91,6 +93,8 @@ extension AppSettings {
c.iosCallKitEnabled = callKitEnabledGroupDefault.get()
c.iosCallKitCallsInRecents = def.bool(forKey: DEFAULT_CALL_KIT_CALLS_IN_RECENTS)
c.uiProfileImageCornerRadius = def.double(forKey: DEFAULT_PROFILE_IMAGE_CORNER_RADIUS)
c.uiChatItemRoundness = def.double(forKey: DEFAULT_CHAT_ITEM_ROUNDNESS)
c.uiChatItemTail = def.bool(forKey: DEFAULT_CHAT_ITEM_TAIL)
c.uiColorScheme = currentThemeDefault.get()
c.uiDarkColorScheme = systemDarkThemeDefault.get()
c.uiCurrentThemeIds = currentThemeIdsDefault.get()
+6
View File
@@ -2251,6 +2251,8 @@ public struct AppSettings: Codable, Equatable {
public var iosCallKitEnabled: Bool? = nil
public var iosCallKitCallsInRecents: Bool? = nil
public var uiProfileImageCornerRadius: Double? = nil
public var uiChatItemRoundness: Double? = nil
public var uiChatItemTail: Bool? = nil
public var uiColorScheme: String? = nil
public var uiDarkColorScheme: String? = nil
public var uiCurrentThemeIds: [String: String]? = nil
@@ -2283,6 +2285,8 @@ public struct AppSettings: Codable, Equatable {
if iosCallKitEnabled != def.iosCallKitEnabled { empty.iosCallKitEnabled = iosCallKitEnabled }
if iosCallKitCallsInRecents != def.iosCallKitCallsInRecents { empty.iosCallKitCallsInRecents = iosCallKitCallsInRecents }
if uiProfileImageCornerRadius != def.uiProfileImageCornerRadius { empty.uiProfileImageCornerRadius = uiProfileImageCornerRadius }
if uiChatItemRoundness != def.uiChatItemRoundness { empty.uiChatItemRoundness = uiChatItemRoundness }
if uiChatItemTail != def.uiChatItemTail { empty.uiChatItemTail = uiChatItemTail }
if uiColorScheme != def.uiColorScheme { empty.uiColorScheme = uiColorScheme }
if uiDarkColorScheme != def.uiDarkColorScheme { empty.uiDarkColorScheme = uiDarkColorScheme }
if uiCurrentThemeIds != def.uiCurrentThemeIds { empty.uiCurrentThemeIds = uiCurrentThemeIds }
@@ -2316,6 +2320,8 @@ public struct AppSettings: Codable, Equatable {
iosCallKitEnabled: true,
iosCallKitCallsInRecents: false,
uiProfileImageCornerRadius: 22.5,
uiChatItemRoundness: 0.75,
uiChatItemTail: true,
uiColorScheme: DefaultTheme.SYSTEM_THEME_NAME,
uiDarkColorScheme: DefaultTheme.SIMPLEX.themeName,
uiCurrentThemeIds: nil as [String: String]?,
+12
View File
@@ -50,6 +50,8 @@ data AppSettings = AppSettings
iosCallKitEnabled :: Maybe Bool,
iosCallKitCallsInRecents :: Maybe Bool,
uiProfileImageCornerRadius :: Maybe Double,
uiChatItemRoundness :: Maybe Double,
uiChatItemTail :: Maybe Bool,
uiColorScheme :: Maybe UIColorScheme,
uiDarkColorScheme :: Maybe DarkColorScheme,
uiCurrentThemeIds :: Maybe (Map ThemeColorScheme Text),
@@ -97,6 +99,8 @@ defaultAppSettings =
iosCallKitEnabled = Just True,
iosCallKitCallsInRecents = Just False,
uiProfileImageCornerRadius = Just 22.5,
uiChatItemRoundness = Just 0.75,
uiChatItemTail = Just True,
uiColorScheme = Just UCSSystem,
uiDarkColorScheme = Just DCSSimplex,
uiCurrentThemeIds = Nothing,
@@ -131,6 +135,8 @@ defaultParseAppSettings =
iosCallKitEnabled = Nothing,
iosCallKitCallsInRecents = Nothing,
uiProfileImageCornerRadius = Nothing,
uiChatItemRoundness = Nothing,
uiChatItemTail = Nothing,
uiColorScheme = Nothing,
uiDarkColorScheme = Nothing,
uiCurrentThemeIds = Nothing,
@@ -165,6 +171,8 @@ combineAppSettings platformDefaults storedSettings =
iosCallKitCallsInRecents = p iosCallKitCallsInRecents,
androidCallOnLockScreen = p androidCallOnLockScreen,
uiProfileImageCornerRadius = p uiProfileImageCornerRadius,
uiChatItemRoundness = p uiChatItemRoundness,
uiChatItemTail = p uiChatItemTail,
uiColorScheme = p uiColorScheme,
uiDarkColorScheme = p uiDarkColorScheme,
uiCurrentThemeIds = p uiCurrentThemeIds,
@@ -215,6 +223,8 @@ instance FromJSON AppSettings where
iosCallKitCallsInRecents <- p "iosCallKitCallsInRecents"
androidCallOnLockScreen <- p "androidCallOnLockScreen"
uiProfileImageCornerRadius <- p "uiProfileImageCornerRadius"
uiChatItemRoundness <- p "uiChatItemRoundness"
uiChatItemTail <- p "uiChatItemTail"
uiColorScheme <- p "uiColorScheme"
uiDarkColorScheme <- p "uiDarkColorScheme"
uiCurrentThemeIds <- p "uiCurrentThemeIds"
@@ -246,6 +256,8 @@ instance FromJSON AppSettings where
iosCallKitCallsInRecents,
androidCallOnLockScreen,
uiProfileImageCornerRadius,
uiChatItemRoundness,
uiChatItemTail,
uiColorScheme,
uiDarkColorScheme,
uiCurrentThemeIds,