[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Home directory support and icon for GNUstep
From: |
Jeff Teunissen |
Subject: |
Home directory support and icon for GNUstep |
Date: |
Sat, 09 Mar 2002 05:57:09 -0500 |
A small amount of work done on NSWorkspace. The icon it uses is kind of ugly,
but it's free.
--
| Jeff Teunissen -=- Pres., Dusk To Dawn Computing -=- deek @ d2dc.net
| GPG: 1024D/9840105A 7102 808A 7733 C2F3 097B 161B 9222 DAB8 9840 105A
| Core developer, The QuakeForge Project http://www.quakeforge.net/
| Specializing in Debian GNU/Linux http://www.d2dc.net/~deek/
Index: Images/GNUmakefile
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Images/GNUmakefile,v
retrieving revision 1.28
diff -u -r1.28 GNUmakefile
--- Images/GNUmakefile 3 Mar 2002 05:58:51 -0000 1.28
+++ Images/GNUmakefile 9 Mar 2002 10:50:57 -0000
@@ -52,6 +52,7 @@
common_ColorSwatch.tiff \
common_2DDash.tiff \
common_Home.tiff \
+common_HomeDirectory.tiff \
common_Mount.tiff \
common_Unmount.tiff \
common_RadioOn.tiff \
Index: Source/NSWorkspace.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/NSWorkspace.m,v
retrieving revision 1.47
diff -u -r1.47 NSWorkspace.m
--- Source/NSWorkspace.m 22 Jan 2002 18:23:56 -0000 1.47
+++ Source/NSWorkspace.m 9 Mar 2002 10:50:59 -0000
@@ -175,6 +175,7 @@
- (NSImage*) folderImage;
- (NSImage*) unknownFiletypeImage;
- (NSImage*) rootImage;
+- (NSImage*) homeDirectoryImage;
- (NSImage*) _iconForExtension: (NSString*)ext;
- (BOOL) _extension: (NSString*)ext
role: (NSString*)role
@@ -683,6 +684,8 @@
{
if ([aPath isEqual: _rootPath])
image = [self rootImage];
+ else if ([aPath isEqual: NSHomeDirectory()])
+ image = [self homeDirectoryImage];
else
image = [self folderImage];
}
@@ -1320,6 +1323,20 @@
{
image = RETAIN([self _getImageWithName: @"Folder.tiff"
alternate: @"common_Folder.tiff"]);
+ }
+
+ return image;
+}
+
+/** Returns the default icon to display for a directory */
+- (NSImage*) homeDirectoryImage
+{
+ static NSImage *image = nil;
+
+ if (image == nil)
+ {
+ image = RETAIN([self _getImageWithName: @"HomeDirectory.tiff"
+ alternate: @"common_HomeDirectory.tiff"]);
}
return image;
- Home directory support and icon for GNUstep,
Jeff Teunissen <=