mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 06:30:38 +00:00
* Headers/Additions/GNUstepGUI/GSTheme.h: Add declaration
for method setKeyEquivalent:forButtonCell: * Source/GSThemeDrawing.m: Add implementation for method setKeyEquivalent:forButtonCell: * Source/NSButtonCell.m: Add call to new method. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35702 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9cd6adf8a6
commit
f248bc9988
4 changed files with 34 additions and 14 deletions
|
@ -77,6 +77,23 @@
|
|||
@end
|
||||
|
||||
@implementation GSTheme (Drawing)
|
||||
- (void) setKeyEquivalent: (NSString *)key
|
||||
forButtonCell: (NSButtonCell *)cell
|
||||
{
|
||||
if([cell image] == nil && ([key isEqualToString:@"\r"] ||
|
||||
[key isEqualToString:@"\n"]))
|
||||
{
|
||||
[cell setImagePosition: NSImageRight];
|
||||
[cell setImage: [NSImage imageNamed:@"common_ret"]];
|
||||
[cell setAlternateImage: [NSImage imageNamed:@"common_retH"]];
|
||||
}
|
||||
else if([key isEqualToString:@"\r"] == NO &&
|
||||
[key isEqualToString:@"\n"] == NO)
|
||||
{
|
||||
[cell setImage: nil];
|
||||
[cell setAlternateImage: nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) drawButton: (NSRect)frame
|
||||
in: (NSCell*)cell
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue