aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldEditorController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-11-14 22:21:13 +0000
committerstuconnolly <stuart02@gmail.com>2009-11-14 22:21:13 +0000
commit694e5a55fe9f2579fdef121e3da9d300ed372f89 (patch)
tree6a3e033bc5437ef157a225d2cdf7975ea4cfb9af /Source/SPFieldEditorController.m
parent1ac04adbfe9ad64a9aaa35780301309718ff85d9 (diff)
downloadsequelpro-694e5a55fe9f2579fdef121e3da9d300ed372f89.tar.gz
sequelpro-694e5a55fe9f2579fdef121e3da9d300ed372f89.tar.bz2
sequelpro-694e5a55fe9f2579fdef121e3da9d300ed372f89.zip
Updates to the 'use monospaced font' preference, making it a lot more consistent across all table views. Also includes live updating when the preference is changed as well as its implementation in the query console, process list and variables table views.
Diffstat (limited to 'Source/SPFieldEditorController.m')
-rw-r--r--Source/SPFieldEditorController.m21
1 files changed, 9 insertions, 12 deletions
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index 96631502..43bab67c 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -131,18 +131,15 @@
- (id)editWithObject:(id)data fieldName:(NSString*)fieldName usingEncoding:(NSStringEncoding)anEncoding
isObjectBlob:(BOOL)isFieldBlob isEditable:(BOOL)isEditable withWindow:(NSWindow *)tableWindow
{
-
- if ( ![prefs objectForKey:SPFieldEditorSheetFont] )
- if ( [prefs boolForKey:SPUseMonospacedFonts] ) {
- [editTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]];
- } else {
- [editTextView setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
- // [prefs setObject:[NSArchiver archivedDataWithRootObject:[editTextView font]] forKey:@"FieldEditorSheetFont"];
- }
- else
+ // If required, use monospaced fonts
+ if (![prefs objectForKey:SPFieldEditorSheetFont]) {
+ [editTextView setFont:([prefs boolForKey:SPUseMonospacedFonts]) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+ }
+ else {
[editTextView setFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"FieldEditorSheetFont"]]];
+ }
- [hexTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]];
+ [hexTextView setFont:[NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]]];
[editSheetFieldName setStringValue:[NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Field", @"Field"), fieldName]];
@@ -153,7 +150,7 @@
[editTextView setHidden:YES];
[editTextScrollView setHidden:YES];
- if(!isEditable) {
+ if (!isEditable) {
[editSheetOkButton setHidden:YES];
[editSheetCancelButton setHidden:YES];
[editSheetIsNotEditableCancelButton setHidden:NO];
@@ -180,7 +177,7 @@
[editSheetSegmentControl setHidden:(!isBlob)];
// Set window's min size since no segment and quicklook buttons are hidden
- if(isBlob) {
+ if (isBlob) {
[editSheet setFrameAutosaveName:@"SPFieldEditorBlobSheet"];
[editSheet setMinSize:NSMakeSize(560, 200)];
} else {