Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions freewrite.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"freewrite/Preview Content\"";
DEVELOPMENT_TEAM = 2UDAY4J48G;
DEVELOPMENT_TEAM = 4YS2543B33;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't commit this, this will affect development for all contributors

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farzaa check this out!

ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -444,7 +444,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"freewrite/Preview Content\"";
DEVELOPMENT_TEAM = 2UDAY4J48G;
DEVELOPMENT_TEAM = 4YS2543B33;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand Down
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, 12), 32) // Limit font size between 12 and 32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limit the font size between 16 and 26 (that's the limit in the original app)

}
}
return event
}
}

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