diff options
author | Stuart Connolly <stuart02@gmail.com> | 2014-05-26 23:01:08 +0100 |
---|---|---|
committer | Stuart Connolly <stuart02@gmail.com> | 2014-05-26 23:01:08 +0100 |
commit | f25c62d78bbd5d6fbe7a6fac09294317ccd3eeaf (patch) | |
tree | f9cdf6b0ef6bdac0ceb25283997aded6cf3e3906 /Source/SPIndexesController.m | |
parent | afadd0273178b5803b11ba69a37b6a1138771216 (diff) | |
download | sequelpro-f25c62d78bbd5d6fbe7a6fac09294317ccd3eeaf.tar.gz sequelpro-f25c62d78bbd5d6fbe7a6fac09294317ccd3eeaf.tar.bz2 sequelpro-f25c62d78bbd5d6fbe7a6fac09294317ccd3eeaf.zip |
Add a hidden preference to control the size of the UI's monospaced font.
Diffstat (limited to 'Source/SPIndexesController.m')
-rw-r--r-- | Source/SPIndexesController.m | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 49a19d1f..7236a977 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -132,17 +132,19 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; BOOL useMonospacedFont = NO; #endif + CGFloat monospacedFontSize = [prefs floatForKey:SPMonospacedFontSize] > 0 ? [prefs floatForKey:SPMonospacedFontSize] : [NSFont smallSystemFontSize]; + // Set the double-click action in blank areas of the table to create new rows [indexesTableView setEmptyDoubleClickAction:@selector(addIndex:)]; for (NSTableColumn *indexColumn in [indexesTableView tableColumns]) { - [[indexColumn dataCell] setFont:(useMonospacedFont) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [[indexColumn dataCell] setFont:useMonospacedFont ? [NSFont fontWithName:SPDefaultMonospacedFontName size:monospacedFontSize] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; } for (NSTableColumn *fieldColumn in [indexedColumnsTableView tableColumns]) { - [[fieldColumn dataCell] setFont:(useMonospacedFont) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [[fieldColumn dataCell] setFont:useMonospacedFont ? [NSFont fontWithName:SPDefaultMonospacedFontName size:monospacedFontSize] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; } #ifndef SP_CODA /* patch */ @@ -707,18 +709,20 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; else if ([keyPath isEqualToString:SPUseMonospacedFonts]) { BOOL useMonospacedFont = [[change objectForKey:NSKeyValueChangeNewKey] boolValue]; + CGFloat monospacedFontSize = [prefs floatForKey:SPMonospacedFontSize] > 0 ? [prefs floatForKey:SPMonospacedFontSize] : [NSFont smallSystemFontSize]; for (NSTableColumn *indexColumn in [indexesTableView tableColumns]) { - [[indexColumn dataCell] setFont:(useMonospacedFont) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [[indexColumn dataCell] setFont:useMonospacedFont ? [NSFont fontWithName:SPDefaultMonospacedFontName size:monospacedFontSize] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; } for (NSTableColumn *indexColumn in [indexedColumnsTableView tableColumns]) { - [[indexColumn dataCell] setFont:(useMonospacedFont) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [[indexColumn dataCell] setFont:useMonospacedFont ? [NSFont fontWithName:SPDefaultMonospacedFontName size:monospacedFontSize] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; } [indexesTableView reloadData]; + [self _reloadIndexedColumnsTableData]; } } |