diff --git a/Loop/Luminare/Settings/Behavior/Padding Configuration/PaddingConfigurationView.swift b/Loop/Luminare/Settings/Behavior/Padding Configuration/PaddingConfigurationView.swift index 4b4668dc..a85eb000 100644 --- a/Loop/Luminare/Settings/Behavior/Padding Configuration/PaddingConfigurationView.swift +++ b/Loop/Luminare/Settings/Behavior/Padding Configuration/PaddingConfigurationView.swift @@ -60,11 +60,19 @@ struct PaddingConfigurationView: View { paddingModel.configureScreenPadding = newValue if !paddingModel.configureScreenPadding { - paddingModel.window = 0 - paddingModel.top = 0 - paddingModel.bottom = 0 - paddingModel.right = 0 - paddingModel.left = 0 + if paddingModel.allEqual { + let window = paddingModel.window + paddingModel.top = window + paddingModel.bottom = window + paddingModel.right = window + paddingModel.left = window + } else { + paddingModel.window = 0 + paddingModel.top = 0 + paddingModel.bottom = 0 + paddingModel.right = 0 + paddingModel.left = 0 + } } } } diff --git a/Loop/Utilities/PaddingModel.swift b/Loop/Utilities/PaddingModel.swift index 645e8217..a825d1e2 100644 --- a/Loop/Utilities/PaddingModel.swift +++ b/Loop/Utilities/PaddingModel.swift @@ -39,4 +39,8 @@ struct PaddingModel: Codable, Defaults.Serializable, Hashable { var totalHorizontalPadding: CGFloat { right + left } + + var allEqual: Bool { + window == top && window == bottom && window == right && window == left + } }