aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFavoritesOutlineView.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-10-08 14:26:01 +0000
committerrowanbeentje <rowan@beent.je>2012-10-08 14:26:01 +0000
commitc55ffebc406d7d2af3c71b2dace3ec7e3238fd55 (patch)
tree24bd96933a185e5e1fc4629c221b20df2c933330 /Source/SPFavoritesOutlineView.m
parent051e606e86cb7817defc2ecb2cf4efb7c6444e4c (diff)
downloadsequelpro-c55ffebc406d7d2af3c71b2dace3ec7e3238fd55.tar.gz
sequelpro-c55ffebc406d7d2af3c71b2dace3ec7e3238fd55.tar.bz2
sequelpro-c55ffebc406d7d2af3c71b2dace3ec7e3238fd55.zip
- Fix the Quick Connect entry on the connection screen being a drag and drop target
- Speculative fix for 10.6 & 10.5 connection screen padding/layout issues
Diffstat (limited to 'Source/SPFavoritesOutlineView.m')
-rw-r--r--Source/SPFavoritesOutlineView.m14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/SPFavoritesOutlineView.m b/Source/SPFavoritesOutlineView.m
index 08880ec8..69800606 100644
--- a/Source/SPFavoritesOutlineView.m
+++ b/Source/SPFavoritesOutlineView.m
@@ -37,6 +37,12 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 14;
@implementation SPFavoritesOutlineView
+- (void) awakeFromNib
+{
+ systemVersion = 0;
+ Gestalt(gestaltSystemVersion, &systemVersion);
+}
+
- (BOOL)acceptsFirstResponder
{
return YES;
@@ -99,6 +105,11 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 14;
{
NSRect superFrame = [super frameOfCellAtColumn:columnIndex row:rowIndex];
+ // On system versions lower than Lion, don't alter padding
+ if (systemVersion < 0x1070) {
+ return superFrame;
+ }
+
return NSMakeRect(superFrame.origin.x - SPFavoritesOutlineViewUnindent, superFrame.origin.y, superFrame.size.width + SPFavoritesOutlineViewUnindent, superFrame.size.height);
}
@@ -110,7 +121,8 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 14;
{
NSRect superFrame = [super frameOfOutlineCellAtRow:rowIndex];
- if (superFrame.origin.x > SPFavoritesOutlineViewUnindent) {
+ // On versions of Lion or above, amend the padding appropriately
+ if (systemVersion >= 0x1070 && superFrame.origin.x > SPFavoritesOutlineViewUnindent) {
return NSMakeRect(superFrame.origin.x - SPFavoritesOutlineViewUnindent, superFrame.origin.y, superFrame.size.width, superFrame.size.height);
}