Make -setBackgroundColor: redisplay the window background. Fix frame constraining.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19785 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2004-07-28 17:56:57 +00:00
parent 6576a77429
commit 8335596ee3
4 changed files with 47 additions and 22 deletions

View file

@ -1,3 +1,18 @@
2004-07-28 19:52 Alexander Malmberg <alexander@malmberg.org>
* Source/GSWindowDecorationView.h, Source/GSWindowDecorationView.m
(-setBackgroundColor:): New method.
* Source/NSWindow.m (-setBackgroundColor:): Pass the call along to
_wv.
(-orderWindow:relativeTo:): Use -setFrame:display: to change the
frame after contstraining it.
(-constrainFrameRect:toScreen:): Fix the check of whether the bottom
of the window is off the screen.
(-_sendEvent:becomesKeyOnlyIfNeeded:): Clean up handling of
GSAppKitWindowResized.
(-initWithCoder:): Destroy _miniaturizedImage before setting it to
the decoded image.
2004-07-27 Quentin Mathe <qmathe@club-internet.fr>
* Headers/Additions/GNUstepGUI/GSToolbarView.h:

View file

@ -75,6 +75,7 @@ windowNumber will be 0.
-(void) setTitle: (NSString *)title;
-(void) setInputState: (int)state;
-(void) setDocumentEdited: (BOOL)flag;
-(void) setBackgroundColor: (NSColor *)color;
@end

View file

@ -223,6 +223,11 @@ Returns the content rect for a given window frame.
[GSServerForWindow(window) docedited: documentEdited : windowNumber];
}
-(void) setBackgroundColor: (NSColor *)color
{
[self setNeedsDisplayInRect: contentRect];
}
- (BOOL) isOpaque
{

View file

@ -1012,6 +1012,7 @@ many times.
- (void) setBackgroundColor: (NSColor*)color
{
ASSIGN(_backgroundColor, color);
[_wv setBackgroundColor: color];
}
- (void) setRepresentedFilename: (NSString*)aString
@ -1493,10 +1494,7 @@ many times.
{
NSRect nframe = [self constrainFrameRect: _frame
toScreen: [self screen]];
if (_windowNum)
[self setFrame: nframe display: NO];
else
_frame = nframe;
[self setFrame: nframe display: NO];
}
// create deferred window
if (_windowNum == 0)
@ -1696,7 +1694,7 @@ many times.
{
frameRect.origin.y -= difference;
}
else if (NSMaxY (frameRect) < NSMinY (screenRect))
else if (NSMinY (frameRect) < NSMinY (screenRect))
{
float diff1 = NSMinY (frameRect) - NSMinY (screenRect);
/* move bottom inside the screen, but keep top inside screen */
@ -3116,26 +3114,30 @@ resetCursorRectsForView(NSView *theView)
break;
case GSAppKitWindowResized:
_frame.size.width = (float)[theEvent data1];
_frame.size.height = (float)[theEvent data2];
/* Resize events always move the frame origin. The new origin
is stored in the event location field */
_frame.origin = [theEvent locationInWindow];
if (_autosaveName != nil)
{
[self saveFrameUsingName: _autosaveName];
}
{
NSRect rect = _frame;
NSRect newFrame;
rect.origin = NSZeroPoint;
[_wv setFrame: rect];
newFrame.size.width = [theEvent data1];
newFrame.size.height = [theEvent data2];
/* Resize events always move the frame origin. The new origin
is stored in the event location field. */
newFrame.origin = [theEvent locationInWindow];
_frame = newFrame;
newFrame.origin = NSZeroPoint;
[_wv setFrame: newFrame];
[_wv setNeedsDisplay: YES];
if (_autosaveName != nil)
{
[self saveFrameUsingName: _autosaveName];
}
[self _processResizeEvent];
[nc postNotificationName: NSWindowDidResizeNotification
object: self];
break;
}
[self _processResizeEvent];
[nc postNotificationName: NSWindowDidResizeNotification
object: self];
break;
case GSAppKitWindowClose:
[self performClose: NSApp];
@ -4078,6 +4080,8 @@ resetCursorRectsForView(NSView *theView)
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
[self setAcceptsMouseMovedEvents: flag];
/* _miniaturizedImage has already been set by -_initDefaults. */
DESTROY(_miniaturizedImage);
[aDecoder decodeValueOfObjCType: @encode(id)
at: &_miniaturizedImage];
[aDecoder decodeValueOfObjCType: @encode(id)