mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:00:47 +00:00
Automatically mark the NSClipView as needing redisplay when the background
color - or the drawsBackground flag - changes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11631 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
733c73213c
commit
c23acc7a91
1 changed files with 29 additions and 18 deletions
|
@ -569,31 +569,42 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
||||||
|
|
||||||
- (void) setBackgroundColor: (NSColor*)aColor
|
- (void) setBackgroundColor: (NSColor*)aColor
|
||||||
{
|
{
|
||||||
ASSIGN (_backgroundColor, aColor);
|
if (![_backgroundColor isEqual: aColor])
|
||||||
|
|
||||||
if (_drawsBackground == NO || _backgroundColor == nil
|
|
||||||
|| [_backgroundColor alphaComponent] < 1.0)
|
|
||||||
{
|
{
|
||||||
_isOpaque = NO;
|
ASSIGN (_backgroundColor, aColor);
|
||||||
}
|
|
||||||
else
|
[self setNeedsDisplay: YES];
|
||||||
{
|
|
||||||
_isOpaque = YES;
|
if (_drawsBackground == NO || _backgroundColor == nil
|
||||||
|
|| [_backgroundColor alphaComponent] < 1.0)
|
||||||
|
{
|
||||||
|
_isOpaque = NO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_isOpaque = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setDrawsBackground:(BOOL)flag
|
- (void) setDrawsBackground:(BOOL)flag
|
||||||
{
|
{
|
||||||
_drawsBackground = flag;
|
if (_drawsBackground != flag)
|
||||||
|
{
|
||||||
|
_drawsBackground = flag;
|
||||||
|
|
||||||
if (_drawsBackground == NO || _backgroundColor == nil
|
[self setNeedsDisplay: YES];
|
||||||
|| [_backgroundColor alphaComponent] < 1.0)
|
|
||||||
{
|
if (_drawsBackground == NO || _backgroundColor == nil
|
||||||
_isOpaque = NO;
|
|| [_backgroundColor alphaComponent] < 1.0)
|
||||||
}
|
{
|
||||||
else
|
_isOpaque = NO;
|
||||||
{
|
}
|
||||||
_isOpaque = YES;
|
else
|
||||||
|
{
|
||||||
|
_isOpaque = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue