forked from aparoksha/adwaita-swift
Deprecate frame(maxSize:) on views
This commit is contained in:
parent
b7aabb0966
commit
7ff56613e5
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@ DerivedData/
|
|||||||
.Ulysses-Group.plist
|
.Ulysses-Group.plist
|
||||||
/.docc-build
|
/.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.
|
/// Set the view's maximum width.
|
||||||
/// - Parameter maxSize: The maximum width.
|
/// - Parameter maxSize: The maximum width.
|
||||||
/// - Returns: A view.
|
/// - Returns: A view.
|
||||||
|
@available(*, deprecated, message: "Use frame(maxWidth:) on views instead")
|
||||||
public func frame(maxSize: Int? = nil) -> Clamp {
|
public func frame(maxSize: Int? = nil) -> Clamp {
|
||||||
frame(maxWidth: maxSize)
|
frame(maxWidth: maxSize)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ struct AlertDialogDemo: View {
|
|||||||
dialog = true
|
dialog = true
|
||||||
}
|
}
|
||||||
.style("pill")
|
.style("pill")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
.alertDialog(visible: $dialog, heading: "Alert Dialog", body: "This is an alert dialog")
|
.alertDialog(visible: $dialog, heading: "Alert Dialog", body: "This is an alert dialog")
|
||||||
|
|||||||
@ -36,7 +36,7 @@ struct CarouselDemo: View {
|
|||||||
.onClick { print(element.id) }
|
.onClick { print(element.id) }
|
||||||
.padding(20)
|
.padding(20)
|
||||||
.frame(minWidth: 300, minHeight: 200)
|
.frame(minWidth: 300, minHeight: 200)
|
||||||
.frame(maxSize: 500)
|
.frame(maxWidth: 500)
|
||||||
}
|
}
|
||||||
.longSwipes()
|
.longSwipes()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ struct DialogDemo: View {
|
|||||||
dialog = true
|
dialog = true
|
||||||
}
|
}
|
||||||
.style("pill")
|
.style("pill")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
.dialog(visible: $dialog, title: "Counter", width: width, height: height) {
|
.dialog(visible: $dialog, title: "Counter", width: width, height: height) {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ struct DiceDemo: View {
|
|||||||
}
|
}
|
||||||
.style("pill")
|
.style("pill")
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
}
|
}
|
||||||
.valign(.center)
|
.valign(.center)
|
||||||
.padding()
|
.padding()
|
||||||
|
|||||||
@ -19,7 +19,7 @@ struct FormDemo: View {
|
|||||||
app.showWindow("form-demo")
|
app.showWindow("form-demo")
|
||||||
}
|
}
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ struct FormDemo: View {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
.frame(maxSize: 400)
|
.frame(maxWidth: 400)
|
||||||
}
|
}
|
||||||
.topToolbar {
|
.topToolbar {
|
||||||
HeaderBar.empty()
|
HeaderBar.empty()
|
||||||
|
|||||||
@ -19,7 +19,7 @@ struct NavigationViewDemo: View {
|
|||||||
app.showWindow("navigation")
|
app.showWindow("navigation")
|
||||||
}
|
}
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ struct PopoverDemo: View {
|
|||||||
visible = true
|
visible = true
|
||||||
}
|
}
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
.popover(visible: $visible) {
|
.popover(visible: $visible) {
|
||||||
CounterDemo()
|
CounterDemo()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ struct ToastDemo: View {
|
|||||||
toast.signal()
|
toast.signal()
|
||||||
}
|
}
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ struct ToolbarDemo: View {
|
|||||||
app.showWindow("toolbar-demo")
|
app.showWindow("toolbar-demo")
|
||||||
}
|
}
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ struct ToolbarDemo: View {
|
|||||||
visible.toggle()
|
visible.toggle()
|
||||||
}
|
}
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
.padding(15)
|
.padding(15)
|
||||||
}
|
}
|
||||||
.valign(.center)
|
.valign(.center)
|
||||||
|
|||||||
@ -27,14 +27,14 @@ struct TransitionDemo: View {
|
|||||||
}
|
}
|
||||||
.modifyContent(Text.self) { $0.style("title-2").padding() }
|
.modifyContent(Text.self) { $0.style("title-2").padding() }
|
||||||
.style("card")
|
.style("card")
|
||||||
.frame(maxSize: 200)
|
.frame(maxWidth: 200)
|
||||||
.padding()
|
.padding()
|
||||||
Button("Toggle View") {
|
Button("Toggle View") {
|
||||||
firstView.toggle()
|
firstView.toggle()
|
||||||
}
|
}
|
||||||
.style("pill")
|
.style("pill")
|
||||||
.padding()
|
.padding()
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ struct ViewSwitcherDemo: View {
|
|||||||
app.showWindow("switcher-demo")
|
app.showWindow("switcher-demo")
|
||||||
}
|
}
|
||||||
.style("suggested-action")
|
.style("suggested-action")
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ struct WindowsDemo: View {
|
|||||||
.style("linked")
|
.style("linked")
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
.frame(maxSize: 100)
|
.frame(maxWidth: 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct WindowContent: View {
|
struct WindowContent: View {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user