NSBox, NSBundleAdditions and NSButtonCell merges

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38706 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2015-06-26 17:34:42 +00:00
parent 0ccefadb47
commit dd460d8235
3 changed files with 11 additions and 61 deletions

View file

@ -462,22 +462,19 @@
- (BOOL) isOpaque
{
#if 1 //TESTPLANT-MAL-MERGE-06202015
// FIXME: Depends on theme; if always returning NO is a performance hit
// we can check if GSTheme is going to draw an old-style opaque box
// or not.
return NO;
#else
if (_box_type == NSBoxCustom)
{
return !_transparent;
// if (_box_type == NSBoxCustom)
// {
// return !_transparent;
// }
// else
// {
// return YES;
// }
}
else
{
return YES;
}
#endif
}
- (NSColor*) fillColor
{

View file

@ -34,6 +34,7 @@
#import <Foundation/NSArray.h>
#import <Foundation/NSBundle.h>
#import <Foundation/NSCoder.h>
#import <Foundation/NSDebug.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSException.h>
@ -281,6 +282,8 @@
- (NSString *) pathForNibResource: (NSString *)fileName
{
// Testplant-MAL-2015-06-26: This seems like a testplant fix
// so keeping over the main branches version...
NSMutableArray *array = [NSMutableArray arrayWithCapacity: 8];
NSArray *languages;
NSString *rootPath = [self bundlePath];

View file

@ -973,7 +973,6 @@ typedef struct _GSButtonCellFlags
buttonState = GSThemeDisabledState;
}
#if 0 // Testplant-MAL-2015-06-20: Merged but causes button to show up depressed???
/* If we are first responder, change to the corresponding
first responder state. Note that GSThemeDisabledState
doesn't have a first responder variant, currently. */
@ -988,12 +987,10 @@ typedef struct _GSButtonCellFlags
else if (buttonState == GSThemeNormalState)
buttonState = GSThemeFirstResponderState;
}
#endif
return buttonState;
}
#if 1
- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
{
GSThemeControlState buttonState = [self themeControlState];
@ -1004,54 +1001,7 @@ typedef struct _GSButtonCellFlags
style: _bezel_style
state: buttonState];
}
#else
- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
{
unsigned mask;
GSThemeControlState buttonState = GSThemeNormalState;
// set the mask
if (_cell.is_highlighted)
{
mask = _highlightsByMask;
if (_cell.state)
{
mask &= ~_showAltStateMask;
}
}
else if (_cell.state)
mask = _showAltStateMask;
else
mask = NSNoCellMask;
/* Determine the background color.
We draw when there is a border or when highlightsByMask
is NSChangeBackgroundCellMask or NSChangeGrayCellMask,
as required by our nextstep-like look and feel. */
if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask))
{
buttonState = GSThemeHighlightedState;
}
/* Pushed in buttons contents are displaced to the bottom right 1px. */
if (mask & NSPushInCellMask)
{
buttonState = GSThemeSelectedState;
}
if (_cell.is_disabled && buttonState != GSThemeHighlightedState)
{
buttonState = GSThemeDisabledState;
}
[[GSTheme theme] drawButton: cellFrame
in: self
view: controlView
style: _bezel_style
state: buttonState];
}
#endif
- (void) drawImage: (NSImage*)imageToDisplay
withFrame: (NSRect)cellFrame
inView: (NSView*)controlView