mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:50:37 +00:00
* 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
This commit is contained in:
parent
7225f6e380
commit
5b680cf5d2
2 changed files with 34 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue