From 9edd0cca568dbdd26d9cd27b225ba1dd9e17bde5 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Mon, 12 Aug 2002 19:06:37 +0000 Subject: [PATCH] make all new tabs appear on the right. comes from usability tests (bug 154468) --- camino/BrowserWindowController.mm | 10 +++++++++- camino/src/browser/BrowserWindowController.mm | 10 +++++++++- chimera/BrowserWindowController.mm | 10 +++++++++- chimera/src/browser/BrowserWindowController.mm | 10 +++++++++- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/camino/BrowserWindowController.mm b/camino/BrowserWindowController.mm index 5e88895a4a37..8567b56be985 100644 --- a/camino/BrowserWindowController.mm +++ b/camino/BrowserWindowController.mm @@ -1085,10 +1085,18 @@ static NSArray* sToolbarDefaults = nil; -(void)openNewTabWithURL: (NSString*)aURLSpec referrer:(NSString*)aReferrer loadInBackground: (BOOL)aLoadInBG { CHIconTabViewItem* newTab = [[[CHIconTabViewItem alloc] initWithIdentifier: nil] autorelease]; - + + // hyatt originally made new tabs open on the far right and tabs opened from a content + // link open to the right of the current tab. The idea was to keep the new tab + // close to the tab that spawned it, since they are related. Users, however, got confused + // as to why tabs appeared in different places, so now all tabs go on the far right. +#ifdef OPEN_TAB_TO_RIGHT_OF_SELECTED NSTabViewItem* selectedTab = [mTabBrowser selectedTabViewItem]; int index = [mTabBrowser indexOfTabViewItem: selectedTab]; [mTabBrowser insertTabViewItem: newTab atIndex: index+1]; +#else + [mTabBrowser addTabViewItem: newTab]; +#endif CHBrowserWrapper* newView = [[[CHBrowserWrapper alloc] initWithTab: newTab andWindow: [mTabBrowser window]] autorelease]; [newView setTab: newTab]; diff --git a/camino/src/browser/BrowserWindowController.mm b/camino/src/browser/BrowserWindowController.mm index 5e88895a4a37..8567b56be985 100644 --- a/camino/src/browser/BrowserWindowController.mm +++ b/camino/src/browser/BrowserWindowController.mm @@ -1085,10 +1085,18 @@ static NSArray* sToolbarDefaults = nil; -(void)openNewTabWithURL: (NSString*)aURLSpec referrer:(NSString*)aReferrer loadInBackground: (BOOL)aLoadInBG { CHIconTabViewItem* newTab = [[[CHIconTabViewItem alloc] initWithIdentifier: nil] autorelease]; - + + // hyatt originally made new tabs open on the far right and tabs opened from a content + // link open to the right of the current tab. The idea was to keep the new tab + // close to the tab that spawned it, since they are related. Users, however, got confused + // as to why tabs appeared in different places, so now all tabs go on the far right. +#ifdef OPEN_TAB_TO_RIGHT_OF_SELECTED NSTabViewItem* selectedTab = [mTabBrowser selectedTabViewItem]; int index = [mTabBrowser indexOfTabViewItem: selectedTab]; [mTabBrowser insertTabViewItem: newTab atIndex: index+1]; +#else + [mTabBrowser addTabViewItem: newTab]; +#endif CHBrowserWrapper* newView = [[[CHBrowserWrapper alloc] initWithTab: newTab andWindow: [mTabBrowser window]] autorelease]; [newView setTab: newTab]; diff --git a/chimera/BrowserWindowController.mm b/chimera/BrowserWindowController.mm index 5e88895a4a37..8567b56be985 100644 --- a/chimera/BrowserWindowController.mm +++ b/chimera/BrowserWindowController.mm @@ -1085,10 +1085,18 @@ static NSArray* sToolbarDefaults = nil; -(void)openNewTabWithURL: (NSString*)aURLSpec referrer:(NSString*)aReferrer loadInBackground: (BOOL)aLoadInBG { CHIconTabViewItem* newTab = [[[CHIconTabViewItem alloc] initWithIdentifier: nil] autorelease]; - + + // hyatt originally made new tabs open on the far right and tabs opened from a content + // link open to the right of the current tab. The idea was to keep the new tab + // close to the tab that spawned it, since they are related. Users, however, got confused + // as to why tabs appeared in different places, so now all tabs go on the far right. +#ifdef OPEN_TAB_TO_RIGHT_OF_SELECTED NSTabViewItem* selectedTab = [mTabBrowser selectedTabViewItem]; int index = [mTabBrowser indexOfTabViewItem: selectedTab]; [mTabBrowser insertTabViewItem: newTab atIndex: index+1]; +#else + [mTabBrowser addTabViewItem: newTab]; +#endif CHBrowserWrapper* newView = [[[CHBrowserWrapper alloc] initWithTab: newTab andWindow: [mTabBrowser window]] autorelease]; [newView setTab: newTab]; diff --git a/chimera/src/browser/BrowserWindowController.mm b/chimera/src/browser/BrowserWindowController.mm index 5e88895a4a37..8567b56be985 100644 --- a/chimera/src/browser/BrowserWindowController.mm +++ b/chimera/src/browser/BrowserWindowController.mm @@ -1085,10 +1085,18 @@ static NSArray* sToolbarDefaults = nil; -(void)openNewTabWithURL: (NSString*)aURLSpec referrer:(NSString*)aReferrer loadInBackground: (BOOL)aLoadInBG { CHIconTabViewItem* newTab = [[[CHIconTabViewItem alloc] initWithIdentifier: nil] autorelease]; - + + // hyatt originally made new tabs open on the far right and tabs opened from a content + // link open to the right of the current tab. The idea was to keep the new tab + // close to the tab that spawned it, since they are related. Users, however, got confused + // as to why tabs appeared in different places, so now all tabs go on the far right. +#ifdef OPEN_TAB_TO_RIGHT_OF_SELECTED NSTabViewItem* selectedTab = [mTabBrowser selectedTabViewItem]; int index = [mTabBrowser indexOfTabViewItem: selectedTab]; [mTabBrowser insertTabViewItem: newTab atIndex: index+1]; +#else + [mTabBrowser addTabViewItem: newTab]; +#endif CHBrowserWrapper* newView = [[[CHBrowserWrapper alloc] initWithTab: newTab andWindow: [mTabBrowser window]] autorelease]; [newView setTab: newTab];