mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-04 09:35:48 +00:00
list going behind toolbars
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user