fix: timer row click properly opens in menu

This commit is contained in:
Michael Freno
2026-01-08 23:43:58 -05:00
parent f243011a23
commit 1f4a2c7318
3 changed files with 55 additions and 45 deletions

View File

@@ -188,8 +188,12 @@ private func showReminderWindow(_ content: AnyView) {
// Public method to open settings window
func openSettings(tab: Int = 0) {
// If window already exists, just bring it to front
// If window already exists, switch to the tab and bring it to front
if let existingWindow = settingsWindowController?.window {
NotificationCenter.default.post(
name: Notification.Name("SwitchToSettingsTab"),
object: tab
)
existingWindow.makeKeyAndOrderFront(nil)
NSApp.activate(ignoringOtherApps: true)
return

View File

@@ -173,9 +173,7 @@ struct TimerStatusRow: View {
@State private var isHoveredBody = false
var body: some View {
Button(action: {
onTap?()
}) {
HStack {
HStack {
Image(systemName: type.iconName)
.foregroundColor(iconColor)
@@ -192,6 +190,11 @@ struct TimerStatusRow: View {
}
Spacer()
}
.contentShape(Rectangle())
.onTapGesture {
onTap?()
}
#if DEBUG
if let onDevTrigger = onDevTrigger {
@@ -221,7 +224,7 @@ struct TimerStatusRow: View {
}
.buttonStyle(.plain)
.glassEffect(
isHoveredSkip ? .regular.tint(.accentColor.opacity(0.5)) : .regular,
isHoveredSkip ? .regular.tint(.accentColor) : .regular,
in: .circle
)
.help("Skip to next \(type.displayName) reminder")
@@ -231,10 +234,8 @@ struct TimerStatusRow: View {
}
.padding(.horizontal, 8)
.padding(.vertical, 6)
}
.buttonStyle(.plain)
.glassEffect(
isHoveredBody ? .regular.tint(.accentColor.opacity(0.5)) : .regular,
isHoveredBody ? .regular.tint(.accentColor) : .regular,
in: .rect(cornerRadius: 6)
)
.padding(.horizontal, 8)

View File

@@ -95,6 +95,11 @@ struct SettingsWindowView: View {
.padding()
}
.frame(width: 600, height: 550)
.onReceive(NotificationCenter.default.publisher(for: Notification.Name("SwitchToSettingsTab"))) { notification in
if let tab = notification.object as? Int {
currentTab = tab
}
}
}
private func applySettings() {