Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions freewrite/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,21 @@ struct ContentView: View {
NSCursor.pop()
}
}
.onAppear {
NSEvent.addLocalMonitorForEvents(matching: .scrollWheel) { event in
if isHoveringSize {
let scrollBuffer = event.deltaY * 0.25

if abs(scrollBuffer) >= 0.1 {
NSHapticFeedbackManager.defaultPerformer.perform(.generic, performanceTime: .now)
let direction = -scrollBuffer > 0 ? 2 : -2
let newSize = fontSize + CGFloat(direction)
fontSize = min(max(newSize, 16), 26) // Limit font size between 16 and 26
}
}
return event
}
}

Text("•")
.foregroundColor(.gray)
Expand Down