From b2bc86196a13f63cf91e071fdb1a11a076face48 Mon Sep 17 00:00:00 2001 From: ericwa Date: Mon, 1 Feb 2010 05:27:01 +0000 Subject: [PATCH] * Source/GSThemeDrawing.m: Use theme tiles (if available) to draw segmented controls, chosen based on the segment style constant, and falling back to drawing buttons if the segment tiles are not available. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29452 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/GSThemeDrawing.m | 32 +++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b339d04b2..c7ecdcbd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-01-31 Eric Wasylishen + + * Source/GSThemeDrawing.m: Use theme tiles (if available) + to draw segmented controls, chosen based on the segment style constant, + and falling back to drawing buttons if the segment tiles are not + available. + 2010-01-29 Eric Wasylishen * Source/GSTheme.m: diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 85da4da33..35a1fda11 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -684,11 +684,33 @@ roundedLeft: (BOOL)roundedLeft roundedRight: (BOOL)roundedRight { - [[GSTheme theme] drawButton: cellFrame - in: cell - view: controlView - style: NSRegularSquareBezelStyle - state: state]; + GSDrawTiles *tiles; + NSString *name = GSStringFromSegmentStyle(style); + if (roundedLeft) + { + name = [name stringByAppendingString: @"RoundedLeft"]; + } + if (roundedRight) + { + name = [name stringByAppendingString: @"RoundedRight"]; + } + + tiles = [self tilesNamed: name state: state]; + + if (tiles == nil) + { + [self drawButton: cellFrame + in: cell + view: controlView + style: NSRegularSquareBezelStyle + state: state]; + } + else + { + [self fillRect: cellFrame + withTiles: tiles + background: [NSColor clearColor]]; + } } - (void) drawImage: (NSImage *)image