| index e6b3895..fdd5a54 100644 |
| --- a/native/apple/Sources/CallsKit/MacFullWindowCall.swift |
| +++ b/native/apple/Sources/CallsKit/MacFullWindowCall.swift |
| @@ -181,30 +181,40 @@ |
| let across = |
| fitted.width >= 200 |
| ? columns : max(1, Int((area.width + 4) / (tile.width + 4))) |
| + let rows = (count + across - 1) / across |
| + let gridHeight = CGFloat(rows) * tile.height + CGFloat(max(rows - 1, 0)) * 4 |
| + // The last row's names clear the bar while it shows: lifted by as |
| + // much of the bar as reaches over them (the grid is centred). |
| + let below = max(0, (size.height - 8 - gridHeight) / 2) + 4 |
| + let lastLift = max(0, lift - below) |
| + let firstOfLastRow = (rows - 1) * across |
| ScrollView { |
| LazyVGrid( |
| columns: Array(repeating: GridItem(.fixed(tile.width), spacing: 4), count: across), |
| spacing: 4 |
| ) { |
| - ForEach(call.screens, id: \.self) { peer in |
| + ForEach(Array(call.screens.enumerated()), id: \.element) { index, peer in |
| MacVideoTile( |
| track: call.remoteScreens[peer], label: screenCaption(call.name(of: peer)), |
| - screen: true, cornerRadius: 6, compact: true, backdrop: Self.tileBackdrop |
| + screen: true, cornerRadius: 6, compact: true, |
| + labelLift: index >= firstOfLastRow ? lastLift : 0, backdrop: Self.tileBackdrop |
| ) |
| .frame(width: tile.width, height: tile.height) |
| } |
| MacVideoTile( |
| track: call.localTrack, label: "You", muted: call.muted, mirrored: true, |
| cameraOff: call.cameraOff, placeholder: call.selfPlaceholder, cornerRadius: 6, |
| - compact: true, backdrop: Self.tileBackdrop, audio: call.selfAudio |
| + compact: true, labelLift: call.screens.count >= firstOfLastRow ? lastLift : 0, |
| + backdrop: Self.tileBackdrop, audio: call.selfAudio |
| ) |
| .frame(width: tile.width, height: tile.height) |
| - ForEach(peers) { peer in |
| + ForEach(Array(peers.enumerated()), id: \.element.id) { index, peer in |
| MacVideoTile( |
| track: call.remoteTracks[peer.peer], label: peer.name, |
| muted: call.isMuted(peer.peer), cameraOff: call.isCameraOff(peer.peer), |
| - cornerRadius: 6, compact: true, backdrop: Self.tileBackdrop, |
| - audio: call.tileAudio(peer.peer) |
| + cornerRadius: 6, compact: true, |
| + labelLift: call.screens.count + 1 + index >= firstOfLastRow ? lastLift : 0, |
| + backdrop: Self.tileBackdrop, audio: call.tileAudio(peer.peer) |
| ) |
| .frame(width: tile.width, height: tile.height) |
| } |
| @@ -259,8 +269,14 @@ |
| var trailing: CGFloat = 0 |
| if showingChat { trailing += Self.panelWidth + 12 } |
| if stageShowsScreen, !peers.isEmpty { trailing += strip(in: size).width + 12 } |
| + // The title pill sits beside the traffic lights while the controls |
| + // show; a self view in that corner goes below it. |
| + let corner = PiPCorner(rawValue: pipCorner) ?? .bottomTrailing |
| + let top = |
| + corner == .topLeading && chrome.visible |
| + ? max(Self.titleBarHeight, 6 + titleHeight + 4) : Self.titleBarHeight |
| return EdgeInsets( |
| - top: Self.titleBarHeight, leading: 0, |
| + top: top, leading: 0, |
| bottom: chrome.visible ? Self.barReserve - 12 : 0, trailing: trailing) |
| } |
| |
| @@ -292,6 +308,10 @@ |
| } |
| .padding(.horizontal, 12).padding(.vertical, 7) |
| .callOverlaySurface(RoundedRectangle(cornerRadius: 12, style: .continuous)) |
| + .background(GeometryReader { proxy in |
| + Color.clear.onAppear { titleHeight = proxy.size.height } |
| + .onChange(of: proxy.size.height) { _, height in titleHeight = height } |
| + }) |
| .accessibilityElement(children: .contain) |
| .accessibilityIdentifier("callTitle") |
| .frame(maxWidth: 420, alignment: .leading) |