Centered the recorder

This commit is contained in:
Beingpax 2025-10-05 13:35:27 +05:45
parent 9a7f702859
commit ef5b86e7c3
3 changed files with 7 additions and 12 deletions

View File

@ -34,16 +34,16 @@ class MiniRecorderPanel: NSPanel {
guard let screen = NSScreen.main else {
return NSRect(x: 0, y: 0, width: 184, height: 40)
}
let width: CGFloat = 184
let height: CGFloat = 40
let padding: CGFloat = 24
let visibleFrame = screen.visibleFrame
let centerX = visibleFrame.midX - 5
let centerX = visibleFrame.midX
let xPosition = centerX - (width / 2)
let yPosition = visibleFrame.minY + padding
return NSRect(
x: xPosition,
y: yPosition,

View File

@ -46,7 +46,7 @@ struct NotchRecorderView: View {
Spacer()
}
.frame(width: 84)
.frame(width: 64)
.padding(.leading, 16)
}
@ -62,7 +62,7 @@ struct NotchRecorderView: View {
Spacer()
statusDisplay
}
.frame(width: 84)
.frame(width: 64)
.padding(.trailing, 16)
}
@ -85,7 +85,6 @@ struct NotchRecorderView: View {
rightSection
}
.frame(height: menuBarHeight)
.frame(maxWidth: windowManager.isVisible ? .infinity : 0)
.background(Color.black)
.mask {
NotchShape(cornerRadius: 10)
@ -99,7 +98,3 @@ struct NotchRecorderView: View {
}
}
}

View File

@ -56,7 +56,7 @@ extension WhisperState {
if recordingState == .busy { return }
let wasRecording = recordingState == .recording
await MainActor.run {
self.recordingState = .busy
}