mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +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
|
@ -1,3 +1,10 @@
|
|||
2010-01-31 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* 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 <ewasylishen@gmail.com>
|
||||
|
||||
* Source/GSTheme.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
|
||||
|
|
Loading…
Reference in a new issue