summaryrefslogtreecommitdiff
path: root/new/darwin/util.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-15 18:49:45 -0400
committerPietro Gagliardi <[email protected]>2015-04-15 18:49:45 -0400
commit518a5ddbf15d50a254c732a80d5907ef8878abe0 (patch)
tree48cf259f98994e4570e65c389fcd9824272884ad /new/darwin/util.m
parent50ae3ca045e7f5f5744043df0a4506e2f6930bb1 (diff)
Split all OS backends into their own folders.
Diffstat (limited to 'new/darwin/util.m')
-rw-r--r--new/darwin/util.m20
1 files changed, 20 insertions, 0 deletions
diff --git a/new/darwin/util.m b/new/darwin/util.m
new file mode 100644
index 0000000..906a0ea
--- /dev/null
+++ b/new/darwin/util.m
@@ -0,0 +1,20 @@
+// 7 april 2015
+#import "uipriv_darwin.h"
+
+// also fine for NSCells and NSTexts (NSTextViews)
+void setStandardControlFont(NSControl *control)
+{
+ [control setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
+}
+
+void disableAutocorrect(NSTextView *tv)
+{
+ [tv setEnabledTextCheckingTypes:0];
+ [tv setAutomaticDashSubstitutionEnabled:NO];
+ // don't worry about automatic data detection; it won't change stringValue (thanks pretty_function in irc.freenode.net/#macdev)
+ [tv setAutomaticSpellingCorrectionEnabled:NO];
+ [tv setAutomaticTextReplacementEnabled:NO];
+ [tv setAutomaticQuoteSubstitutionEnabled:NO];
+ [tv setAutomaticLinkDetectionEnabled:NO];
+ [tv setSmartInsertDeleteEnabled:NO];
+}