Skip to content

Commit

Permalink
Remove VM name from main window title utmapp#3099
Browse files Browse the repository at this point in the history
  • Loading branch information
conath committed Sep 20, 2021
1 parent 8443531 commit 0ab2ba6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Platform/Shared/VMDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct VMDetailsView: View {
}.padding([.leading, .trailing, .bottom])
}
}.labelStyle(DetailsLabelStyle())
.navigationTitle(vm.configuration.name)
.modifier(VMOptionalNavigationTitleModifier(vm: vm))
.modifier(VMToolbarModifier(vm: vm, bottom: !regularScreenSizeClass))
.sheet(isPresented: $data.showSettingsModal) {
VMSettingsView(vm: vm, config: vm.configuration)
Expand All @@ -87,6 +87,19 @@ struct VMDetailsView: View {
}
}

/// Returns just the content under macOS but adds the title on iOS. #3099
private struct VMOptionalNavigationTitleModifier: ViewModifier {
let vm: UTMVirtualMachine

func body(content: Content) -> some View {
#if os(macOS)
return content
#else
return content.navigationTitle(vm.configuration.name)
#endif
}
}

@available(iOS 14, macOS 11, *)
struct Screenshot: View {
let vm: UTMVirtualMachine
Expand Down

0 comments on commit 0ab2ba6

Please sign in to comment.