5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-12 15:09:33 +08:00

Disable annoying smart quotes

This commit is contained in:
Lea Anthony 2020-10-18 11:48:38 +11:00
parent 288da8c147
commit 7885718d42
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -942,6 +942,11 @@ void Run(struct Application *app, int argc, char **argv) {
CGRect contentViewBounds = GET_BOUNDS(contentView); CGRect contentViewBounds = GET_BOUNDS(contentView);
msg(wkwebview, s("setFrame:"), contentViewBounds ); msg(wkwebview, s("setFrame:"), contentViewBounds );
// Disable damn smart quotes
// Credit: https://stackoverflow.com/a/31640511
id userDefaults = msg(c("NSUserDefaults"), s("standardUserDefaults"));
msg(userDefaults, s("setBool:forKey:"), NO, str("NSAutomaticQuoteSubstitutionEnabled"));
// Setup drag message handler // Setup drag message handler
msg(manager, s("addScriptMessageHandler:name:"), app->delegate, str("windowDrag")); msg(manager, s("addScriptMessageHandler:name:"), app->delegate, str("windowDrag"));
// Add mouse event hooks // Add mouse event hooks