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