Fill tab only if selected

This commit is contained in:
Thomas Ricouard 2024-01-10 08:56:35 +01:00
parent b6c3b07ad6
commit 6246d7b0a5
2 changed files with 2 additions and 0 deletions

View file

@ -72,6 +72,7 @@ struct AppView: View {
.tabItem { .tabItem {
if userPreferences.showiPhoneTabLabel { if userPreferences.showiPhoneTabLabel {
tab.label tab.label
.environment(\.symbolVariants, tab == selectedTab ? .fill : .none)
} else { } else {
Image(systemName: tab.iconName) Image(systemName: tab.iconName)
} }

View file

@ -182,6 +182,7 @@ private struct SideBarIcon: View {
.font(.title2) .font(.title2)
.fontWeight(.medium) .fontWeight(.medium)
.foregroundColor(isSelected ? theme.tintColor : theme.labelColor) .foregroundColor(isSelected ? theme.tintColor : theme.labelColor)
.symbolVariant(isSelected ? .fill : .none)
.scaleEffect(isHovered ? 0.8 : 1.0) .scaleEffect(isHovered ? 0.8 : 1.0)
.onHover { isHovered in .onHover { isHovered in
withAnimation(.interpolatingSpring(stiffness: 300, damping: 15)) { withAnimation(.interpolatingSpring(stiffness: 300, damping: 15)) {