From d84f818887977247f3dc45a5bee3ea1c88fb9ee3 Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Sun, 27 Feb 2011 13:21:46 +0000 Subject: Adding icons for tree views. svn path=/trunk/netsurf/; revision=11842 --- cocoa/BookmarksController.m | 2 +- cocoa/HistoryWindowController.m | 2 +- cocoa/Makefile.target | 2 +- cocoa/NetsurfApp.m | 3 +++ cocoa/res/Icons | 1 + cocoa/utils.m | 6 +++++- 6 files changed, 12 insertions(+), 4 deletions(-) create mode 120000 cocoa/res/Icons diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m index 360010242..fb28a6a35 100644 --- a/cocoa/BookmarksController.m +++ b/cocoa/BookmarksController.m @@ -48,7 +48,7 @@ static const char *cocoa_hotlist_path( void ) if ((self = [super initWithWindowNibName: @"BookmarksWindow"]) == nil) return nil; tree = [[Tree alloc] initWithFlags: hotlist_get_tree_flags()]; - hotlist_initialise( [tree tree], cocoa_hotlist_path(), "" ); + hotlist_initialise( [tree tree], cocoa_hotlist_path(), "directory.png" ); nodeForMenu = NSCreateMapTable( NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0 ); [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/cocoa/HistoryWindowController.m b/cocoa/HistoryWindowController.m index 438551bca..94fb2979e 100644 --- a/cocoa/HistoryWindowController.m +++ b/cocoa/HistoryWindowController.m @@ -31,7 +31,7 @@ if ((self = [super initWithWindowNibName: @"HistoryWindow"]) == nil) return nil; tree = [[Tree alloc] initWithFlags: history_global_get_tree_flags()]; - history_global_initialise( [tree tree], "" ); + history_global_initialise( [tree tree], "directory.png" ); return self; } diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target index fdd0fa859..329c8f9c6 100644 --- a/cocoa/Makefile.target +++ b/cocoa/Makefile.target @@ -125,7 +125,7 @@ EXETARGET := NetSurf S_XIBS := MainMenu.xib Browser.xib BrowserWindow.xib DownloadWindow.xib SearchWindow.xib PreferencesWindow.xib \ HistoryWindow.xib BookmarksWindow.xib LocalHistoryPanel.xib -R_RESOURCES := default.css adblock.css quirks.css NetSurf.icns HomeTemplate.pdf +R_RESOURCES := default.css adblock.css quirks.css NetSurf.icns HomeTemplate.pdf Icons R_RESOURCES := $(addprefix cocoa/res/,$(R_RESOURCES)) LANGUAGES := de en fr it nl diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m index 93bb82972..9d8ba4878 100644 --- a/cocoa/NetsurfApp.m +++ b/cocoa/NetsurfApp.m @@ -33,6 +33,7 @@ #import "desktop/save_complete.h" #import "desktop/selection.h" #import "desktop/textinput.h" +#import "desktop/tree.h" #import "render/html.h" #import "utils/url.h" #import "utils/log.h" @@ -74,6 +75,8 @@ urldb_load( [[defaults objectForKey: kURLsFileOption] UTF8String] ); urldb_load_cookies( option_cookie_file ); + tree_set_icon_dir( strdup( [[[NSBundle mainBundle] pathForResource: @"Icons" ofType: @""] UTF8String] ) ); + cocoa_update_scale_factor(); } diff --git a/cocoa/res/Icons b/cocoa/res/Icons new file mode 120000 index 000000000..509ccd1d2 --- /dev/null +++ b/cocoa/res/Icons @@ -0,0 +1 @@ +../../!NetSurf/Resources/Icons/ \ No newline at end of file diff --git a/cocoa/utils.m b/cocoa/utils.m index c9cef7a23..0e10b9b6b 100644 --- a/cocoa/utils.m +++ b/cocoa/utils.m @@ -58,5 +58,9 @@ bool path_add_part(char *path, int length, const char *newpart) void tree_icon_name_from_content_type(char *buffer, content_type type) { - UNIMPL(); + switch (type) { + default: + strcpy( buffer, "content.png" ); + break; + } } \ No newline at end of file -- cgit v1.2.3