Skip to content

Commit

Permalink
Deprecate frame(maxSize:) on views
Browse files Browse the repository at this point in the history
  • Loading branch information
david-swift committed Apr 21, 2024
1 parent b7aabb0 commit 7ff5661
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 68 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ DerivedData/
/Package.resolved
.Ulysses-Group.plist
/.docc-build
/io.github.AparokshaUI.Generation.json
/io.github.AparokshaUI.Generation.json
/.vscode
52 changes: 0 additions & 52 deletions .vscode/launch.json

This file was deleted.

1 change: 1 addition & 0 deletions Sources/Adwaita/View/Modifiers/Clamp+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/AlertDialogDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion Tests/CarouselDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/DialogDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/DiceDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct DiceDemo: View {
}
.style("pill")
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
}
.valign(.center)
.padding()
Expand Down
4 changes: 2 additions & 2 deletions Tests/FormDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct FormDemo: View {
app.showWindow("form-demo")
}
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
}
}

Expand Down Expand Up @@ -62,7 +62,7 @@ struct FormDemo: View {
})
}
.padding()
.frame(maxSize: 400)
.frame(maxWidth: 400)
}
.topToolbar {
HeaderBar.empty()
Expand Down
2 changes: 1 addition & 1 deletion Tests/NavigationViewDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct NavigationViewDemo: View {
app.showWindow("navigation")
}
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
.padding()
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/PopoverDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct PopoverDemo: View {
visible = true
}
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
.popover(visible: $visible) {
CounterDemo()
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/ToastDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct ToastDemo: View {
toast.signal()
}
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/ToolbarDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct ToolbarDemo: View {
app.showWindow("toolbar-demo")
}
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
}
}

Expand All @@ -34,7 +34,7 @@ struct ToolbarDemo: View {
visible.toggle()
}
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
.padding(15)
}
.valign(.center)
Expand Down
4 changes: 2 additions & 2 deletions Tests/TransitionDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}
Expand Down
2 changes: 1 addition & 1 deletion Tests/ViewSwitcherDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct ViewSwitcherDemo: View {
app.showWindow("switcher-demo")
}
.style("suggested-action")
.frame(maxSize: 100)
.frame(maxWidth: 100)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/WindowsDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct WindowsDemo: View {
.style("linked")
.padding()
}
.frame(maxSize: 100)
.frame(maxWidth: 100)
}

struct WindowContent: View {
Expand Down

0 comments on commit 7ff5661

Please sign in to comment.