From 8e529921d79fd1ba0316a72489f727eaf7b3e3bc Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 14 Mar 2010 15:03:14 +0000 Subject: [PATCH] simplify how the icons are set for the inspector tabs --- macosx/InfoTabButtonCell.m | 12 +++----- macosx/InfoWindow.xib | 54 +++++++++++++++++++++++++---------- macosx/InfoWindowController.m | 9 ------ 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/macosx/InfoTabButtonCell.m b/macosx/InfoTabButtonCell.m index 6100d7ea4..56a758adf 100644 --- a/macosx/InfoTabButtonCell.m +++ b/macosx/InfoTabButtonCell.m @@ -35,6 +35,10 @@ name: NSControlTintDidChangeNotification object: NSApp]; fSelected = NO; + + //expects the icon to currently be set as the image + fIcon = [[self image] retain]; + [self setSelectedTab: fSelected]; } - (void) dealloc @@ -45,14 +49,6 @@ [super dealloc]; } -- (void) setIcon: (NSImage *) image -{ - [fIcon release]; - fIcon = [image retain]; - - [self setSelectedTab: fSelected]; -} - - (void) setSelectedTab: (BOOL) selected { fSelected = selected; diff --git a/macosx/InfoWindow.xib b/macosx/InfoWindow.xib index ca09d7f6f..e63ec09ad 100644 --- a/macosx/InfoWindow.xib +++ b/macosx/InfoWindow.xib @@ -12,7 +12,7 @@ YES - + YES @@ -156,15 +156,19 @@ 67239424 0 - General Info + LucidaGrande 13 1044 - 104612095 + 108282111 6 + + NSImage + InfoGeneral + 200 @@ -173,12 +177,16 @@ 67239424 0 - Activity + 1 - 104612095 + 108282111 6 + + NSImage + InfoActivity + 400 @@ -187,12 +195,16 @@ 67239424 0 - Tracker + 2 - 104612095 + 108282111 6 + + NSImage + InfoTracker + 400 @@ -201,12 +213,16 @@ 67239424 0 - Peers + 3 - 104612095 + 108282111 6 + + NSImage + InfoPeers + 400 @@ -215,12 +231,16 @@ 67239424 0 - Files + 4 - 104612095 + 108806399 6 + + NSImage + InfoFiles + 400 @@ -229,12 +249,16 @@ -2080244224 0 - Options + 5 - -2042871553 + -2038677249 6 + + NSImage + InfoOptions + 400 75 @@ -714,9 +738,9 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA InfoTextField com.apple.InterfaceBuilder.CocoaPlugin - {{897, 867}, {403, 75}} + {{500, 881}, {403, 75}} com.apple.InterfaceBuilder.CocoaPlugin - {{897, 867}, {403, 75}} + {{500, 881}, {403, 75}} {{687, 827}, {350, 75}} diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 0b26f6bd4..8c1b848cc 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -78,7 +78,6 @@ typedef enum const CGFloat windowHeight = NSHeight([window frame]); - #warning check if this is still needed [window setFrameAutosaveName: @"InspectorWindow"]; [window setFrameUsingName: @"InspectorWindow"]; @@ -89,14 +88,6 @@ typedef enum [window setBecomesKeyOnlyIfNeeded: YES]; - //set tab images - [[fTabMatrix cellWithTag: TAB_GENERAL_TAG] setIcon: [NSImage imageNamed: @"InfoGeneral.png"]]; - [[fTabMatrix cellWithTag: TAB_ACTIVITY_TAG] setIcon: [NSImage imageNamed: @"InfoActivity.png"]]; - [[fTabMatrix cellWithTag: TAB_TRACKERS_TAG] setIcon: [NSImage imageNamed: @"InfoTracker.png"]]; - [[fTabMatrix cellWithTag: TAB_PEERS_TAG] setIcon: [NSImage imageNamed: @"InfoPeers.png"]]; - [[fTabMatrix cellWithTag: TAB_FILE_TAG] setIcon: [NSImage imageNamed: @"InfoFiles.png"]]; - [[fTabMatrix cellWithTag: TAB_OPTIONS_TAG] setIcon: [NSImage imageNamed: @"InfoOptions.png"]]; - //set tab tooltips [fTabMatrix setToolTip: NSLocalizedString(@"General Info", "Inspector -> tab") forCell: [fTabMatrix cellWithTag: TAB_GENERAL_TAG]]; [fTabMatrix setToolTip: NSLocalizedString(@"Activity", "Inspector -> tab") forCell: [fTabMatrix cellWithTag: TAB_ACTIVITY_TAG]]; -- 2.40.0