From 7ab9f580833d513d2561c490b2314bb1e9cd8d11 Mon Sep 17 00:00:00 2001 From: Ivan Zorin <6960799+zorikon@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:36:55 +0400 Subject: [PATCH 1/4] Fix view sizes --- Whisky.xcodeproj/project.pbxproj | 8 +++++ Whisky/Extensions/View+Extension.swift | 29 +++++++++++++++++++ Whisky/Utils/Constants.swift | 28 ++++++++++++++++++ Whisky/Views/Bottle/BottleCreationView.swift | 3 +- Whisky/Views/Bottle/ConfigView.swift | 2 +- .../Views/Bottle/Pins/PinCreationView.swift | 4 +-- Whisky/Views/Bottle/WinetricksView.swift | 2 +- Whisky/Views/Common/RenameView.swift | 3 +- Whisky/Views/FileOpenView.swift | 3 +- Whisky/Views/Settings/SettingsView.swift | 3 +- Whisky/Views/WhiskyApp.swift | 2 +- 11 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 Whisky/Extensions/View+Extension.swift create mode 100644 Whisky/Utils/Constants.swift diff --git a/Whisky.xcodeproj/project.pbxproj b/Whisky.xcodeproj/project.pbxproj index f7f2febee..6ad50f2ba 100644 --- a/Whisky.xcodeproj/project.pbxproj +++ b/Whisky.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 6365C4C12B1AA69D00AAE1FD /* Animation+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6365C4C02B1AA69D00AAE1FD /* Animation+Extensions.swift */; }; 6365C4C32B1AA8CD00AAE1FD /* BottleListEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6365C4C22B1AA8CD00AAE1FD /* BottleListEntry.swift */; }; 63FFDE862ADF0C7700178665 /* BottomBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63FFDE852ADF0C7700178665 /* BottomBar.swift */; }; + 6763D8F62BC6314100651D27 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6763D8F52BC6314100651D27 /* Constants.swift */; }; + 6763D8F82BC632A800651D27 /* View+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6763D8F72BC632A800651D27 /* View+Extension.swift */; }; 67D278512BC5907E006F9A1E /* ActionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67D278502BC5907E006F9A1E /* ActionView.swift */; }; 6E064B1229DD32A200D9A2D2 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 6E064B1129DD32A200D9A2D2 /* Sparkle */; }; 6E064B1429DD331F00D9A2D2 /* SparkleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E064B1329DD331F00D9A2D2 /* SparkleView.swift */; }; @@ -113,6 +115,8 @@ 6365C4C02B1AA69D00AAE1FD /* Animation+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Animation+Extensions.swift"; sourceTree = ""; }; 6365C4C22B1AA8CD00AAE1FD /* BottleListEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottleListEntry.swift; sourceTree = ""; }; 63FFDE852ADF0C7700178665 /* BottomBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BottomBar.swift; sourceTree = ""; }; + 6763D8F52BC6314100651D27 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; + 6763D8F72BC632A800651D27 /* View+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Extension.swift"; sourceTree = ""; }; 67D278502BC5907E006F9A1E /* ActionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionView.swift; sourceTree = ""; }; 6E064B1329DD331F00D9A2D2 /* SparkleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SparkleView.swift; sourceTree = ""; }; 6E17B6452AF3FDC100831173 /* PinView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinView.swift; sourceTree = ""; }; @@ -202,6 +206,7 @@ children = ( 6E40498229CCA91B006E3F1B /* Bottle+Extensions.swift */, 6365C4C02B1AA69D00AAE1FD /* Animation+Extensions.swift */, + 6763D8F72BC632A800651D27 /* View+Extension.swift */, ); path = Extensions; sourceTree = ""; @@ -347,6 +352,7 @@ 6E621CEE2A5F631200C9AAB3 /* Winetricks.swift */, 6E70A4A02A9A280C007799E9 /* WhiskyCmd.swift */, 6E7C07BD2AAE7B0100F6E66B /* ProgramShortcut.swift */, + 6763D8F52BC6314100651D27 /* Constants.swift */, ); path = Utils; sourceTree = ""; @@ -583,6 +589,7 @@ buildActionMask = 2147483647; files = ( EEA5A2462A31DD65008274AE /* AppDelegate.swift in Sources */, + 6763D8F62BC6314100651D27 /* Constants.swift in Sources */, 6E70A4A12A9A280C007799E9 /* WhiskyCmd.swift in Sources */, 6E40495829CCA19C006E3F1B /* ContentView.swift in Sources */, 67D278512BC5907E006F9A1E /* ActionView.swift in Sources */, @@ -593,6 +600,7 @@ 6E355E5829D78249002D83BE /* ConfigView.swift in Sources */, 63FFDE862ADF0C7700178665 /* BottomBar.swift in Sources */, 6E6C0CF62A419A8300356232 /* WhiskyWineDownloadView.swift in Sources */, + 6763D8F82BC632A800651D27 /* View+Extension.swift in Sources */, 6365C4C32B1AA8CD00AAE1FD /* BottleListEntry.swift in Sources */, 6E50D98529CDF25B008C39F6 /* BottleCreationView.swift in Sources */, 6E182FCA2B0BF64E00AADE81 /* WinetricksView.swift in Sources */, diff --git a/Whisky/Extensions/View+Extension.swift b/Whisky/Extensions/View+Extension.swift new file mode 100644 index 000000000..d471a6877 --- /dev/null +++ b/Whisky/Extensions/View+Extension.swift @@ -0,0 +1,29 @@ +// +// View+Extension.swift +// Whisky +// +// This file is part of Whisky. +// +// Whisky is free software: you can redistribute it and/or modify it under the terms +// of the GNU General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Whisky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with Whisky. +// If not, see https://www.gnu.org/licenses/. +// + +import SwiftUI + +extension View { + func fixedHorizontalSize() -> some View { + self.fixedSize(horizontal: true, vertical: false) + } + + func fixedVerticalSize() -> some View { + self.fixedSize(horizontal: false, vertical: true) + } +} diff --git a/Whisky/Utils/Constants.swift b/Whisky/Utils/Constants.swift new file mode 100644 index 000000000..d6b64c55d --- /dev/null +++ b/Whisky/Utils/Constants.swift @@ -0,0 +1,28 @@ +// +// Constants.swift +// Whisky +// +// This file is part of Whisky. +// +// Whisky is free software: you can redistribute it and/or modify it under the terms +// of the GNU General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Whisky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with Whisky. +// If not, see https://www.gnu.org/licenses/. +// + +import Foundation + +enum Constant { + // swiftlint:disable:next type_name + enum width { + static let small: Double = 400 + static let medium: Double = 500 + static let large: Double = 600 + } +} diff --git a/Whisky/Views/Bottle/BottleCreationView.swift b/Whisky/Views/Bottle/BottleCreationView.swift index f98fa3088..cc1996004 100644 --- a/Whisky/Views/Bottle/BottleCreationView.swift +++ b/Whisky/Views/Bottle/BottleCreationView.swift @@ -83,7 +83,8 @@ struct BottleCreationView: View { submit() } } - .frame(minWidth: 400, minHeight: 210) + .fixedVerticalSize() + .frame(width: Constant.width.small) } func submit() { diff --git a/Whisky/Views/Bottle/ConfigView.swift b/Whisky/Views/Bottle/ConfigView.swift index 7ad3e8a94..f131d5da1 100644 --- a/Whisky/Views/Bottle/ConfigView.swift +++ b/Whisky/Views/Bottle/ConfigView.swift @@ -301,7 +301,7 @@ struct DPIConfigSheetView: View { } } .padding() - .frame(width: 500, height: 240) + .frame(width: Constant.width.medium, height: 240) } } diff --git a/Whisky/Views/Bottle/Pins/PinCreationView.swift b/Whisky/Views/Bottle/Pins/PinCreationView.swift index 175ed18a5..a6f0ef5bb 100644 --- a/Whisky/Views/Bottle/Pins/PinCreationView.swift +++ b/Whisky/Views/Bottle/Pins/PinCreationView.swift @@ -93,8 +93,8 @@ struct PinCreationView: View { submit() } } - .fixedSize(horizontal: false, vertical: true) - .frame(minWidth: 400) + .fixedVerticalSize() + .frame(minWidth: Constant.width.small) } func submit() { diff --git a/Whisky/Views/Bottle/WinetricksView.swift b/Whisky/Views/Bottle/WinetricksView.swift index e06e347d7..4bee01056 100644 --- a/Whisky/Views/Bottle/WinetricksView.swift +++ b/Whisky/Views/Bottle/WinetricksView.swift @@ -84,6 +84,6 @@ struct WinetricksView: View { winetricks = await Winetricks.parseVerbs() } } - .frame(minWidth: 600, minHeight: 400) + .frame(minWidth: Constant.width.large, minHeight: 400) } } diff --git a/Whisky/Views/Common/RenameView.swift b/Whisky/Views/Common/RenameView.swift index 55c9a81d8..8bb7bfdc3 100644 --- a/Whisky/Views/Common/RenameView.swift +++ b/Whisky/Views/Common/RenameView.swift @@ -57,7 +57,8 @@ struct RenameView: View { submit() } } - .frame(minWidth: 350, minHeight: 115) + .fixedVerticalSize() + .frame(minWidth: Constant.width.small) } var isNameValid: Bool { diff --git a/Whisky/Views/FileOpenView.swift b/Whisky/Views/FileOpenView.swift index a9f5f8253..e2783d807 100644 --- a/Whisky/Views/FileOpenView.swift +++ b/Whisky/Views/FileOpenView.swift @@ -55,7 +55,8 @@ struct FileOpenView: View { } } } - .frame(minWidth: 400, minHeight: 115) + .fixedVerticalSize() + .frame(width: Constant.width.small) .onAppear { // Makes sure there are more than 0 bottles. // Otherwise, it will crash on the nil cascade diff --git a/Whisky/Views/Settings/SettingsView.swift b/Whisky/Views/Settings/SettingsView.swift index 6cac55f5b..46581efb0 100644 --- a/Whisky/Views/Settings/SettingsView.swift +++ b/Whisky/Views/Settings/SettingsView.swift @@ -53,7 +53,8 @@ struct SettingsView: View { } } .formStyle(.grouped) - .frame(width: 500, height: 250) + .fixedVerticalSize() + .frame(width: Constant.width.medium) } } diff --git a/Whisky/Views/WhiskyApp.swift b/Whisky/Views/WhiskyApp.swift index bfe460075..df971b3e7 100644 --- a/Whisky/Views/WhiskyApp.swift +++ b/Whisky/Views/WhiskyApp.swift @@ -36,7 +36,7 @@ struct WhiskyApp: App { var body: some Scene { WindowGroup { ContentView(showSetup: $showSetup) - .frame(minWidth: 550, minHeight: 250) + .frame(minWidth: Constant.width.large, minHeight: 316) .environmentObject(BottleVM.shared) .onAppear { NSWindow.allowsAutomaticWindowTabbing = false From e7bd167bbdedd909903dd67e7777cc438dd97ef2 Mon Sep 17 00:00:00 2001 From: Ivan Zorin <6960799+zorikon@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:29:09 +0400 Subject: [PATCH 2/4] Flatten the nested enum --- Whisky/Utils/Constants.swift | 11 ++++------- Whisky/Views/Bottle/BottleCreationView.swift | 2 +- Whisky/Views/Bottle/ConfigView.swift | 2 +- Whisky/Views/Bottle/Pins/PinCreationView.swift | 2 +- Whisky/Views/Bottle/WinetricksView.swift | 2 +- Whisky/Views/Common/RenameView.swift | 2 +- Whisky/Views/FileOpenView.swift | 2 +- Whisky/Views/Settings/SettingsView.swift | 2 +- Whisky/Views/WhiskyApp.swift | 2 +- 9 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Whisky/Utils/Constants.swift b/Whisky/Utils/Constants.swift index d6b64c55d..32201e831 100644 --- a/Whisky/Utils/Constants.swift +++ b/Whisky/Utils/Constants.swift @@ -18,11 +18,8 @@ import Foundation -enum Constant { - // swiftlint:disable:next type_name - enum width { - static let small: Double = 400 - static let medium: Double = 500 - static let large: Double = 600 - } +enum ViewWidth { + static let small: Double = 400 + static let medium: Double = 500 + static let large: Double = 600 } diff --git a/Whisky/Views/Bottle/BottleCreationView.swift b/Whisky/Views/Bottle/BottleCreationView.swift index cc1996004..ea26a0f39 100644 --- a/Whisky/Views/Bottle/BottleCreationView.swift +++ b/Whisky/Views/Bottle/BottleCreationView.swift @@ -84,7 +84,7 @@ struct BottleCreationView: View { } } .fixedVerticalSize() - .frame(width: Constant.width.small) + .frame(width: ViewWidth.small) } func submit() { diff --git a/Whisky/Views/Bottle/ConfigView.swift b/Whisky/Views/Bottle/ConfigView.swift index f131d5da1..9edaa3d9a 100644 --- a/Whisky/Views/Bottle/ConfigView.swift +++ b/Whisky/Views/Bottle/ConfigView.swift @@ -301,7 +301,7 @@ struct DPIConfigSheetView: View { } } .padding() - .frame(width: Constant.width.medium, height: 240) + .frame(width: ViewWidth.medium, height: 240) } } diff --git a/Whisky/Views/Bottle/Pins/PinCreationView.swift b/Whisky/Views/Bottle/Pins/PinCreationView.swift index a6f0ef5bb..736da241c 100644 --- a/Whisky/Views/Bottle/Pins/PinCreationView.swift +++ b/Whisky/Views/Bottle/Pins/PinCreationView.swift @@ -94,7 +94,7 @@ struct PinCreationView: View { } } .fixedVerticalSize() - .frame(minWidth: Constant.width.small) + .frame(minWidth: ViewWidth.small) } func submit() { diff --git a/Whisky/Views/Bottle/WinetricksView.swift b/Whisky/Views/Bottle/WinetricksView.swift index 4bee01056..2f649be4b 100644 --- a/Whisky/Views/Bottle/WinetricksView.swift +++ b/Whisky/Views/Bottle/WinetricksView.swift @@ -84,6 +84,6 @@ struct WinetricksView: View { winetricks = await Winetricks.parseVerbs() } } - .frame(minWidth: Constant.width.large, minHeight: 400) + .frame(minWidth: ViewWidth.large, minHeight: 400) } } diff --git a/Whisky/Views/Common/RenameView.swift b/Whisky/Views/Common/RenameView.swift index 8bb7bfdc3..4a1f31608 100644 --- a/Whisky/Views/Common/RenameView.swift +++ b/Whisky/Views/Common/RenameView.swift @@ -58,7 +58,7 @@ struct RenameView: View { } } .fixedVerticalSize() - .frame(minWidth: Constant.width.small) + .frame(minWidth: ViewWidth.small) } var isNameValid: Bool { diff --git a/Whisky/Views/FileOpenView.swift b/Whisky/Views/FileOpenView.swift index e2783d807..bc791a77b 100644 --- a/Whisky/Views/FileOpenView.swift +++ b/Whisky/Views/FileOpenView.swift @@ -56,7 +56,7 @@ struct FileOpenView: View { } } .fixedVerticalSize() - .frame(width: Constant.width.small) + .frame(width: ViewWidth.small) .onAppear { // Makes sure there are more than 0 bottles. // Otherwise, it will crash on the nil cascade diff --git a/Whisky/Views/Settings/SettingsView.swift b/Whisky/Views/Settings/SettingsView.swift index 46581efb0..1e6abbe0f 100644 --- a/Whisky/Views/Settings/SettingsView.swift +++ b/Whisky/Views/Settings/SettingsView.swift @@ -54,7 +54,7 @@ struct SettingsView: View { } .formStyle(.grouped) .fixedVerticalSize() - .frame(width: Constant.width.medium) + .frame(width: ViewWidth.medium) } } diff --git a/Whisky/Views/WhiskyApp.swift b/Whisky/Views/WhiskyApp.swift index df971b3e7..ab4dd8a51 100644 --- a/Whisky/Views/WhiskyApp.swift +++ b/Whisky/Views/WhiskyApp.swift @@ -36,7 +36,7 @@ struct WhiskyApp: App { var body: some Scene { WindowGroup { ContentView(showSetup: $showSetup) - .frame(minWidth: Constant.width.large, minHeight: 316) + .frame(minWidth: ViewWidth.large, minHeight: 316) .environmentObject(BottleVM.shared) .onAppear { NSWindow.allowsAutomaticWindowTabbing = false From 1ba2386206751a29094ab8dc82cae4a1b9f93610 Mon Sep 17 00:00:00 2001 From: Ivan Zorin <6960799+zorikon@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:33:13 +0400 Subject: [PATCH 3/4] Remove unused function --- Whisky/Extensions/View+Extension.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Whisky/Extensions/View+Extension.swift b/Whisky/Extensions/View+Extension.swift index d471a6877..bba94e063 100644 --- a/Whisky/Extensions/View+Extension.swift +++ b/Whisky/Extensions/View+Extension.swift @@ -19,10 +19,6 @@ import SwiftUI extension View { - func fixedHorizontalSize() -> some View { - self.fixedSize(horizontal: true, vertical: false) - } - func fixedVerticalSize() -> some View { self.fixedSize(horizontal: false, vertical: true) } From 4d9221debb092f457d86515dd0aa4ddb19fb6284 Mon Sep 17 00:00:00 2001 From: Ivan Zorin <6960799+zorikon@users.noreply.github.com> Date: Fri, 12 Apr 2024 19:46:02 +0400 Subject: [PATCH 4/4] Remove extension --- Whisky.xcodeproj/project.pbxproj | 4 --- Whisky/Extensions/View+Extension.swift | 25 ------------------- Whisky/Views/Bottle/BottleCreationView.swift | 2 +- .../Views/Bottle/Pins/PinCreationView.swift | 2 +- Whisky/Views/Common/RenameView.swift | 2 +- Whisky/Views/FileOpenView.swift | 2 +- Whisky/Views/Settings/SettingsView.swift | 2 +- 7 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 Whisky/Extensions/View+Extension.swift diff --git a/Whisky.xcodeproj/project.pbxproj b/Whisky.xcodeproj/project.pbxproj index 6ad50f2ba..e2722564a 100644 --- a/Whisky.xcodeproj/project.pbxproj +++ b/Whisky.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 6365C4C32B1AA8CD00AAE1FD /* BottleListEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6365C4C22B1AA8CD00AAE1FD /* BottleListEntry.swift */; }; 63FFDE862ADF0C7700178665 /* BottomBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63FFDE852ADF0C7700178665 /* BottomBar.swift */; }; 6763D8F62BC6314100651D27 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6763D8F52BC6314100651D27 /* Constants.swift */; }; - 6763D8F82BC632A800651D27 /* View+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6763D8F72BC632A800651D27 /* View+Extension.swift */; }; 67D278512BC5907E006F9A1E /* ActionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67D278502BC5907E006F9A1E /* ActionView.swift */; }; 6E064B1229DD32A200D9A2D2 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 6E064B1129DD32A200D9A2D2 /* Sparkle */; }; 6E064B1429DD331F00D9A2D2 /* SparkleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E064B1329DD331F00D9A2D2 /* SparkleView.swift */; }; @@ -116,7 +115,6 @@ 6365C4C22B1AA8CD00AAE1FD /* BottleListEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottleListEntry.swift; sourceTree = ""; }; 63FFDE852ADF0C7700178665 /* BottomBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BottomBar.swift; sourceTree = ""; }; 6763D8F52BC6314100651D27 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; - 6763D8F72BC632A800651D27 /* View+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Extension.swift"; sourceTree = ""; }; 67D278502BC5907E006F9A1E /* ActionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionView.swift; sourceTree = ""; }; 6E064B1329DD331F00D9A2D2 /* SparkleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SparkleView.swift; sourceTree = ""; }; 6E17B6452AF3FDC100831173 /* PinView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinView.swift; sourceTree = ""; }; @@ -206,7 +204,6 @@ children = ( 6E40498229CCA91B006E3F1B /* Bottle+Extensions.swift */, 6365C4C02B1AA69D00AAE1FD /* Animation+Extensions.swift */, - 6763D8F72BC632A800651D27 /* View+Extension.swift */, ); path = Extensions; sourceTree = ""; @@ -600,7 +597,6 @@ 6E355E5829D78249002D83BE /* ConfigView.swift in Sources */, 63FFDE862ADF0C7700178665 /* BottomBar.swift in Sources */, 6E6C0CF62A419A8300356232 /* WhiskyWineDownloadView.swift in Sources */, - 6763D8F82BC632A800651D27 /* View+Extension.swift in Sources */, 6365C4C32B1AA8CD00AAE1FD /* BottleListEntry.swift in Sources */, 6E50D98529CDF25B008C39F6 /* BottleCreationView.swift in Sources */, 6E182FCA2B0BF64E00AADE81 /* WinetricksView.swift in Sources */, diff --git a/Whisky/Extensions/View+Extension.swift b/Whisky/Extensions/View+Extension.swift deleted file mode 100644 index bba94e063..000000000 --- a/Whisky/Extensions/View+Extension.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// View+Extension.swift -// Whisky -// -// This file is part of Whisky. -// -// Whisky is free software: you can redistribute it and/or modify it under the terms -// of the GNU General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Whisky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; -// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along with Whisky. -// If not, see https://www.gnu.org/licenses/. -// - -import SwiftUI - -extension View { - func fixedVerticalSize() -> some View { - self.fixedSize(horizontal: false, vertical: true) - } -} diff --git a/Whisky/Views/Bottle/BottleCreationView.swift b/Whisky/Views/Bottle/BottleCreationView.swift index ea26a0f39..d2f003efe 100644 --- a/Whisky/Views/Bottle/BottleCreationView.swift +++ b/Whisky/Views/Bottle/BottleCreationView.swift @@ -83,7 +83,7 @@ struct BottleCreationView: View { submit() } } - .fixedVerticalSize() + .fixedSize(horizontal: false, vertical: true) .frame(width: ViewWidth.small) } diff --git a/Whisky/Views/Bottle/Pins/PinCreationView.swift b/Whisky/Views/Bottle/Pins/PinCreationView.swift index 736da241c..2bd4c8ac0 100644 --- a/Whisky/Views/Bottle/Pins/PinCreationView.swift +++ b/Whisky/Views/Bottle/Pins/PinCreationView.swift @@ -93,7 +93,7 @@ struct PinCreationView: View { submit() } } - .fixedVerticalSize() + .fixedSize(horizontal: false, vertical: true) .frame(minWidth: ViewWidth.small) } diff --git a/Whisky/Views/Common/RenameView.swift b/Whisky/Views/Common/RenameView.swift index 4a1f31608..519db5800 100644 --- a/Whisky/Views/Common/RenameView.swift +++ b/Whisky/Views/Common/RenameView.swift @@ -57,7 +57,7 @@ struct RenameView: View { submit() } } - .fixedVerticalSize() + .fixedSize(horizontal: false, vertical: true) .frame(minWidth: ViewWidth.small) } diff --git a/Whisky/Views/FileOpenView.swift b/Whisky/Views/FileOpenView.swift index bc791a77b..a7ca4b0e8 100644 --- a/Whisky/Views/FileOpenView.swift +++ b/Whisky/Views/FileOpenView.swift @@ -55,7 +55,7 @@ struct FileOpenView: View { } } } - .fixedVerticalSize() + .fixedSize(horizontal: false, vertical: true) .frame(width: ViewWidth.small) .onAppear { // Makes sure there are more than 0 bottles. diff --git a/Whisky/Views/Settings/SettingsView.swift b/Whisky/Views/Settings/SettingsView.swift index 1e6abbe0f..70e687021 100644 --- a/Whisky/Views/Settings/SettingsView.swift +++ b/Whisky/Views/Settings/SettingsView.swift @@ -53,7 +53,7 @@ struct SettingsView: View { } } .formStyle(.grouped) - .fixedVerticalSize() + .fixedSize(horizontal: false, vertical: true) .frame(width: ViewWidth.medium) } }