list going behind toolbars

This commit is contained in:
spaced4ndy
2024-05-03 14:31:24 +04:00
parent 7462c80dd2
commit 1e4012b1f6
2 changed files with 17 additions and 13 deletions
@@ -23,6 +23,7 @@ struct ChatsView: View {
@State private var newChatMenuOption: NewChatMenuOption? = nil // TODO remove?
@AppStorage(DEFAULT_SHOW_UNREAD_AND_FAVORITES) private var showUnreadAndFavorites = false
@AppStorage(DEFAULT_SEARCH_IN_BOTTOM) private var searchInBottom = false
@AppStorage(DEFAULT_CHAT_LIST_REVERSED) private var chatListReversed = false
var body: some View {
@@ -81,12 +82,23 @@ struct ChatsView: View {
// .listRowSeparator(.hidden)
// .frame(maxWidth: .infinity)
// }
if !searchInBottom {
Color.clear
.listRowSeparator(.hidden)
.frame(height: 35) // account for topToolbar height
}
ForEach(cs, id: \.viewId) { chat in
ChatListNavLink(chat: chat)
.padding(.trailing, -16)
.disabled(chatModel.chatRunning != true || chatModel.deletedChats.contains(chat.chatInfo.id))
}
.offset(x: -8)
Color.clear
.listRowSeparator(.hidden)
.frame(height: searchInBottom ? 80 : 40) // account for bottomToolbar height
}
}
.onChange(of: chatModel.chatId) { _ in
+5 -13
View File
@@ -271,19 +271,11 @@ struct HomeView: View {
private func chatsView() -> some View {
// TODO onboarding buttons (remove?)
// TODO for reversed chat list start at bottom
VStack {
Spacer()
.frame(height: searchInBottom ? 0 : 45) // account for topToolbar height
ChatsView(
searchText: $searchText,
searchShowingSimplexLink: $searchShowingSimplexLink,
searchChatFilteredBySimplexLink: $searchChatFilteredBySimplexLink
)
Spacer()
.frame(height: searchInBottom ? 90 : 50) // account for bottomToolbar height
}
ChatsView(
searchText: $searchText,
searchShowingSimplexLink: $searchShowingSimplexLink,
searchChatFilteredBySimplexLink: $searchChatFilteredBySimplexLink
)
.padding(.top, 5)
}