summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 05:09:31 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 05:09:31 +0000
commitba62547e8e8c83590725ac05c20eb99e534ab422 (patch)
tree4d597e8346befa4fea8218fb2f58b940d5a438dc
parent724159ade73d3b63a41778a8dbb0a39751561ee3 (diff)
downloadchromium_src-ba62547e8e8c83590725ac05c20eb99e534ab422.zip
chromium_src-ba62547e8e8c83590725ac05c20eb99e534ab422.tar.gz
chromium_src-ba62547e8e8c83590725ac05c20eb99e534ab422.tar.bz2
Mac: trivial clean up of tab strip layout code + unseeable layout fix.
The placement of the new tab button was wrong when a placeholder is present ... but in that case the new tab button wasn't shown. BUG=none TEST=none Review URL: http://codereview.chromium.org/6036005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70296 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/tab_strip_controller.mm11
1 files changed, 3 insertions, 8 deletions
diff --git a/chrome/browser/ui/cocoa/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tab_strip_controller.mm
index 876067c..826910c 100644
--- a/chrome/browser/ui/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_strip_controller.mm
@@ -791,7 +791,6 @@ private:
BOOL visible = [[tabStripView_ window] isVisible];
CGFloat offset = [self indentForControls];
- NSUInteger i = 0;
bool hasPlaceholderGap = false;
for (TabController* tab in tabArray_.get()) {
// Ignore a tab that is going through a close animation.
@@ -811,9 +810,8 @@ private:
// If the tab is hidden, we consider it a new tab. We make it visible
// and animate it in.
BOOL newTab = [[tab view] isHidden];
- if (newTab) {
+ if (newTab)
[[tab view] setHidden:NO];
- }
if (isPlaceholder) {
// Move the current tab to the correct location instantly.
@@ -896,7 +894,6 @@ private:
offset += NSWidth(tabFrame);
offset -= kTabOverlap;
}
- i++;
}
// Hide the new tab button if we're explicitly told to. It may already
@@ -909,10 +906,8 @@ private:
// We've already ensured there's enough space for the new tab button
// so we don't have to check it against the available space. We do need
// to make sure we put it after any placeholder.
- newTabNewFrame.origin = NSMakePoint(offset, 0);
- newTabNewFrame.origin.x = MAX(newTabNewFrame.origin.x,
- NSMaxX(placeholderFrame_)) +
- kNewTabButtonOffset;
+ CGFloat maxTabX = MAX(offset, NSMaxX(placeholderFrame_) - kTabOverlap);
+ newTabNewFrame.origin = NSMakePoint(maxTabX + kNewTabButtonOffset, 0);
if ([tabContentsArray_ count])
[newTabButton_ setHidden:NO];