mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
[ios] Adding setting to change map appearance
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
e7cdaba817
commit
110648fb89
@@ -12,6 +12,10 @@ import Combine
|
||||
static private let userDefaultsKeyLeftButtonType = "LeftButtonType"
|
||||
|
||||
|
||||
/// Key for storing the map appearance in the user defaults
|
||||
static private let userDefaultsKeyMapAppearance = "MapAppearance"
|
||||
|
||||
|
||||
/// The current distance unit
|
||||
static var distanceUnit: DistanceUnit {
|
||||
get {
|
||||
@@ -147,6 +151,23 @@ import Combine
|
||||
}
|
||||
|
||||
|
||||
/// The current map appearance
|
||||
@objc static var mapAppearance: Appearance {
|
||||
get {
|
||||
let mapAppearanceRawValue = UserDefaults.standard.integer(forKey: userDefaultsKeyMapAppearance)
|
||||
if mapAppearanceRawValue != 0, let mapAppearance = Appearance(rawValue: mapAppearanceRawValue) {
|
||||
return mapAppearance
|
||||
}
|
||||
|
||||
return .auto
|
||||
}
|
||||
set {
|
||||
UserDefaults.standard.set(newValue.rawValue, forKey: userDefaultsKeyMapAppearance)
|
||||
ThemeManager.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// The current appearance
|
||||
@objc static var appearance: Appearance {
|
||||
get {
|
||||
|
||||
Reference in New Issue
Block a user