aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPPreferenceController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-12 10:25:07 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-12 10:25:07 +0000
commit29c40c62b9afa5eb3c61b8904b5213750bed558a (patch)
tree48001c67a67b1fe2d6db029b146cc50e59fa7a16 /Source/SPPreferenceController.m
parent31ddc7c313db56bd817c95e5ea9c7310f0b21ae7 (diff)
downloadsequelpro-29c40c62b9afa5eb3c61b8904b5213750bed558a.tar.gz
sequelpro-29c40c62b9afa5eb3c61b8904b5213750bed558a.tar.bz2
sequelpro-29c40c62b9afa5eb3c61b8904b5213750bed558a.zip
• fixed truncating issue of Pref's Favorite List table view
- now favorite name/host will be truncated correctly - added tooltip for truncated favorites
Diffstat (limited to 'Source/SPPreferenceController.m')
-rw-r--r--Source/SPPreferenceController.m17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m
index 74ea244d..aed79610 100644
--- a/Source/SPPreferenceController.m
+++ b/Source/SPPreferenceController.m
@@ -29,6 +29,7 @@
#import "SPKeychain.h"
#import "TableDocument.h"
#import "SPConnectionController.h"
+#import "SPTooltip.h"
#define FAVORITES_PB_DRAG_TYPE @"SequelProPreferencesPasteboard"
@@ -81,8 +82,6 @@
keychain = [[SPKeychain alloc] init];
- SPFavoriteTextFieldCell *tableCell = [[[SPFavoriteTextFieldCell alloc] init] autorelease];
-
[tableCell setImage:[NSImage imageNamed:@"database"]];
// Replace column's NSTextFieldCell with custom SWProfileTextFieldCell
@@ -670,6 +669,18 @@
favoriteNameFieldWasTouched = YES;
}
+- (NSString *)tableView:(NSTableView *)aTableView toolTipForCell:(SPFavoriteTextFieldCell *)aCell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation
+{
+ NSRect r = *rect;
+ // No tooltip if cellSize < controlSize
+ if([aCell cellSize].width < r.size.width-20) return nil;
+
+ NSPoint pos = [NSEvent mouseLocation];
+ pos.y -= 20;
+ [SPTooltip showWithObject:[NSString stringWithFormat:@"<span style='font-size:larger;'>%@</span><br><font color='darkgrey'>%@</font>", [aCell favoriteName], [aCell favoriteHost]] atLocation:pos ofType:@"html"];
+ return nil;
+}
+
#pragma mark -
#pragma mark Toolbar delegate methods
@@ -746,7 +757,7 @@
// -------------------------------------------------------------------------------
- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)offset
{
- return (proposedMin + 100);
+ return (proposedMin + 94);
}
#pragma mark -