mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-08 15:35:21 +01:00
4d227e7e2c
- [x] Account Inspector should have an Active toggle (see iOS) - [x] Feed Inspector Home Page should open the link in browser when tapped - [x] Feed Inspector Home Page should have a browser icon (see iOS) - [x] Feed Inspector Home Page URL should line wrap - [x] Feed Inspector Feed URL should be copiable (currently this is a long press on iOS) - [x] Feed Inspector Feed URL should line wrap - [x] Inspector should use inset style on iOS
48 lines
885 B
Swift
48 lines
885 B
Swift
//
|
|
// InspectorPlatformModifier.swift
|
|
// NetNewsWire
|
|
//
|
|
// Created by Stuart Breckenridge on 18/7/20.
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct InspectorPlatformModifier: ViewModifier {
|
|
|
|
@Environment(\.presentationMode) var presentationMode
|
|
@Binding var shouldUpdate: Bool
|
|
|
|
@ViewBuilder func body(content: Content) -> some View {
|
|
|
|
#if os(macOS)
|
|
Form {
|
|
content
|
|
}
|
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
|
.frame(width: 300)
|
|
.padding()
|
|
#else
|
|
NavigationView {
|
|
List {
|
|
content
|
|
}
|
|
.listStyle(InsetGroupedListStyle())
|
|
.navigationBarTitle("Inspector", displayMode: .inline)
|
|
.navigationBarItems(
|
|
leading:
|
|
Button("Cancel", action: {
|
|
presentationMode.wrappedValue.dismiss()
|
|
}),
|
|
trailing:
|
|
Button("Done", action: {
|
|
shouldUpdate = true
|
|
})
|
|
)
|
|
}
|
|
#endif
|
|
}
|
|
|
|
|
|
}
|