Skip to content

Commit

Permalink
VisionOS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Jan 16, 2024
1 parent a4927fd commit 0dea624
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down
17 changes: 11 additions & 6 deletions IceCubesApp/App/SideBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -131,7 +132,6 @@ struct SideBarView<Content: View>: View {
} label: {
makeIconForTab(tab: tab)
}
.background(tab == selectedTab ? theme.secondaryBackgroundColor : .clear)
}
}
}
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions Packages/StatusKit/Sources/StatusKit/Editor/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0dea624

Please sign in to comment.