|
|
@@ -198,8 +198,7 @@ private struct HoverCardModifier: ViewModifier {
|
|
|
|
|
|
private struct SidebarRowHoverModifier: ViewModifier {
|
|
|
let isSelected: Bool
|
|
|
- let showsCardBackground: Bool
|
|
|
- let selectedBorderColor: Color
|
|
|
+ var selectedBorderColor: Color = AppTheme.accentPurple.opacity(0.4)
|
|
|
@State private var isHovered = false
|
|
|
|
|
|
func body(content: Content) -> some View {
|
|
|
@@ -211,16 +210,13 @@ private struct SidebarRowHoverModifier: ViewModifier {
|
|
|
|
|
|
@ViewBuilder
|
|
|
private var sidebarRowBackground: some View {
|
|
|
- if showsCardBackground && isSelected {
|
|
|
+ if isSelected {
|
|
|
RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
|
|
|
.fill(AppTheme.quickAccessBackground)
|
|
|
.overlay(
|
|
|
RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
|
|
|
.stroke(selectedBorderColor, lineWidth: 1)
|
|
|
)
|
|
|
- } else if isSelected {
|
|
|
- RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
|
|
|
- .fill(AppTheme.selectedRowFill)
|
|
|
} else if isHovered {
|
|
|
RoundedRectangle(cornerRadius: AppTheme.cornerRadiusSmall)
|
|
|
.fill(AppTheme.hoverFill)
|
|
|
@@ -245,13 +241,11 @@ extension View {
|
|
|
|
|
|
func sidebarRowHover(
|
|
|
isSelected: Bool,
|
|
|
- showsCardBackground: Bool = false,
|
|
|
- selectedBorderColor: Color = .clear
|
|
|
+ selectedBorderColor: Color = AppTheme.accentPurple.opacity(0.4)
|
|
|
) -> some View {
|
|
|
modifier(
|
|
|
SidebarRowHoverModifier(
|
|
|
isSelected: isSelected,
|
|
|
- showsCardBackground: showsCardBackground,
|
|
|
selectedBorderColor: selectedBorderColor
|
|
|
)
|
|
|
)
|