Add option to hide the scroll indicators
This commit is contained in:
parent
f28e425f71
commit
ebd3797d78
@ -14,6 +14,8 @@ public struct ScrollView: SwiftUIWidget {
|
||||
var axes: Set<Axis>
|
||||
/// The view's content.
|
||||
var content: Body
|
||||
/// Whether to hide the scroll indicators.
|
||||
var hideScrollIndicators = false
|
||||
|
||||
/// The wrapped views.
|
||||
public var wrappedViews: [String: any Meta.AnyView] {
|
||||
@ -34,6 +36,14 @@ public struct ScrollView: SwiftUIWidget {
|
||||
SwiftUI.ScrollView(properties.axes.swiftUI) {
|
||||
MacBackendView(.mainContent)
|
||||
}
|
||||
.scrollIndicators(properties.hideScrollIndicators ? .hidden : .automatic)
|
||||
}
|
||||
|
||||
/// Whether to hide the scroll indicators.
|
||||
/// - Parameter enabled: Whether the scroll indicators are hidden.
|
||||
/// - Returns: The scroll view.
|
||||
public func hideScrollIndicators(_ enabled: Bool = true) -> Self {
|
||||
modify { $0.hideScrollIndicators = enabled }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user