Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7123)

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 9814013: Ash: Update tab strip for new image assets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: 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 a58ed326621a7d6c8f70640c43e3e5c8eccb9ba2..41d8a3bd445a75cf9e0a971e8c1d3c6c8da19ec7 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -30,23 +30,45 @@
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
+// Padding around the "content" of a tab, occupied by the tab border graphics.
+#if defined(USE_ASH)
+static const int kLeftPadding = 21;
+static const int kTopPadding = 8;
+static const int kRightPadding = 20;
+static const int kBottomPadding = 5;
+#else
static const int kLeftPadding = 16;
static const int kTopPadding = 6;
static const int kRightPadding = 15;
static const int kBottomPadding = 5;
+#endif
+
+// 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)
+static const int kTitleTextOffsetY = 2;
+#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)
+static const int kCloseButtonVertFuzz = 1;
+#else
static const int kCloseButtonVertFuzz = 0;
+#endif
static const int kTabIconSize = gfx::kFaviconSize;
static const int kCloseButtonHorzFuzz = 5;
static const int kTouchModeMinimumWidth = 160;
-// Vertical adjustment to the favicon when the tab has a large icon.
-static const int kAppTapFaviconVerticalAdjustment = 2;
-
// 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
// is rendered as a normal tab. This is done to avoid having the title
@@ -56,7 +78,6 @@ static const int kMiniTabRendererAsNormalTabWidth =
// How opaque to make the hover state (out of 1).
static const double kHoverOpacity = 0.33;
-static const double kHoverSlideOpacity = 0.5;
// Opacity for non-active selected tabs.
static const double kSelectedTabOpacity = .45;
@@ -295,7 +316,8 @@ void Tab::Layout() {
}
int title_left = favicon_bounds_.right() + kFaviconTitleSpacing;
- int title_top = kTopPadding + (content_height - font_height()) / 2;
+ int title_top =
+ kTopPadding + kTitleTextOffsetY + (content_height - font_height()) / 2;
// Size the Title text to fill the remaining space.
if (!data().mini || width() >= kMiniTabRendererAsNormalTabWidth) {
// If the user has big fonts, the title will appear rendered too far down
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698