Minor changes and cleanups.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15925 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-02-10 14:29:31 +00:00
parent 87a4e8d28d
commit 3b7c4e2a12
4 changed files with 50 additions and 11 deletions

View file

@ -1,3 +1,19 @@
2003-02-10 15:14 Alexander Malmberg <alexander@malmberg.org>
Based on patches from Jeff Teunissen:
* Source/NSWindow.m (GSAllWindows): Check that windowmaps isn't
NULL before calling NSAllMapTableValues.
* Source/NSScroller.m: Change size check so the knob and arrows are
visible until there's absolutely no space left for them. Draw the
knob slot with the window's background color when the knob isn't
visible for consistency with OPENSTEP.
* Source/NSApplication.m (-setApplicationIconImage:): Update all
windows that have the old app icon as their mini window image so they
use the new app icon.
2003-02-10 15:09 Alexander Malmberg <alexander@malmberg.org>
* Source/GSLayoutManager.m, Source/NSLayoutManager.m,

View file

@ -1645,16 +1645,35 @@ delegate.
return NO;
}
// Set the app's icon
/*
Sets the application's icon. Any windows that use the old application
icon image as their mini window image will be updated to use the new
image.
*/
- (void) setApplicationIconImage: (NSImage*)anImage
{
NSEnumerator *iterator = [[self windows] objectEnumerator];
NSWindow *current;
NSImage *old_app_icon = _app_icon;
RETAIN(old_app_icon);
[_app_icon setName: nil];
[anImage setName: @"NSApplicationIcon"];
ASSIGN(_app_icon, anImage);
if (_app_icon_window != nil)
{
[[_app_icon_window contentView] setImage: anImage];
}
// Swap the old image for the new one wherever it's used
while ((current = [iterator nextObject]) != nil)
{
if ([current miniwindowImage] == old_app_icon)
[current setMiniwindowImage: anImage],printf("update window %@\n",current);
}
DESTROY(old_app_icon);
}
- (NSImage*) applicationIconImage
@ -2404,7 +2423,7 @@ delegate.
return nil;
}
- (NSArray *) orderedWindows;
- (NSArray *) orderedWindows
{
// FIXME
return [self windows];
@ -2413,12 +2432,12 @@ delegate.
/*
* Methods for user attention requests
*/
- (void) cancelUserAttentionRequest: (int)request;
- (void) cancelUserAttentionRequest: (int)request
{
// FIXME
}
- (int) requestUserAttention: (NSRequestUserAttentionType)requestType;
- (int) requestUserAttention: (NSRequestUserAttentionType)requestType
{
// FIXME
return 0;

View file

@ -300,11 +300,10 @@ static NSColor *scrollBarColor = nil;
{
NSSize frameSize = _frame.size;
float size = (_isHorizontal ? frameSize.width : frameSize.height);
float scrollerWidth = [isa scrollerWidth];
if (_arrowsPosition == NSScrollerArrowsNone)
{
if (size >= scrollerWidth + 2)
if (size >= buttonsWidth + 3)
{
_usableParts = NSAllScrollerParts;
}
@ -315,11 +314,11 @@ static NSColor *scrollBarColor = nil;
}
else
{
if (size >= 3 * scrollerWidth + 4)
if (size >= 4 /* spacing */ + 1 /* min. scroll area */ + buttonsWidth * 3)
{
_usableParts = NSAllScrollerParts;
}
else if (size >= 2 * scrollerWidth + 3)
else if (size >= 3 /* spacing */ + buttonsWidth * 2)
{
_usableParts = NSOnlyScrollerArrows;
}
@ -820,7 +819,10 @@ static NSColor *scrollBarColor = nil;
rect = [self rectForPart: NSScrollerKnobSlot];
}
[scrollBarColor set];
if ((_usableParts == NSOnlyScrollerArrows) || (_usableParts == NSNoScrollerParts))
[[_window backgroundColor] set];
else
[scrollBarColor set];
NSRectFill (rect);
}
@ -850,7 +852,7 @@ static NSColor *scrollBarColor = nil;
float width, height;
float buttonsSize = 2 * buttonsWidth + 2;
NSUsableScrollerParts usableParts;
/*
/*
* If the scroller is disabled then the scroller buttons and the
* knob are not displayed at all.
*/

View file

@ -4148,7 +4148,9 @@ void NSWindowList(int size, int list[])
NSArray* GSAllWindows(void)
{
return NSAllMapTableValues(windowmaps);
if (windowmaps)
return NSAllMapTableValues(windowmaps);
return nil;
}
NSWindow* GSWindowWithNumber(int num)