mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 12:00:45 +00:00
Declare a few MacOSX 10.5 methods and make
the background of the NSSplitView transparent by default. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33139 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8e6b334c1d
commit
4b080ec8b8
3 changed files with 58 additions and 12 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-05-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSSplitView.h
|
||||
* Source/NSSplitView.m: Declare a few MacOSX 10.5 methods and make
|
||||
the background transparent by default.
|
||||
|
||||
2011-05-26 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSImage.m (-nativeDrawInRect:...): Fix drawing images
|
||||
|
|
|
@ -34,6 +34,14 @@
|
|||
|
||||
@class NSImage, NSColor, NSNotification;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
enum {
|
||||
NSSplitViewDividerStyleThick = 1,
|
||||
NSSplitViewDividerStyleThin = 2,
|
||||
};
|
||||
typedef NSInteger NSSplitViewDividerStyle;
|
||||
#endif
|
||||
|
||||
@interface NSSplitView : NSView
|
||||
{
|
||||
id _delegate;
|
||||
|
@ -71,6 +79,10 @@
|
|||
- (CGFloat) maxPossiblePositionOfDividerAtIndex: (NSInteger)dividerIndex;
|
||||
- (CGFloat) minPossiblePositionOfDividerAtIndex: (NSInteger)dividerIndex;
|
||||
- (void) setPosition: (CGFloat)position ofDividerAtIndex: (NSInteger)dividerIndex;
|
||||
|
||||
- (NSColor *) dividerColor;
|
||||
- (NSSplitViewDividerStyle) dividerStyle;
|
||||
- (void) setDividerStyle: (NSSplitViewDividerStyle)dividerStyle;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
@ -87,9 +99,7 @@
|
|||
- (NSImage *) dimpleImage;
|
||||
- (NSColor *) backgroundColor;
|
||||
- (void) setBackgroundColor: (NSColor *)aColor;
|
||||
- (NSColor *) dividerColor;
|
||||
- (void) setDividerColor: (NSColor *)aColor;
|
||||
|
||||
@end
|
||||
#endif
|
||||
|
||||
|
@ -122,6 +132,22 @@ constrainMinCoordinate: (float)proposedMin
|
|||
ofSubviewAt: (int)offset;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
|
||||
- (NSRect) splitView: (NSSplitView *)splitView
|
||||
additionalEffectiveRectOfDividerAtIndex: (NSInteger)dividerIndex;
|
||||
|
||||
- (NSRect) splitView: (NSSplitView *)splitView
|
||||
effectiveRect: (NSRect)proposedEffectiveRect
|
||||
forDrawnRect: (NSRect)drawnRect
|
||||
ofDividerAtIndex: (NSInteger)dividerIndex;
|
||||
|
||||
- (BOOL) splitView: (NSSplitView *)splitView
|
||||
shouldCollapseSubview: (NSView *)subview
|
||||
forDoubleClickOnDividerAtIndex: (NSInteger)dividerIndex;
|
||||
|
||||
- (BOOL) splitView: (NSSplitView *)splitView
|
||||
shouldHideDividerAtIndex: (NSInteger)dividerIndex;
|
||||
#endif
|
||||
@end
|
||||
|
||||
/* Notifications */
|
||||
|
|
|
@ -74,7 +74,6 @@ static NSNotificationCenter *nc = nil;
|
|||
_draggedBarWidth = 8; // default bigger than dividerThickness
|
||||
_isVertical = NO;
|
||||
ASSIGN(_dividerColor, [NSColor controlShadowColor]);
|
||||
ASSIGN(_backgroundColor, [NSColor controlBackgroundColor]);
|
||||
ASSIGN(_dimpleImage, [NSImage imageNamed: @"common_Dimple"]);
|
||||
|
||||
_never_displayed_before = YES;
|
||||
|
@ -1190,7 +1189,7 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
|||
|
||||
- (BOOL) isOpaque
|
||||
{
|
||||
return YES;
|
||||
return (_backgroundColor != nil);
|
||||
}
|
||||
|
||||
- (void) resizeSubviewsWithOldSize: (NSSize) oldSize
|
||||
|
@ -1280,13 +1279,30 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
|||
}
|
||||
}
|
||||
|
||||
- (NSColor*) dividerColor
|
||||
{
|
||||
return _dividerColor;
|
||||
}
|
||||
|
||||
- (NSSplitViewDividerStyle) dividerStyle
|
||||
{
|
||||
// FIXME
|
||||
return NSSplitViewDividerStyleThick;
|
||||
}
|
||||
|
||||
- (void) setDividerStyle: (NSSplitViewDividerStyle)dividerStyle
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
/*
|
||||
* NSCoding protocol
|
||||
*/
|
||||
- (void) encodeWithCoder: (NSCoder *)aCoder
|
||||
{
|
||||
[super encodeWithCoder: aCoder];
|
||||
if([aCoder allowsKeyedCoding])
|
||||
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
[aCoder encodeBool: _isVertical forKey: @"NSIsVertical"];
|
||||
[aCoder encodeObject: _autosaveName forKey: @"NSAutosaveName"];
|
||||
|
@ -1316,7 +1332,11 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
|||
- (id) initWithCoder: (NSCoder *)aDecoder
|
||||
{
|
||||
self = [super initWithCoder: aDecoder];
|
||||
|
||||
if (self == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
id subview = nil;
|
||||
|
@ -1335,7 +1355,6 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
|||
_dividerWidth = [self dividerThickness];
|
||||
_draggedBarWidth = 8; // default bigger than dividerThickness
|
||||
ASSIGN(_dividerColor, [NSColor controlShadowColor]);
|
||||
ASSIGN(_backgroundColor, [NSColor controlBackgroundColor]);
|
||||
ASSIGN(_dimpleImage, [NSImage imageNamed: @"common_Dimple"]);
|
||||
_never_displayed_before = YES;
|
||||
_is_pane_splitter = YES;
|
||||
|
@ -1421,11 +1440,6 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
|||
ASSIGN(_backgroundColor, aColor);
|
||||
}
|
||||
|
||||
- (NSColor*) dividerColor
|
||||
{
|
||||
return _dividerColor;
|
||||
}
|
||||
|
||||
- (void) setDividerColor: (NSColor*) aColor
|
||||
{
|
||||
ASSIGN(_dividerColor, aColor);
|
||||
|
|
Loading…
Reference in a new issue