From bf952c3b72a9dbccd0f823e4630e287adce45453 Mon Sep 17 00:00:00 2001 From: "jamescook@chromium.org" Date: Fri, 27 Apr 2012 20:02:54 +0000 Subject: Use new Ash-style tabs and toolbar icons on Windows We still need the existing art assets for Mac and Linux/GTK in some cases, but this simplifies the views C++ code. I'll delete the orphaned browser_actions_overflow_win*.png and newtab_views*.png assets in a subsequent CL. BUG=125005 TEST=visual Review URL: http://codereview.chromium.org/10238011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134335 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/views/tabs/tab.cc | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'chrome/browser/ui/views/tabs/tab.cc') diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 202e36d..3675cdb 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc @@ -39,13 +39,14 @@ const int GetLeftPadding() { if (value == -1) { switch (ui::GetDisplayLayout()) { case ui::LAYOUT_ASH: - value = 21; + case ui::LAYOUT_DESKTOP: + value = 22; break; case ui::LAYOUT_TOUCH: value = 20; break; default: - value = 16; + NOTREACHED(); } } return value; @@ -56,13 +57,14 @@ const int GetTopPadding() { if (value == -1) { switch (ui::GetDisplayLayout()) { case ui::LAYOUT_ASH: + case ui::LAYOUT_DESKTOP: value = 8; break; case ui::LAYOUT_TOUCH: value = 12; break; default: - value = 6; + NOTREACHED(); } } return value; @@ -73,13 +75,12 @@ const int GetRightPadding() { if (value == -1) { switch (ui::GetDisplayLayout()) { case ui::LAYOUT_ASH: - value = 20; - break; + case ui::LAYOUT_DESKTOP: case ui::LAYOUT_TOUCH: value = 21; break; default: - value = 15; + NOTREACHED(); } } return value; @@ -89,46 +90,44 @@ const int GetBottomPadding() { static int value = -1; if (value == -1) { switch (ui::GetDisplayLayout()) { + case ui::LAYOUT_ASH: + case ui::LAYOUT_DESKTOP: + value = 5; + break; case ui::LAYOUT_TOUCH: value = 7; break; - case ui::LAYOUT_ASH: default: - value = 5; + NOTREACHED(); } } return value; } // Height of the shadow at the top of the tab image assets. -#if defined(USE_ASH) static const int kDropShadowHeight = 4; -#else -static const int kDropShadowHeight = 2; -#endif static const int kToolbarOverlap = 1; static const int kFaviconTitleSpacing = 4; -// Additional vertical offset for title text relative to top of tab. #if defined(USE_ASH) +// Additional vertical offset for title text relative to top of tab. +// Ash text rendering may be different than Windows. +// TODO(jamescook): Make this Chrome OS or Linux only? static const int kTitleTextOffsetY = 1; #else static const int kTitleTextOffsetY = 0; #endif static const int kTitleCloseButtonSpacing = 3; static const int kStandardTitleWidth = 175; -// Additional vertical offset for close button relative to top of tab. #if defined(USE_ASH) +// Additional vertical offset for close button relative to top of tab. +// Ash needs this to match the text vertical position. static const int kCloseButtonVertFuzz = 1; #else static const int kCloseButtonVertFuzz = 0; #endif static const int kTabIconSize = gfx::kFaviconSize; // Additional horizontal offset for close button relative to title text. -#if defined(USE_ASH) static const int kCloseButtonHorzFuzz = 7; -#else -static const int kCloseButtonHorzFuzz = 5; -#endif // When a non-mini-tab becomes a mini-tab the width of the tab animates. If // the width of a mini-tab is >= kMiniTabRendererAsNormalTabWidth then the tab -- cgit v1.1