aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-30 22:29:34 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-30 22:29:34 +0000
commit890247960876e8dd987dd44ec98da4300b6a0fd3 (patch)
treefe077fbf95d6599c88dc2c2f34494665452a32ef /Source/TableContent.m
parenta776a6437e40837cc2e20a9231e3eb8ef1a73ddf (diff)
downloadsequelpro-890247960876e8dd987dd44ec98da4300b6a0fd3.tar.gz
sequelpro-890247960876e8dd987dd44ec98da4300b6a0fd3.tar.bz2
sequelpro-890247960876e8dd987dd44ec98da4300b6a0fd3.zip
• CMTextView's colours are set via observer, live changed in editable textviews
• added Preference setting "Table font" in "Table" pane to set the table font/size for all result tables (Content, Custom Query) • added to SPTableView the method setFont: • fixed the initialisation of vars in CMTextView (fixes the displaying of create syntax)
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r--Source/TableContent.m20
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 64996349..0a397707 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -224,7 +224,6 @@
// Init copyTable with necessary information for copying selected rows as SQL INSERT
[tableContentView setTableInstance:self withTableData:tableValues withColumns:dataColumns withTableName:selectedTable withConnection:mySQLConnection];
-
// Post the notification that the query is finished
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance];
@@ -374,6 +373,8 @@
}
NSString *nullValue = [prefs objectForKey:SPNullValue];
+ NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPGlobalResultTableFont]];
+ [tableContentView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
// Add the new columns to the table
for ( i = 0 ; i < [dataColumns count] ; i++ ) {
@@ -419,7 +420,7 @@
}
// Set the data cell font according to the preferences
- [dataCell setFont:([prefs boolForKey:SPUseMonospacedFonts]) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+ [dataCell setFont:tableFont];
// Assign the data cell
[theCol setDataCell:dataCell];
@@ -3118,16 +3119,11 @@
if ([keyPath isEqualToString:SPDisplayTableViewVerticalGridlines]) {
[tableContentView setGridStyleMask:([[change objectForKey:NSKeyValueChangeNewKey] boolValue]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
}
- // Use monospaced fonts preference changed
- else if ([keyPath isEqualToString:SPUseMonospacedFonts]) {
-
- BOOL useMonospacedFont = [[change objectForKey:NSKeyValueChangeNewKey] boolValue];
-
- for (NSTableColumn *column in [tableContentView tableColumns])
- {
- [[column dataCell] setFont:(useMonospacedFont) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
- }
-
+ // Table font preference changed
+ else if ([keyPath isEqualToString:SPGlobalResultTableFont]) {
+ NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]];
+ [tableContentView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
+ [tableContentView setFont:tableFont];
[tableContentView reloadData];
}
}