From b40c5a4f3e91203cbf57cdf750c485de771b3165 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 22 Apr 2026 08:35:13 +0100 Subject: [PATCH] ui: better icon for channel filter, remove separate copy button from link on iOS (#6856) --- .../Shared/Views/ChatList/ChatListView.swift | 28 +++++++++---------- .../Shared/Views/NewChat/NewChatView.swift | 8 ------ .../common/views/chatlist/ChatListView.kt | 26 ++++++++--------- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatListView.swift b/apps/ios/Shared/Views/ChatList/ChatListView.swift index 967fedf293..3080a2f403 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListView.swift @@ -839,11 +839,11 @@ struct TagsView: View { nil } let active = tag == selectedPresetTag - let (icon, text) = presetTagLabel(tag: tag, active: active) + let (icon, menuIcon, text) = presetTagLabel(tag: tag, active: active) let color: Color = active ? .accentColor : .secondary HStack(spacing: 4) { - Image(systemName: icon) + Image(systemName: menuIcon ?? icon) .foregroundColor(color) ZStack { Text(text).fontWeight(.semibold).foregroundColor(.clear) @@ -886,9 +886,9 @@ struct TagsView: View { Button { setActiveFilter(filter: .presetTag(tag)) } label: { - let (systemName, text) = presetTagLabel(tag: tag, active: tag == selectedPresetTag) + let (icon, _, text) = presetTagLabel(tag: tag, active: tag == selectedPresetTag) HStack { - Image(systemName: systemName) + Image(systemName: icon) Text(text) } } @@ -896,8 +896,8 @@ struct TagsView: View { } } label: { if let tag = selectedPresetTag, tag.сollapse { - let (systemName, _) = presetTagLabel(tag: tag, active: true) - Image(systemName: systemName) + let (icon, menuIcon, _) = presetTagLabel(tag: tag, active: true) + Image(systemName: menuIcon ?? icon) .foregroundColor(.accentColor) } else { Image(systemName: "list.bullet") @@ -907,15 +907,15 @@ struct TagsView: View { .frame(minWidth: 28) } - private func presetTagLabel(tag: PresetTag, active: Bool) -> (String, LocalizedStringKey) { + private func presetTagLabel(tag: PresetTag, active: Bool) -> (item: String, menu: String?, label: LocalizedStringKey) { switch tag { - case .groupReports: (active ? "flag.fill" : "flag", "Reports") - case .favorites: (active ? "star.fill" : "star", "Favorites") - case .contacts: (active ? "person.fill" : "person", "Contacts") - case .groups: (active ? "person.2.fill" : "person.2", "Groups") - case .channels: (active ? "antenna.radiowaves.left.and.right.circle.fill" : "antenna.radiowaves.left.and.right.circle", "Channels") - case .business: (active ? "briefcase.fill" : "briefcase", "Businesses") - case .notes: (active ? "folder.fill" : "folder", "Notes") + case .groupReports: (item: active ? "flag.fill" : "flag", menu: nil, label: "Reports") + case .favorites: (item: active ? "star.fill" : "star", menu: nil, label: "Favorites") + case .contacts: (item: active ? "person.fill" : "person", menu: nil, label: "Contacts") + case .groups: (item: active ? "person.2.fill" : "person.2", menu: nil, label: "Groups") + case .channels: (item: active ? "antenna.radiowaves.left.and.right.circle.fill" : "antenna.radiowaves.left.and.right", menu: "antenna.radiowaves.left.and.right", label: "Channels") + case .business: (item: active ? "briefcase.fill" : "briefcase", menu: nil, label: "Businesses") + case .notes: (item: active ? "folder.fill" : "folder", menu: nil, label: "Notes") } } diff --git a/apps/ios/Shared/Views/NewChat/NewChatView.swift b/apps/ios/Shared/Views/NewChat/NewChatView.swift index fab8f8a143..9bcc326a66 100644 --- a/apps/ios/Shared/Views/NewChat/NewChatView.swift +++ b/apps/ios/Shared/Views/NewChat/NewChatView.swift @@ -338,14 +338,6 @@ private struct InviteView: View { HStack(spacing: 8) { let link = connLinkInvitation.simplexChatUri(short: showShortLink) linkTextView(link) - Button { - UIPasteboard.general.string = link - setInvitationUsed() - } label: { - Image(systemName: "doc.on.doc") - .padding(.top, -7) - .padding(.horizontal, 8) - } Button { showShareSheet(items: [link]) setInvitationUsed() diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt index 8f836c3c29..663b42413f 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt @@ -1144,7 +1144,7 @@ private fun ExpandedTagFilterView(tag: PresetTagKind) { is ActiveFilter.PresetTag -> af.tag == tag else -> false } - val (icon, text) = presetTagLabel(tag, active) + val (icon, menuIcon, text) = presetTagLabel(tag, active) val color = if (active) MaterialTheme.colors.primary else MaterialTheme.colors.secondary Row( @@ -1164,7 +1164,7 @@ private fun ExpandedTagFilterView(tag: PresetTagKind) { horizontalArrangement = Arrangement.Center ) { Icon( - painterResource(icon), + painterResource(menuIcon ?: icon), stringResource(text), Modifier.size(18.sp.toDp()), tint = color @@ -1206,9 +1206,9 @@ private fun CollapsedTagsFilterView(searchText: MutableState) { contentAlignment = Alignment.Center ) { if (selectedPresetTag != null) { - val (icon, text) = presetTagLabel(selectedPresetTag, true) + val (icon, menuIcon, text) = presetTagLabel(selectedPresetTag, true) Icon( - painterResource(icon), + painterResource(menuIcon ?: icon), stringResource(text), Modifier.size(18.sp.toDp()), tint = MaterialTheme.colors.primary @@ -1254,7 +1254,7 @@ fun ItemPresetFilterAction( showMenu: MutableState, onCloseMenuAction: MutableState<(() -> Unit)> ) { - val (icon, text) = presetTagLabel(presetTag, active) + val (icon, _, text) = presetTagLabel(presetTag, active) ItemAction( stringResource(text), painterResource(icon), @@ -1336,15 +1336,15 @@ fun presetTagMatchesChat(tag: PresetTagKind, chatInfo: ChatInfo, chatStats: Chat } } -private fun presetTagLabel(tag: PresetTagKind, active: Boolean): Pair = +private fun presetTagLabel(tag: PresetTagKind, active: Boolean): Triple = when (tag) { - PresetTagKind.GROUP_REPORTS -> (if (active) MR.images.ic_flag_filled else MR.images.ic_flag) to MR.strings.chat_list_group_reports - PresetTagKind.FAVORITES -> (if (active) MR.images.ic_star_filled else MR.images.ic_star) to MR.strings.chat_list_favorites - PresetTagKind.CONTACTS -> (if (active) MR.images.ic_person_filled else MR.images.ic_person) to MR.strings.chat_list_contacts - PresetTagKind.GROUPS -> (if (active) MR.images.ic_group_filled else MR.images.ic_group) to MR.strings.chat_list_groups - PresetTagKind.CHANNELS -> (if (active) MR.images.ic_bigtop_updates_circle_filled else MR.images.ic_bigtop_updates) to MR.strings.chat_list_channels - PresetTagKind.BUSINESS -> (if (active) MR.images.ic_work_filled else MR.images.ic_work) to MR.strings.chat_list_businesses - PresetTagKind.NOTES -> (if (active) MR.images.ic_folder_closed_filled else MR.images.ic_folder_closed) to MR.strings.chat_list_notes + PresetTagKind.GROUP_REPORTS -> Triple(if (active) MR.images.ic_flag_filled else MR.images.ic_flag, null, MR.strings.chat_list_group_reports) + PresetTagKind.FAVORITES -> Triple(if (active) MR.images.ic_star_filled else MR.images.ic_star, null, MR.strings.chat_list_favorites) + PresetTagKind.CONTACTS -> Triple(if (active) MR.images.ic_person_filled else MR.images.ic_person, null, MR.strings.chat_list_contacts) + PresetTagKind.GROUPS -> Triple(if (active) MR.images.ic_group_filled else MR.images.ic_group, null, MR.strings.chat_list_groups) + PresetTagKind.CHANNELS -> Triple(if (active) MR.images.ic_bigtop_updates_circle_filled else MR.images.ic_bigtop_updates, MR.images.ic_bigtop_updates, MR.strings.chat_list_channels) + PresetTagKind.BUSINESS -> Triple(if (active) MR.images.ic_work_filled else MR.images.ic_work, null, MR.strings.chat_list_businesses) + PresetTagKind.NOTES -> Triple(if (active) MR.images.ic_folder_closed_filled else MR.images.ic_folder_closed, null, MR.strings.chat_list_notes) } private fun presetCanBeCollapsed(tag: PresetTagKind): Boolean = when (tag) {