mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-15 18:59:18 +01:00
34 lines
608 B
Swift
34 lines
608 B
Swift
|
//
|
||
|
// SidebarListStyleModifier.swift
|
||
|
// NetNewsWire
|
||
|
//
|
||
|
// Created by Maurice Parker on 7/6/20.
|
||
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import SwiftUI
|
||
|
|
||
|
struct SidebarListStyleModifier: ViewModifier {
|
||
|
|
||
|
#if os(iOS)
|
||
|
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||
|
#endif
|
||
|
|
||
|
@ViewBuilder func body(content: Content) -> some View {
|
||
|
#if os(macOS)
|
||
|
content
|
||
|
.listStyle(SidebarListStyle())
|
||
|
#else
|
||
|
if horizontalSizeClass == .compact {
|
||
|
content
|
||
|
.listStyle(PlainListStyle())
|
||
|
} else {
|
||
|
content
|
||
|
.listStyle(SidebarListStyle())
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|