diff --git a/Whisky.xcodeproj/project.pbxproj b/Whisky.xcodeproj/project.pbxproj index f7f2febe..e2722564 100644 --- a/Whisky.xcodeproj/project.pbxproj +++ b/Whisky.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 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 */; }; 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 +114,7 @@ 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 = ""; }; 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 = ""; }; @@ -347,6 +349,7 @@ 6E621CEE2A5F631200C9AAB3 /* Winetricks.swift */, 6E70A4A02A9A280C007799E9 /* WhiskyCmd.swift */, 6E7C07BD2AAE7B0100F6E66B /* ProgramShortcut.swift */, + 6763D8F52BC6314100651D27 /* Constants.swift */, ); path = Utils; sourceTree = ""; @@ -583,6 +586,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 */, diff --git a/Whisky/Utils/Constants.swift b/Whisky/Utils/Constants.swift new file mode 100644 index 00000000..32201e83 --- /dev/null +++ b/Whisky/Utils/Constants.swift @@ -0,0 +1,25 @@ +// +// 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 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 f98fa308..d2f003ef 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) + .fixedSize(horizontal: false, vertical: true) + .frame(width: ViewWidth.small) } func submit() { diff --git a/Whisky/Views/Bottle/ConfigView.swift b/Whisky/Views/Bottle/ConfigView.swift index 7ad3e8a9..9edaa3d9 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: ViewWidth.medium, height: 240) } } diff --git a/Whisky/Views/Bottle/Pins/PinCreationView.swift b/Whisky/Views/Bottle/Pins/PinCreationView.swift index 175ed18a..2bd4c8ac 100644 --- a/Whisky/Views/Bottle/Pins/PinCreationView.swift +++ b/Whisky/Views/Bottle/Pins/PinCreationView.swift @@ -94,7 +94,7 @@ struct PinCreationView: View { } } .fixedSize(horizontal: false, vertical: true) - .frame(minWidth: 400) + .frame(minWidth: ViewWidth.small) } func submit() { diff --git a/Whisky/Views/Bottle/WinetricksView.swift b/Whisky/Views/Bottle/WinetricksView.swift index e06e347d..2f649be4 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: ViewWidth.large, minHeight: 400) } } diff --git a/Whisky/Views/Common/RenameView.swift b/Whisky/Views/Common/RenameView.swift index 55c9a81d..519db580 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) + .fixedSize(horizontal: false, vertical: true) + .frame(minWidth: ViewWidth.small) } var isNameValid: Bool { diff --git a/Whisky/Views/FileOpenView.swift b/Whisky/Views/FileOpenView.swift index a9f5f825..a7ca4b0e 100644 --- a/Whisky/Views/FileOpenView.swift +++ b/Whisky/Views/FileOpenView.swift @@ -55,7 +55,8 @@ struct FileOpenView: View { } } } - .frame(minWidth: 400, minHeight: 115) + .fixedSize(horizontal: false, vertical: true) + .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 6cac55f5..70e68702 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) + .fixedSize(horizontal: false, vertical: true) + .frame(width: ViewWidth.medium) } } diff --git a/Whisky/Views/WhiskyApp.swift b/Whisky/Views/WhiskyApp.swift index bfe46007..ab4dd8a5 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: ViewWidth.large, minHeight: 316) .environmentObject(BottleVM.shared) .onAppear { NSWindow.allowsAutomaticWindowTabbing = false