Skip to content

Commit

Permalink
Add access to info as KVS in ImageViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Sep 3, 2024
1 parent 1b930b2 commit 8ef7d99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions Sources/PulseUI/Views/ImageViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ImageViewer: View {
.border(Color.separator, width: 0.5)

HStack {
TextView(string: viewModel.info)
TextView(string: TextRenderer().render(viewModel.info))
Spacer()
}

Expand All @@ -28,7 +28,7 @@ struct ImageViewer: View {

struct ImagePreviewViewModel {
let image: UXImage
let info: NSAttributedString
let info: KeyValueSectionViewModel

init(image: UXImage, data: Data, context: FileViewerViewModelContext) {
func intValue(for key: String) -> Int? {
Expand Down Expand Up @@ -66,7 +66,6 @@ struct ImagePreviewViewModel {
}

self.image = image
let section = KeyValueSectionViewModel(title: "Image", color: .pink, items: info)
self.info = TextRenderer().render(section)
self.info = KeyValueSectionViewModel(title: "Image", color: .pink, items: info)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct NetworkInspectorTransferInfoView: View {
}
.frame(maxWidth: .infinity)
}
#elseif os(macOS)
#else
var body: some View {
HStack {
Spacer()
Expand Down

0 comments on commit 8ef7d99

Please sign in to comment.