Ferrite-backup/Ferrite/Extensions/View.swift
kingbri eacccf36ff Search: Add ExpandedSearchable replacement
ExpandedSearchable opens up the capabilities of the SwiftUI searchable
modifier and allows for additions of more properties such as custom
scope bars.

Since this is a reimplementation of UISearchController, changes
to SwiftUI should not affect search bars that rely on the scope bar
to always be present.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-09 00:12:40 -04:00

35 lines
998 B
Swift

//
// View.swift
// Ferrite
//
// Created by Brian Dashore on 8/15/22.
//
import Introspect
import SwiftUI
extension View {
// MARK: Modifiers
func conditionalContextMenu(id: some Hashable,
@ViewBuilder _ internalContent: @escaping () -> some View) -> some View
{
modifier(ConditionalContextMenuModifier(internalContent, id: id))
}
func conditionalId(_ id: some Hashable) -> some View {
modifier(ConditionalIdModifier(id: id))
}
func disabledAppearance(_ disabled: Bool, dimmedOpacity: Double? = nil, animation: Animation? = nil) -> some View {
modifier(DisabledAppearanceModifier(disabled: disabled, dimmedOpacity: dimmedOpacity, animation: animation))
}
func disableInteraction(_ disabled: Bool) -> some View {
modifier(DisableInteractionModifier(disabled: disabled))
}
func inlinedList(inset: CGFloat) -> some View {
modifier(InlinedListModifier(inset: inset))
}
}