VisionOS fixes

This commit is contained in:
Thomas Ricouard 2024-01-16 18:43:09 +01:00
parent a4927fd30c
commit 0dea624060
4 changed files with 40 additions and 31 deletions

View file

@ -68,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/kean/Nuke",
"state" : {
"revision" : "1694798e876113d44f6ec6ead965d7286695981d",
"version" : "12.2.0"
"revision" : "15fde63470d782c897816a74bdd516a907e33147",
"version" : "12.3.0"
}
},
{

View file

@ -43,8 +43,9 @@ struct SideBarView<Content: View>: View {
makeBadgeView(count: badge)
}
}
.contentShape(Rectangle())
.frame(width: .sidebarWidth, height: 50)
.frame(width: .sidebarWidth - 24, height: 50)
.background(tab == selectedTab ? theme.secondaryBackgroundColor : .clear,
in: RoundedRectangle(cornerRadius: 8))
}
private func makeBadgeView(count: Int) -> some View {
@ -131,7 +132,6 @@ struct SideBarView<Content: View>: View {
} label: {
makeIconForTab(tab: tab)
}
.background(tab == selectedTab ? theme.secondaryBackgroundColor : .clear)
}
}
}
@ -153,14 +153,19 @@ struct SideBarView<Content: View>: View {
}
}
}
postButton
.padding(.top, 12)
Spacer()
}
}
.frame(width: .sidebarWidth)
.scrollContentBackground(.hidden)
.background(.thinMaterial)
.safeAreaInset(edge: .bottom, content: {
HStack {
postButton
.padding(.vertical, 24)
}
.frame(width: .sidebarWidth)
.background(.thinMaterial)
})
Divider().edgesIgnoringSafeArea(.all)
}
content()

View file

@ -29,31 +29,31 @@ extension StatusEditor {
var body: some View {
@Bindable var viewModel = focusedSEVM
VStack(spacing: 0) {
#if os(visionOS)
HStack {
contentView
}
.frame(height: 24)
.padding(16)
.background(.thickMaterial)
.cornerRadius(8)
#else
Divider()
HStack {
contentView
}
.frame(height: 20)
.padding(.vertical, 12)
.background(.thinMaterial)
#endif
#if os(visionOS)
HStack {
contentView
.buttonStyle(.borderless)
}
.frame(width: 32)
.padding(16)
.glassBackgroundEffect()
.cornerRadius(8)
.padding(.trailing, 78)
#else
Divider()
HStack {
contentView
}
.frame(height: 20)
.padding(.vertical, 12)
.background(.thinMaterial)
#endif
}
@ViewBuilder
private var contentView: some View {
#if os(visionOS)
HStack(spacing: 8) {
VStack(spacing: 8) {
actionsView
}
#else

View file

@ -85,13 +85,17 @@ extension StatusEditor {
AutoCompleteView(viewModel: focusedSEVM)
}
#if os(visionOS)
.ornament(attachmentAnchor: .scene(.bottom)) {
AccessoryView(isSpoilerTextFocused: $isSpoilerTextFocused, focusedSEVM: focusedSEVM, followUpSEVMs: $followUpSEVMs)
}
.ornament(attachmentAnchor: .scene(.leading)) {
AccessoryView(isSpoilerTextFocused: $isSpoilerTextFocused,
focusedSEVM: focusedSEVM,
followUpSEVMs: $followUpSEVMs)
}
#else
.safeAreaInset(edge: .bottom) {
if presentationDetent == .large || presentationDetent == .medium {
AccessoryView(isSpoilerTextFocused: $isSpoilerTextFocused, focusedSEVM: focusedSEVM, followUpSEVMs: $followUpSEVMs)
AccessoryView(isSpoilerTextFocused: $isSpoilerTextFocused,
focusedSEVM: focusedSEVM,
followUpSEVMs: $followUpSEVMs)
}
}
#endif