mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 02:50:48 +00:00
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:
parent
6576a77429
commit
8335596ee3
4 changed files with 47 additions and 22 deletions
15
ChangeLog
15
ChangeLog
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
// 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];
|
||||
{
|
||||
NSRect newFrame;
|
||||
|
||||
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 */
|
||||
_frame.origin = [theEvent locationInWindow];
|
||||
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];
|
||||
}
|
||||
{
|
||||
NSRect rect = _frame;
|
||||
|
||||
rect.origin = NSZeroPoint;
|
||||
[_wv setFrame: rect];
|
||||
[_wv setNeedsDisplay: YES];
|
||||
}
|
||||
[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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue