mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:00:46 +00:00
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:
parent
0ccefadb47
commit
dd460d8235
3 changed files with 11 additions and 61 deletions
|
@ -462,22 +462,19 @@
|
||||||
|
|
||||||
- (BOOL) isOpaque
|
- (BOOL) isOpaque
|
||||||
{
|
{
|
||||||
#if 1 //TESTPLANT-MAL-MERGE-06202015
|
|
||||||
// FIXME: Depends on theme; if always returning NO is a performance hit
|
// 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
|
// we can check if GSTheme is going to draw an old-style opaque box
|
||||||
// or not.
|
// or not.
|
||||||
return NO;
|
return NO;
|
||||||
#else
|
// if (_box_type == NSBoxCustom)
|
||||||
if (_box_type == NSBoxCustom)
|
// {
|
||||||
{
|
// return !_transparent;
|
||||||
return !_transparent;
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return YES;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSColor*) fillColor
|
- (NSColor*) fillColor
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
#import <Foundation/NSBundle.h>
|
#import <Foundation/NSBundle.h>
|
||||||
#import <Foundation/NSCoder.h>
|
#import <Foundation/NSCoder.h>
|
||||||
|
#import <Foundation/NSDebug.h>
|
||||||
#import <Foundation/NSDictionary.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
#import <Foundation/NSEnumerator.h>
|
#import <Foundation/NSEnumerator.h>
|
||||||
#import <Foundation/NSException.h>
|
#import <Foundation/NSException.h>
|
||||||
|
@ -281,6 +282,8 @@
|
||||||
|
|
||||||
- (NSString *) pathForNibResource: (NSString *)fileName
|
- (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];
|
NSMutableArray *array = [NSMutableArray arrayWithCapacity: 8];
|
||||||
NSArray *languages;
|
NSArray *languages;
|
||||||
NSString *rootPath = [self bundlePath];
|
NSString *rootPath = [self bundlePath];
|
||||||
|
|
|
@ -973,7 +973,6 @@ typedef struct _GSButtonCellFlags
|
||||||
buttonState = GSThemeDisabledState;
|
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
|
/* If we are first responder, change to the corresponding
|
||||||
first responder state. Note that GSThemeDisabledState
|
first responder state. Note that GSThemeDisabledState
|
||||||
doesn't have a first responder variant, currently. */
|
doesn't have a first responder variant, currently. */
|
||||||
|
@ -988,12 +987,10 @@ typedef struct _GSButtonCellFlags
|
||||||
else if (buttonState == GSThemeNormalState)
|
else if (buttonState == GSThemeNormalState)
|
||||||
buttonState = GSThemeFirstResponderState;
|
buttonState = GSThemeFirstResponderState;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return buttonState;
|
return buttonState;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
|
||||||
- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
|
- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
|
||||||
{
|
{
|
||||||
GSThemeControlState buttonState = [self themeControlState];
|
GSThemeControlState buttonState = [self themeControlState];
|
||||||
|
@ -1004,54 +1001,7 @@ typedef struct _GSButtonCellFlags
|
||||||
style: _bezel_style
|
style: _bezel_style
|
||||||
state: buttonState];
|
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
|
- (void) drawImage: (NSImage*)imageToDisplay
|
||||||
withFrame: (NSRect)cellFrame
|
withFrame: (NSRect)cellFrame
|
||||||
inView: (NSView*)controlView
|
inView: (NSView*)controlView
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue