Remove unnecessary menu

This commit is contained in:
Benoit Martins 2026-02-24 16:22:03 +01:00
parent ca9f5ffe1f
commit ef09f6c412
3 changed files with 71 additions and 74 deletions

View file

@ -2,6 +2,6 @@ import Foundation
public enum AppGitInfo {
public static let branch = "master"
public static let commit = "5bbbbe5d7"
public static let commit = "ca9f5ffe1"
public static let tag = "6.1.0-alpha"
}

View file

@ -598,65 +598,37 @@ struct ContentView: View {
}
.padding(.trailing, sharedMainViewModel.indexView == 2 ? 10 : 0)
if sharedMainViewModel.indexView == 3 {
Button {
NotificationCenter.default.post(name: MeetingsListViewModel.ScrollToTodayNotification, object: nil)
} label: {
Image("calendar")
.renderingMode(.template)
.resizable()
.foregroundStyle(.white)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
}
.padding(.trailing, 10)
} else if sharedMainViewModel.indexView != 2 {
if sharedMainViewModel.indexView == 0 {
Menu {
if sharedMainViewModel.indexView == 0 {
Button {
sharedMainViewModel.displayedFriend = nil
isMenuOpen = false
magicSearch.changeAllContact(allContactBool: true)
magicSearch.searchForContacts()
} label: {
HStack {
Text("contacts_list_filter_popup_see_all")
Spacer()
if magicSearch.allContact {
Image("green-check")
.resizable()
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
}
Button {
sharedMainViewModel.displayedFriend = nil
isMenuOpen = false
magicSearch.changeAllContact(allContactBool: true)
magicSearch.searchForContacts()
} label: {
HStack {
Text("contacts_list_filter_popup_see_all")
Spacer()
if magicSearch.allContact {
Image("green-check")
.resizable()
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
}
}
Button {
sharedMainViewModel.displayedFriend = nil
isMenuOpen = false
magicSearch.changeAllContact(allContactBool: false)
magicSearch.searchForContacts()
} label: {
HStack {
Text(!magicSearch.linphoneDomain ? String(localized: "contacts_list_filter_popup_see_sip_only") : String(format: String(localized: "contacts_list_filter_popup_see_linphone_only"), Bundle.main.displayName))
Spacer()
if !magicSearch.allContact {
Image("green-check")
.resizable()
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
}
}
}
} else {
Button(role: .destructive) {
isMenuOpen = false
isShowDeleteAllHistoryPopup.toggle()
} label: {
HStack {
Text("menu_delete_history")
Spacer()
Image("trash-simple-red")
}
Button {
sharedMainViewModel.displayedFriend = nil
isMenuOpen = false
magicSearch.changeAllContact(allContactBool: false)
magicSearch.searchForContacts()
} label: {
HStack {
Text(!magicSearch.linphoneDomain ? String(localized: "contacts_list_filter_popup_see_sip_only") : String(format: String(localized: "contacts_list_filter_popup_see_linphone_only"), Bundle.main.displayName))
Spacer()
if !magicSearch.allContact {
Image("green-check")
.resizable()
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
@ -675,6 +647,30 @@ struct ContentView: View {
.onTapGesture {
isMenuOpen = true
}
} else if sharedMainViewModel.indexView == 1 {
Button {
isShowDeleteAllHistoryPopup.toggle()
} label: {
Image("trash-simple")
.renderingMode(.template)
.resizable()
.foregroundStyle(.white)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
}
.padding(.trailing, 10)
} else if sharedMainViewModel.indexView == 3 {
Button {
NotificationCenter.default.post(name: MeetingsListViewModel.ScrollToTodayNotification, object: nil)
} label: {
Image("calendar")
.renderingMode(.template)
.resizable()
.foregroundStyle(.white)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
}
.padding(.trailing, 10)
}
}
.frame(maxWidth: .infinity)

View file

@ -137,26 +137,27 @@ struct SideMenuAccountRow: View {
.padding(.trailing, -8)
}
Menu {
Button {
accountProfileViewModel.accountModelIndex = CoreContext.shared.accounts.firstIndex(where: {$0.displayName == model.displayName})
withAnimation {
isOpen = false
isShowAccountProfileFragment = true
}
} label: {
Label("drawer_menu_manage_account", systemImage: "arrow.right.circle")
Button {
accountProfileViewModel.accountModelIndex = CoreContext.shared.accounts.firstIndex(where: {$0.displayName == model.displayName})
withAnimation {
isOpen = false
isShowAccountProfileFragment = true
}
} label: {
VStack {
Image("dots-three-vertical")
.renderingMode(.template)
.resizable()
.foregroundColor(Color.grayMain2c500)
.scaledToFit()
.frame(height: 25)
Image("user-circle-gear")
.renderingMode(.template)
.resizable()
.foregroundColor(Color.grayMain2c600)
.scaledToFit()
.frame(height: 25)
}
.frame(width: 30, height: 30)
.onTapGesture {
accountProfileViewModel.accountModelIndex = CoreContext.shared.accounts.firstIndex(where: {$0.displayName == model.displayName})
withAnimation {
isOpen = false
isShowAccountProfileFragment = true
}
.frame(width: 30, height: 30)
}
}
.frame(alignment: .trailing)