Deprecate frame(maxSize:) on views
This commit is contained in:
parent
b7aabb0966
commit
7ff56613e5
3
.gitignore
vendored
3
.gitignore
vendored
@ -10,4 +10,5 @@ DerivedData/
|
||||
/Package.resolved
|
||||
.Ulysses-Group.plist
|
||||
/.docc-build
|
||||
/io.github.AparokshaUI.Generation.json
|
||||
/io.github.AparokshaUI.Generation.json
|
||||
/.vscode
|
||||
52
.vscode/launch.json
vendored
52
.vscode/launch.json
vendored
@ -1,52 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"sourceLanguages": [
|
||||
"swift"
|
||||
],
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder:adwaita-swift}",
|
||||
"name": "Debug Generation",
|
||||
"program": "${workspaceFolder:adwaita-swift}/.build/debug/Generation",
|
||||
"preLaunchTask": "swift: Build Debug Generation"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"sourceLanguages": [
|
||||
"swift"
|
||||
],
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder:adwaita-swift}",
|
||||
"name": "Release Generation",
|
||||
"program": "${workspaceFolder:adwaita-swift}/.build/release/Generation",
|
||||
"preLaunchTask": "swift: Build Release Generation"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"sourceLanguages": [
|
||||
"swift"
|
||||
],
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder:adwaita-swift}",
|
||||
"name": "Debug Demo",
|
||||
"program": "${workspaceFolder:adwaita-swift}/.build/debug/Demo",
|
||||
"preLaunchTask": "swift: Build Debug Demo"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"sourceLanguages": [
|
||||
"swift"
|
||||
],
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder:adwaita-swift}",
|
||||
"name": "Release Demo",
|
||||
"program": "${workspaceFolder:adwaita-swift}/.build/release/Demo",
|
||||
"preLaunchTask": "swift: Build Release Demo"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -27,6 +27,7 @@ extension View {
|
||||
/// Set the view's maximum width.
|
||||
/// - Parameter maxSize: The maximum width.
|
||||
/// - Returns: A view.
|
||||
@available(*, deprecated, message: "Use frame(maxWidth:) on views instead")
|
||||
public func frame(maxSize: Int? = nil) -> Clamp {
|
||||
frame(maxWidth: maxSize)
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ struct AlertDialogDemo: View {
|
||||
dialog = true
|
||||
}
|
||||
.style("pill")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
.padding()
|
||||
}
|
||||
.alertDialog(visible: $dialog, heading: "Alert Dialog", body: "This is an alert dialog")
|
||||
|
||||
@ -36,7 +36,7 @@ struct CarouselDemo: View {
|
||||
.onClick { print(element.id) }
|
||||
.padding(20)
|
||||
.frame(minWidth: 300, minHeight: 200)
|
||||
.frame(maxSize: 500)
|
||||
.frame(maxWidth: 500)
|
||||
}
|
||||
.longSwipes()
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ struct DialogDemo: View {
|
||||
dialog = true
|
||||
}
|
||||
.style("pill")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
.padding()
|
||||
}
|
||||
.dialog(visible: $dialog, title: "Counter", width: width, height: height) {
|
||||
|
||||
@ -28,7 +28,7 @@ struct DiceDemo: View {
|
||||
}
|
||||
.style("pill")
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
.valign(.center)
|
||||
.padding()
|
||||
|
||||
@ -19,7 +19,7 @@ struct FormDemo: View {
|
||||
app.showWindow("form-demo")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ struct FormDemo: View {
|
||||
})
|
||||
}
|
||||
.padding()
|
||||
.frame(maxSize: 400)
|
||||
.frame(maxWidth: 400)
|
||||
}
|
||||
.topToolbar {
|
||||
HeaderBar.empty()
|
||||
|
||||
@ -19,7 +19,7 @@ struct NavigationViewDemo: View {
|
||||
app.showWindow("navigation")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ struct PopoverDemo: View {
|
||||
visible = true
|
||||
}
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
.popover(visible: $visible) {
|
||||
CounterDemo()
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ struct ToastDemo: View {
|
||||
toast.signal()
|
||||
}
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ struct ToolbarDemo: View {
|
||||
app.showWindow("toolbar-demo")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ struct ToolbarDemo: View {
|
||||
visible.toggle()
|
||||
}
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
.padding(15)
|
||||
}
|
||||
.valign(.center)
|
||||
|
||||
@ -27,14 +27,14 @@ struct TransitionDemo: View {
|
||||
}
|
||||
.modifyContent(Text.self) { $0.style("title-2").padding() }
|
||||
.style("card")
|
||||
.frame(maxSize: 200)
|
||||
.frame(maxWidth: 200)
|
||||
.padding()
|
||||
Button("Toggle View") {
|
||||
firstView.toggle()
|
||||
}
|
||||
.style("pill")
|
||||
.padding()
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ struct ViewSwitcherDemo: View {
|
||||
app.showWindow("switcher-demo")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ struct WindowsDemo: View {
|
||||
.style("linked")
|
||||
.padding()
|
||||
}
|
||||
.frame(maxSize: 100)
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
|
||||
struct WindowContent: View {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user