mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-07 05:22:34 +00:00
More wip
This commit is contained in:
parent
da0f87be8e
commit
5c81c9e691
9 changed files with 50 additions and 55 deletions
|
@ -156,49 +156,53 @@ struct IceCubesApp: App {
|
|||
}
|
||||
|
||||
private var tabBarView: some View {
|
||||
TabView(selection: .init(get: {
|
||||
selectedTab
|
||||
}, set: { newTab in
|
||||
if newTab == selectedTab {
|
||||
/// Stupid hack to trigger onChange binding in tab views.
|
||||
popToRootTab = .other
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
|
||||
popToRootTab = selectedTab
|
||||
}
|
||||
}
|
||||
|
||||
HapticManager.shared.fireHaptic(of: .tabSelection)
|
||||
SoundEffectManager.shared.playSound(of: .tabSelection)
|
||||
|
||||
selectedTab = newTab
|
||||
|
||||
DispatchQueue.main.async {
|
||||
if selectedTab == .notifications,
|
||||
let token = appAccountsManager.currentAccount.oauthToken
|
||||
{
|
||||
userPreferences.setNotification(count: 0, token: token)
|
||||
watcher.unreadNotificationsCount = 0
|
||||
}
|
||||
}
|
||||
|
||||
})) {
|
||||
ForEach(availableTabs) { tab in
|
||||
tab.makeContentView(popToRootTab: $popToRootTab)
|
||||
.tabItem {
|
||||
if userPreferences.showiPhoneTabLabel {
|
||||
tab.label
|
||||
.labelStyle(TitleAndIconLabelStyle())
|
||||
} else {
|
||||
tab.label
|
||||
.labelStyle(IconOnlyLabelStyle())
|
||||
}
|
||||
HStack(spacing: 0) {
|
||||
TabView(selection: .init(get: {
|
||||
selectedTab
|
||||
}, set: { newTab in
|
||||
if newTab == selectedTab {
|
||||
/// Stupid hack to trigger onChange binding in tab views.
|
||||
popToRootTab = .other
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
|
||||
popToRootTab = selectedTab
|
||||
}
|
||||
.tag(tab)
|
||||
.badge(badgeFor(tab: tab))
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .tabBar)
|
||||
}
|
||||
|
||||
HapticManager.shared.fireHaptic(of: .tabSelection)
|
||||
SoundEffectManager.shared.playSound(of: .tabSelection)
|
||||
|
||||
selectedTab = newTab
|
||||
|
||||
DispatchQueue.main.async {
|
||||
if selectedTab == .notifications,
|
||||
let token = appAccountsManager.currentAccount.oauthToken
|
||||
{
|
||||
userPreferences.setNotification(count: 0, token: token)
|
||||
watcher.unreadNotificationsCount = 0
|
||||
}
|
||||
}
|
||||
|
||||
})) {
|
||||
ForEach(availableTabs) { tab in
|
||||
tab.makeContentView(popToRootTab: $popToRootTab)
|
||||
.tabItem {
|
||||
if userPreferences.showiPhoneTabLabel {
|
||||
tab.label
|
||||
.labelStyle(TitleAndIconLabelStyle())
|
||||
} else {
|
||||
tab.label
|
||||
.labelStyle(IconOnlyLabelStyle())
|
||||
}
|
||||
}
|
||||
.tag(tab)
|
||||
.badge(badgeFor(tab: tab))
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .tabBar)
|
||||
}
|
||||
}
|
||||
.id(appAccountsManager.currentClient.id)
|
||||
Divider().edgesIgnoringSafeArea(.all)
|
||||
notificationsSecondaryColumn
|
||||
}
|
||||
.id(appAccountsManager.currentClient.id)
|
||||
}
|
||||
|
||||
private func setNewClientsInEnv(client: Client) {
|
||||
|
|
|
@ -169,6 +169,10 @@ public class Theme: ObservableObject {
|
|||
self?.setColor(withName: colorSetName)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
#if os(visionOS)
|
||||
selectedSet = .iceCubeDark
|
||||
#endif
|
||||
}
|
||||
|
||||
public static var allColorSet: [ColorSet] {
|
||||
|
|
|
@ -72,7 +72,6 @@ public struct NotificationsListView: View {
|
|||
}
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
.task {
|
||||
viewModel.client = client
|
||||
viewModel.currentAccount = account
|
||||
|
@ -119,7 +118,6 @@ public struct NotificationsListView: View {
|
|||
leading: .layoutPadding + 4,
|
||||
bottom: 12,
|
||||
trailing: .layoutPadding))
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
.redacted(reason: .placeholder)
|
||||
}
|
||||
|
||||
|
@ -128,7 +126,6 @@ public struct NotificationsListView: View {
|
|||
EmptyView(iconName: "bell.slash",
|
||||
title: "notifications.empty.title",
|
||||
message: "notifications.empty.message")
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
.listSectionSeparator(.hidden)
|
||||
} else {
|
||||
ForEach(notifications) { notification in
|
||||
|
@ -140,8 +137,6 @@ public struct NotificationsListView: View {
|
|||
leading: .layoutPadding + 4,
|
||||
bottom: 12,
|
||||
trailing: .layoutPadding))
|
||||
.listRowBackground(notification.type == .mention && lockedType != .mention ?
|
||||
theme.secondaryBackgroundColor : theme.primaryBackgroundColor)
|
||||
.id(notification.id)
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +164,6 @@ public struct NotificationsListView: View {
|
|||
await viewModel.fetchNotifications()
|
||||
}
|
||||
}
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
.listSectionSeparator(.hidden)
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +178,6 @@ public struct NotificationsListView: View {
|
|||
leading: .layoutPadding + 4,
|
||||
bottom: .layoutPadding,
|
||||
trailing: .layoutPadding))
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
}
|
||||
|
||||
private var topPaddingView: some View {
|
||||
|
|
|
@ -41,7 +41,6 @@ public struct StatusesListView<Fetcher>: View where Fetcher: StatusesFetcher {
|
|||
await fetcher.fetchNewestStatuses()
|
||||
}
|
||||
}
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
.listRowSeparator(.hidden)
|
||||
|
||||
case let .display(statuses, nextPageState):
|
||||
|
@ -83,6 +82,5 @@ public struct StatusesListView<Fetcher>: View where Fetcher: StatusesFetcher {
|
|||
Spacer()
|
||||
}
|
||||
.padding(.horizontal, .layoutPadding)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,6 @@ public struct StatusRowView: View {
|
|||
StatusRowSwipeView(viewModel: viewModel, mode: .leading)
|
||||
}
|
||||
}
|
||||
.listRowBackground(viewModel.highlightRowColor)
|
||||
.listRowInsets(.init(top: 12,
|
||||
leading: .layoutPadding,
|
||||
bottom: 12,
|
||||
|
|
|
@ -91,7 +91,7 @@ public struct StatusRowCardView: View {
|
|||
}
|
||||
.frame(maxWidth: maxWidth)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
.background(.ultraThinMaterial)
|
||||
.cornerRadius(16)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 16)
|
||||
|
|
|
@ -94,7 +94,6 @@ struct StatusRowContextMenu: View {
|
|||
.environmentObject(viewModel.client)
|
||||
.preferredColorScheme(Theme.shared.selectedScheme == .dark ? .dark : .light)
|
||||
.foregroundColor(Theme.shared.labelColor)
|
||||
.background(Theme.shared.primaryBackgroundColor)
|
||||
.frame(width: sceneDelegate.windowWidth - 12)
|
||||
.tint(Theme.shared.tintColor)
|
||||
let renderer = ImageRenderer(content: view)
|
||||
|
|
|
@ -25,7 +25,7 @@ public struct StatusRowMediaPreviewView: View {
|
|||
@State private var isHidingMedia: Bool = false
|
||||
|
||||
var availableWidth: CGFloat {
|
||||
return sceneDelegate.windowWidth
|
||||
return sceneDelegate.windowWidth * 0.50
|
||||
}
|
||||
|
||||
var appLayoutWidth: CGFloat {
|
||||
|
|
|
@ -57,7 +57,6 @@ public struct TimelineView: View {
|
|||
.environment(\.defaultMinListRowHeight, 1)
|
||||
.listStyle(.plain)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
.introspect(.list, on: .iOS(.v16, .v17)) { (collectionView: UICollectionView) in
|
||||
DispatchQueue.main.async {
|
||||
self.collectionView = collectionView
|
||||
|
@ -257,7 +256,6 @@ public struct TimelineView: View {
|
|||
|
||||
private var scrollToTopView: some View {
|
||||
HStack { EmptyView() }
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
.listRowSeparator(.hidden)
|
||||
.listRowInsets(.init())
|
||||
.frame(height: .layoutPadding)
|
||||
|
|
Loading…
Reference in a new issue