From eb1cfb68d57e1c54ffa3de2d342f2f42931a6d0f Mon Sep 17 00:00:00 2001 From: amshak <85162587+amshakal@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:31:15 +0100 Subject: [PATCH] Combine DM call actions into one menu item This helps give more space to the room header. Specially in the scenario when threads is enabled. --- .../View/RoomCallControlsToolbar.swift | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/ElementX/Sources/Screens/RoomScreen/View/RoomCallControlsToolbar.swift b/ElementX/Sources/Screens/RoomScreen/View/RoomCallControlsToolbar.swift index 6d6c5225a..f972d3756 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/RoomCallControlsToolbar.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/RoomCallControlsToolbar.swift @@ -24,21 +24,38 @@ struct RoomCallControlsToolbar: ToolbarContent { } else { if viewState.isDirectOneToOneRoom { ToolbarItem(placement: .primaryAction) { - Button { onCallTap(true) } label: { + Menu { + Button(action: { onCallTap(true) }) { + Label("Audio call", systemImage: "phone.fill") + } + .accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall) + .disabled(!viewState.canJoinCall) + + Button(action: { onCallTap(false) }) { + Label("Video call", systemImage: "video.fill") + } + .accessibilityIdentifier(A11yIdentifiers.roomScreen.startVideoCall) + .disabled(!viewState.canJoinCall) + } label: { CompoundIcon(\.voiceCallSolid) + .frame(width: 28, height: 28) + .contentShape(Rectangle()) } + .menuIndicator(.hidden) + .buttonStyle(.plain) .accessibilityLabel(L10n.a11yStartVoiceCall) .accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall) .disabled(!viewState.canJoinCall) } - } - ToolbarItem(placement: .primaryAction) { - Button { onCallTap(false) } label: { - CompoundIcon(\.videoCallSolid) + } else { + ToolbarItem(placement: .primaryAction) { + Button { onCallTap(false) } label: { + CompoundIcon(\.videoCallSolid) + } + .accessibilityLabel(L10n.a11yStartVideoCall) + .accessibilityIdentifier(A11yIdentifiers.roomScreen.startVideoCall) + .disabled(!viewState.canJoinCall) } - .accessibilityLabel(L10n.a11yStartVideoCall) - .accessibilityIdentifier(A11yIdentifiers.roomScreen.startVideoCall) - .disabled(!viewState.canJoinCall) } } }