Просмотр исходного кода

enhance(ux): tabbar show unfilled icon when unselected

Tienson Qin 3 месяцев назад
Родитель
Сommit
0682ef0fcb
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      ios/App/App/LiquidTabsRootView.swift

+ 5 - 2
ios/App/App/LiquidTabsRootView.swift

@@ -179,14 +179,17 @@ private struct LiquidTabs26View: View {
                     ForEach(Array(store.tabs.prefix(maxMainTabs).enumerated()),
                             id: \.element.id) { index, tab in
                         Tab(
-                            tab.title,
-                            systemImage: tab.systemImage,
                             value: LiquidTabsTabSelection.content(index)
                         ) {
                             NativeNavHost(navController: navController)
                                 .ignoresSafeArea()
                                 .background(Color.logseqBackground)
                         }
+                        label: {
+                            let isSelected = selectedTab == .content(index)
+                            Label(tab.title, systemImage: tab.systemImage)
+                              .environment(\.symbolVariants, isSelected ? .fill : .none)
+                        }
                     }
 
                     // Search Tab