Use console font for the view

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@38451 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2015-04-07 21:17:14 +00:00
parent 03d439d49c
commit be1775dc44
2 changed files with 28 additions and 2 deletions

View file

@ -3,6 +3,9 @@
* Modules/Editors/ProjectCenter/PCEditorView.m
Use constants and not strings as keys.
* Modules/Debuggers/ProjectCenter/PCDebugger.m
Use console font for the view.
2015-03-22 Riccardo Mottola <rm@gnu.org>
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m

View file

@ -1,7 +1,7 @@
/*
** PCDebugger
**
** Copyright (c) 2008
** Copyright (c) 2008-2015
**
** Author: Gregory Casamento <greg_casamento@yahoo.com>
**
@ -24,6 +24,8 @@
#import "PCDebugger.h"
#import "PCDebuggerView.h"
#import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h"
#ifndef NOTIFICATION_CENTER
#define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter]
#endif
@ -95,6 +97,27 @@ static NSImage *downImage = nil;
}
}
+ (NSFont *)defaultConsoleFont
{
NSUserDefaults *df = [NSUserDefaults standardUserDefaults];
NSString *fontName;
float fontSize;
NSFont *font = nil;
fontName = [df objectForKey:ConsoleFixedFont];
fontSize = [df floatForKey:ConsoleFixedFontSize];
if (fontName != nil && fontSize > 0)
{
font = [NSFont fontWithName:fontName size:fontSize];
}
if (font == nil)
{
font = [NSFont userFixedPitchFontOfSize:0];
}
return font;
}
- (id) init
{
if((self = [super init]) != nil)
@ -141,7 +164,7 @@ static NSImage *downImage = nil;
[debuggerWindow setToolbar: toolbar];
RELEASE(toolbar);
[debuggerView setFont: [NSFont userFixedPitchFontOfSize: 0]];
[debuggerView setFont: [PCDebugger defaultConsoleFont]];
[debuggerWindow setFrameAutosaveName: @"PCDebuggerWindow"];
[self setStatus: @"Idle."];
}