mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Allow customization of window title text color for key/normal/main windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29593 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8d25516577
commit
e7e2c06ef5
2 changed files with 37 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2010-02-12 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/GSThemeDrawing.m: Allow customization of window title text
|
||||
color for key/normal/main windows. New color names are:
|
||||
|
||||
keyWindowFrameTextColor
|
||||
normalWindowFrameTextColor
|
||||
mainWindowFrameTextColor
|
||||
|
||||
2010-02-12 German Arias <german@xelalug.org>
|
||||
|
||||
* Source/GSTitleView.m: Search in theme colors: GSMenuBar and
|
||||
|
|
|
@ -1153,28 +1153,53 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
if (!titleTextAttributes[0])
|
||||
{
|
||||
NSMutableParagraphStyle *p;
|
||||
NSColor *keyColor, *normalColor, *mainColor;
|
||||
|
||||
p = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
[p setLineBreakMode: NSLineBreakByClipping];
|
||||
|
||||
// FIXME: refine color names based on style mask
|
||||
// (HUD or textured or regular window)
|
||||
|
||||
keyColor = [self colorNamed: @"keyWindowFrameTextColor"
|
||||
state: GSThemeNormalState];
|
||||
if (nil == keyColor)
|
||||
{
|
||||
keyColor = [NSColor windowFrameTextColor];
|
||||
}
|
||||
|
||||
normalColor = [self colorNamed: @"normalWindowFrameTextColor"
|
||||
state: GSThemeNormalState];
|
||||
if (nil == normalColor)
|
||||
{
|
||||
normalColor = [NSColor blackColor];
|
||||
}
|
||||
|
||||
mainColor = [self colorNamed: @"mainWindowFrameTextColor"
|
||||
state: GSThemeNormalState];
|
||||
if (nil == mainColor)
|
||||
{
|
||||
mainColor = [NSColor windowFrameTextColor];
|
||||
}
|
||||
|
||||
titleTextAttributes[0] = [[NSMutableDictionary alloc]
|
||||
initWithObjectsAndKeys:
|
||||
[NSFont titleBarFontOfSize: 0], NSFontAttributeName,
|
||||
[NSColor windowFrameTextColor], NSForegroundColorAttributeName,
|
||||
keyColor, NSForegroundColorAttributeName,
|
||||
p, NSParagraphStyleAttributeName,
|
||||
nil];
|
||||
|
||||
titleTextAttributes[1] = [[NSMutableDictionary alloc]
|
||||
initWithObjectsAndKeys:
|
||||
[NSFont titleBarFontOfSize: 0], NSFontAttributeName,
|
||||
[NSColor blackColor], NSForegroundColorAttributeName, /* TODO: need a named color for this */
|
||||
normalColor, NSForegroundColorAttributeName,
|
||||
p, NSParagraphStyleAttributeName,
|
||||
nil];
|
||||
|
||||
titleTextAttributes[2] = [[NSMutableDictionary alloc]
|
||||
initWithObjectsAndKeys:
|
||||
[NSFont titleBarFontOfSize: 0], NSFontAttributeName,
|
||||
[NSColor windowFrameTextColor], NSForegroundColorAttributeName,
|
||||
mainColor, NSForegroundColorAttributeName,
|
||||
p, NSParagraphStyleAttributeName,
|
||||
nil];
|
||||
|
||||
|
|
Loading…
Reference in a new issue