Preliminary support for themeing the window resize bar with tiles.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29456 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2010-02-01 08:41:04 +00:00
parent 1e62a48e11
commit e42a857b66
2 changed files with 47 additions and 30 deletions

View file

@ -1,3 +1,8 @@
2010-02-01 Eric Wasylishen <ewasylishen@gmail.com>
* Source/GSThemeDrawing.m: Preliminary support for themeing the window
resize bar with tiles.
2010-02-01 Eric Wasylishen <ewasylishen@gmail.com> 2010-02-01 Eric Wasylishen <ewasylishen@gmail.com>
* Source/GSTheme.m: * Source/GSTheme.m:

View file

@ -1211,46 +1211,58 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
} }
} }
// FIXME: Would be good if this took the window as a param
- (void) drawResizeBarRect: (NSRect)resizeBarRect - (void) drawResizeBarRect: (NSRect)resizeBarRect
{ {
[[NSColor lightGrayColor] set]; GSDrawTiles *tiles;
PSrectfill(1.0, 1.0, resizeBarRect.size.width - 2.0, RESIZE_HEIGHT - 3.0); tiles = [self tilesNamed: @"GSWindowResizeBar" state: GSThemeNormalState];
if (tiles == nil)
{
[[NSColor lightGrayColor] set];
PSrectfill(1.0, 1.0, resizeBarRect.size.width - 2.0, RESIZE_HEIGHT - 3.0);
PSsetlinewidth(1.0); PSsetlinewidth(1.0);
[[NSColor blackColor] set]; [[NSColor blackColor] set];
PSmoveto(0.0, 0.5); PSmoveto(0.0, 0.5);
PSlineto(resizeBarRect.size.width, 0.5); PSlineto(resizeBarRect.size.width, 0.5);
PSstroke(); PSstroke();
[[NSColor darkGrayColor] set]; [[NSColor darkGrayColor] set];
PSmoveto(1.0, RESIZE_HEIGHT - 0.5); PSmoveto(1.0, RESIZE_HEIGHT - 0.5);
PSlineto(resizeBarRect.size.width - 1.0, RESIZE_HEIGHT - 0.5); PSlineto(resizeBarRect.size.width - 1.0, RESIZE_HEIGHT - 0.5);
PSstroke(); PSstroke();
[[NSColor whiteColor] set]; [[NSColor whiteColor] set];
PSmoveto(1.0, RESIZE_HEIGHT - 1.5); PSmoveto(1.0, RESIZE_HEIGHT - 1.5);
PSlineto(resizeBarRect.size.width - 1.0, RESIZE_HEIGHT - 1.5); PSlineto(resizeBarRect.size.width - 1.0, RESIZE_HEIGHT - 1.5);
PSstroke(); PSstroke();
/* Only draw the notches if there's enough space. */ /* Only draw the notches if there's enough space. */
if (resizeBarRect.size.width < 30 * 2) if (resizeBarRect.size.width < 30 * 2)
return; return;
[[NSColor darkGrayColor] set]; [[NSColor darkGrayColor] set];
PSmoveto(27.5, 1.0); PSmoveto(27.5, 1.0);
PSlineto(27.5, RESIZE_HEIGHT - 2.0); PSlineto(27.5, RESIZE_HEIGHT - 2.0);
PSmoveto(resizeBarRect.size.width - 28.5, 1.0); PSmoveto(resizeBarRect.size.width - 28.5, 1.0);
PSlineto(resizeBarRect.size.width - 28.5, RESIZE_HEIGHT - 2.0); PSlineto(resizeBarRect.size.width - 28.5, RESIZE_HEIGHT - 2.0);
PSstroke(); PSstroke();
[[NSColor whiteColor] set]; [[NSColor whiteColor] set];
PSmoveto(28.5, 1.0); PSmoveto(28.5, 1.0);
PSlineto(28.5, RESIZE_HEIGHT - 2.0); PSlineto(28.5, RESIZE_HEIGHT - 2.0);
PSmoveto(resizeBarRect.size.width - 27.5, 1.0); PSmoveto(resizeBarRect.size.width - 27.5, 1.0);
PSlineto(resizeBarRect.size.width - 27.5, RESIZE_HEIGHT - 2.0); PSlineto(resizeBarRect.size.width - 27.5, RESIZE_HEIGHT - 2.0);
PSstroke(); PSstroke();
}
else
{
[self fillRect: resizeBarRect
withTiles: tiles
background: [NSColor clearColor]];
}
} }
- (void) drawWindowBorder: (NSRect)rect - (void) drawWindowBorder: (NSRect)rect