aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPScreenAdditions.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-11-10 16:13:43 +0100
committerMax <post@wickenrode.com>2015-11-10 16:13:43 +0100
commit2059dfa31eb3d9b629a9734c316984bd8afb3915 (patch)
treebd92065eb9156c572558cf3c6756e179abe048c4 /Source/SPScreenAdditions.m
parentfdef91b45a56b2f94aa477041b8f4185a2e7e7e2 (diff)
downloadsequelpro-2059dfa31eb3d9b629a9734c316984bd8afb3915.tar.gz
sequelpro-2059dfa31eb3d9b629a9734c316984bd8afb3915.tar.bz2
sequelpro-2059dfa31eb3d9b629a9734c316984bd8afb3915.zip
Add a "tooltip" when picking a column type in structure view, explaining basic properties of the type (part of #1090)
This is mostly to help users understand what "Length" actually does for *INT types.
Diffstat (limited to 'Source/SPScreenAdditions.m')
-rw-r--r--Source/SPScreenAdditions.m54
1 files changed, 54 insertions, 0 deletions
diff --git a/Source/SPScreenAdditions.m b/Source/SPScreenAdditions.m
new file mode 100644
index 00000000..edac0d68
--- /dev/null
+++ b/Source/SPScreenAdditions.m
@@ -0,0 +1,54 @@
+//
+// SPScreenAdditions.m
+// sequel-pro
+//
+// Created by Max Lohrmann on 09.11.15.
+// Copyright (c) 2015 Max Lohrmann. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+// More info at <https://github.com/sequelpro/sequelpro>
+
+#import "SPScreenAdditions.h"
+
+@implementation NSScreen (SPScreenAdditions)
+
++ (NSScreen *)screenAtPoint:(NSPoint)p
+{
+ for(NSScreen* candidate in [NSScreen screens])
+ {
+ NSRect cf = [candidate frame];
+ if(NSPointInRect(p,cf)) {
+ return candidate;
+ }
+ }
+ return nil;
+}
+
++ (NSRect)rectOfScreenAtPoint:(NSPoint)p
+{
+ NSScreen *s = [NSScreen screenAtPoint:p];
+
+ return (s? [s frame] : NSZeroRect);
+}
+
+@end