From 2d722887095bb2eca1b0ab9bbaf04c9da2416765 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 10 Jun 2009 10:20:01 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20issue=20that=20after=20changing=20t?= =?UTF-8?q?he=20pref=20"Use=20monospaced=20fonts"=20the=20table=20structur?= =?UTF-8?q?e=20view=20did=20not=20recognize=20the=20change=20after=20a=20r?= =?UTF-8?q?eload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableSource.m | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Source') 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]; -- cgit v1.2.3