~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

The iOS app's home avatar fills its button

Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:ios/home-avatar
ios/Knotless/Support/Theme.swift+5−0
@@ -68,6 +68,11 @@ enum Size {
static let medium: CGFloat = 32
static let large: CGFloat = 44
static let xlarge: CGFloat = 64
/// One that is a toolbar's button: as big as iOS 26's round ones, and in
/// earlier toolbars, which draw none, as an icon's room.
static var toolbar: CGFloat {
if #available(iOS 26, *) { large } else { medium }
}
}
/// The least height of a row that opens a screen.
ios/Knotless/Views/HomeView.swift+15−1
@@ -101,10 +101,13 @@ private struct HomeScreen: View {
.toolbar {
ToolbarItem(placement: .topBarLeading) {
NavigationLink(value: Route.profile(person.handle)) {
Avatar(url: person.avatar, name: person.handle, did: person.did, size: Size.Avatar.medium)
Avatar(url: person.avatar, name: person.handle, did: person.did, size: Size.Avatar.toolbar)
// A pattern is faint, so the button's shape needs this behind it.
.background(Color(.secondarySystemGroupedBackground), in: Circle())
}
.accessibilityLabel("Your profile")
}
.withoutGlass()
ToolbarItemGroup(placement: .topBarTrailing) {
Button { writing = true } label: { Oct(name: "plus", size: Icon.xxl) }.tint(.primary).accessibilityLabel("New issue")
NavigationLink(value: Route.search) { Oct(name: "search", size: Icon.xxl) }.tint(.primary).accessibilityLabel("Search")
@@ -127,6 +130,17 @@ private struct HomeScreen: View {
}
}
private extension ToolbarContent {
/// Takes away the glass iOS 26 puts round a toolbar item, for one that fills its place.
@ToolbarContentBuilder func withoutGlass() -> some ToolbarContent {
if #available(iOS 26, *) {
sharedBackgroundVisibility(.hidden)
} else {
self
}
}
}
private struct Heading<Trailing: View>: View {
let title: String
@ViewBuilder let trailing: Trailing