Fix button layout initialization issue

This commit is contained in:
Beingpax 2025-08-07 00:30:23 +05:45
parent 45b9dcdc6e
commit 270caa95b0
2 changed files with 12 additions and 28 deletions

View File

@ -46,43 +46,27 @@ struct MiniRecorderView: View {
}
.overlay {
HStack(spacing: 0) {
// Left button zone
Group {
if windowManager.isExpanded {
RecorderPromptButton(showPopover: $showEnhancementPromptPopover)
.transition(.scale(scale: 0.5).combined(with: .opacity))
}
}
.frame(width: windowManager.isExpanded ? nil : 0)
.frame(maxWidth: windowManager.isExpanded ? .infinity : 0)
.clipped()
.opacity(windowManager.isExpanded ? 1 : 0)
.animation(.easeInOut(duration: 0.25), value: windowManager.isExpanded)
if windowManager.isExpanded {
// Left button zone - only exists when expanded
RecorderPromptButton(showPopover: $showEnhancementPromptPopover)
.transition(.scale(scale: 0.5).combined(with: .opacity))
.animation(.easeInOut(duration: 0.25), value: windowManager.isExpanded)
Spacer()
}
// Fixed visualizer zone
// Fixed visualizer zone - takes full width when compact
statusView
.frame(maxWidth: .infinity)
if windowManager.isExpanded {
Spacer()
// Right button zone - only exists when expanded
RecorderPowerModeButton(showPopover: $showPowerModePopover)
.transition(.scale(scale: 0.5).combined(with: .opacity))
.animation(.easeInOut(duration: 0.25), value: windowManager.isExpanded)
}
// Right button zone
Group {
if windowManager.isExpanded {
RecorderPowerModeButton(showPopover: $showPowerModePopover)
.transition(.scale(scale: 0.5).combined(with: .opacity))
}
}
.frame(width: windowManager.isExpanded ? nil : 0)
.frame(maxWidth: windowManager.isExpanded ? .infinity : 0)
.clipped()
.opacity(windowManager.isExpanded ? 1 : 0)
.animation(.easeInOut(duration: 0.25), value: windowManager.isExpanded)
}
.padding(.vertical, 8)
}

View File

@ -91,7 +91,7 @@ class MiniWindowManager: ObservableObject {
guard isVisible else { return }
self.isVisible = false
self.isExpanded = false
self.miniPanel?.hide { [weak self] in
guard let self = self else { return }
self.deinitializeWindow()