mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 18:50:48 +00:00
added support for home directory image
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13262 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0b313c5e97
commit
e66c02b88e
1 changed files with 26 additions and 2 deletions
|
@ -48,6 +48,7 @@
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSView.h>
|
#include <AppKit/NSView.h>
|
||||||
|
#include <AppKit/NSPanel.h>
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
#include <AppKit/NSScreen.h>
|
#include <AppKit/NSScreen.h>
|
||||||
#include <AppKit/GSServicesManager.h>
|
#include <AppKit/GSServicesManager.h>
|
||||||
|
@ -174,6 +175,7 @@ static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
|
||||||
- (NSImage*) _getImageWithName: (NSString*)name
|
- (NSImage*) _getImageWithName: (NSString*)name
|
||||||
alternate: (NSString*)alternate;
|
alternate: (NSString*)alternate;
|
||||||
- (NSImage*) folderImage;
|
- (NSImage*) folderImage;
|
||||||
|
- (NSImage*) homeDirectoryImage;
|
||||||
- (NSImage*) unknownFiletypeImage;
|
- (NSImage*) unknownFiletypeImage;
|
||||||
- (NSImage*) rootImage;
|
- (NSImage*) rootImage;
|
||||||
- (NSImage*) _iconForExtension: (NSString*)ext;
|
- (NSImage*) _iconForExtension: (NSString*)ext;
|
||||||
|
@ -683,9 +685,17 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
if (image == nil || image == [self unknownFiletypeImage])
|
if (image == nil || image == [self unknownFiletypeImage])
|
||||||
{
|
{
|
||||||
if ([aPath isEqual: _rootPath])
|
if ([aPath isEqual: _rootPath])
|
||||||
image = [self rootImage];
|
{
|
||||||
|
image = [self rootImage];
|
||||||
|
}
|
||||||
|
else if ([aPath isEqual: NSHomeDirectory ()])
|
||||||
|
{
|
||||||
|
image = [self homeDirectoryImage];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
image = [self folderImage];
|
{
|
||||||
|
image = [self folderImage];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1326,6 +1336,20 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the default icon to display for the user home directory */
|
||||||
|
- (NSImage*) homeDirectoryImage
|
||||||
|
{
|
||||||
|
static NSImage *image = nil;
|
||||||
|
|
||||||
|
if (image == nil)
|
||||||
|
{
|
||||||
|
image = RETAIN([self _getImageWithName: @"HomeDirectory.tiff"
|
||||||
|
alternate: @"common_HomeDirectory.tiff"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns the default icon to display for a directory */
|
/** Returns the default icon to display for a directory */
|
||||||
- (NSImage*) unknownFiletypeImage
|
- (NSImage*) unknownFiletypeImage
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue