aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableSource.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-10 10:20:01 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-10 10:20:01 +0000
commit2d722887095bb2eca1b0ab9bbaf04c9da2416765 (patch)
tree93dc2bebd3f9753021d2cbf9c4fbbaee19117ad9 /Source/TableSource.m
parenta8dc260fef27d0a8147ecf56fe98c9132f4cc160 (diff)
downloadsequelpro-2d722887095bb2eca1b0ab9bbaf04c9da2416765.tar.gz
sequelpro-2d722887095bb2eca1b0ab9bbaf04c9da2416765.tar.bz2
sequelpro-2d722887095bb2eca1b0ab9bbaf04c9da2416765.zip
• fixed issue that after changing the pref "Use monospaced fonts" the table structure view did not recognize the change after a reload
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r--Source/TableSource.m21
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m
index afa17055..20a7ae11 100644
--- a/Source/TableSource.m
+++ b/Source/TableSource.m
@@ -208,7 +208,26 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab
} else {
[indexedColumnsField setNumberOfVisibleItems:10];
}
-
+
+ // Reset font for field and index table
+ NSEnumerator *indexColumnsEnumerator = [[indexView tableColumns] objectEnumerator];
+ NSEnumerator *fieldColumnsEnumerator = [[tableSourceView tableColumns] objectEnumerator];
+ id indexColumn;
+ id fieldColumn;
+ BOOL useMonospacedFont = [prefs boolForKey:@"UseMonospacedFonts"];
+
+ while ( (indexColumn = [indexColumnsEnumerator nextObject]) )
+ if ( useMonospacedFont )
+ [[indexColumn dataCell] setFont:[NSFont fontWithName:@"Monaco" size:10]];
+ else
+ [[indexColumn dataCell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+
+ while ( (fieldColumn = [fieldColumnsEnumerator nextObject]) )
+ if ( useMonospacedFont )
+ [[fieldColumn dataCell] setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]];
+ else
+ [[fieldColumn dataCell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+
[tableSourceView reloadData];
[indexView reloadData];