diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-14 20:34:45 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-14 20:34:45 +0000 |
commit | 4889eac10a1a56dc01cdb8c8e4be57da1a9a96f6 (patch) | |
tree | 631ae59ba7d5153f2632b873eb75a26a929d770b /chrome | |
parent | 75961254aa04f575b79b1dd0be4439484da385e0 (diff) | |
download | chromium_src-4889eac10a1a56dc01cdb8c8e4be57da1a9a96f6.zip chromium_src-4889eac10a1a56dc01cdb8c8e4be57da1a9a96f6.tar.gz chromium_src-4889eac10a1a56dc01cdb8c8e4be57da1a9a96f6.tar.bz2 |
Changes the width of pinned tabs to 56, except on chrome os where it
remains at 64.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/203055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/defaults.cc | 2 | ||||
-rw-r--r-- | chrome/browser/defaults.h | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_renderer_gtk.cc | 14 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 14 |
4 files changed, 19 insertions, 14 deletions
diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc index 2be990d..6ae71e3 100644 --- a/chrome/browser/defaults.cc +++ b/chrome/browser/defaults.cc @@ -16,6 +16,7 @@ const SessionStartupPref::Type kDefaultSessionStartupType = SessionStartupPref::LAST; const bool kSuppressCrashInfoBar = true; const bool kRestoreAfterCrash = true; +const int kPinnedTabWidth = 64; #elif defined(OS_LINUX) @@ -37,6 +38,7 @@ const SessionStartupPref::Type kDefaultSessionStartupType = SessionStartupPref::DEFAULT; const bool kSuppressCrashInfoBar = false; const bool kRestoreAfterCrash = false; +const int kPinnedTabWidth = 56; #endif diff --git a/chrome/browser/defaults.h b/chrome/browser/defaults.h index dd1c6c6..bd7b4f0 100644 --- a/chrome/browser/defaults.h +++ b/chrome/browser/defaults.h @@ -36,6 +36,9 @@ extern const bool kSuppressCrashInfoBar; // TODO(sky): this should be removed once Chrome OS cleanly shuts down Chrome. extern const bool kRestoreAfterCrash; +// Width of pinned tabs. +extern const int kPinnedTabWidth; + } // namespace browser_defaults #endif // CHROME_BROWSER_DEFAULTS_H_ diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index bd54642..213475a 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -12,6 +12,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "chrome/browser/browser.h" +#include "chrome/browser/defaults.h" #include "chrome/browser/gtk/bookmark_utils_gtk.h" #include "chrome/browser/gtk/custom_button.h" #include "chrome/browser/gtk/gtk_theme_provider.h" @@ -36,13 +37,12 @@ const int kTitleCloseButtonSpacing = 5; const int kStandardTitleWidth = 175; const int kDropShadowOffset = 2; const int kInactiveTabBackgroundOffsetY = 20; -// Preferred width of pinned tabs. -const int kPinnedTabWidth = 64; // When a non-pinned tab is pinned the width of the tab animates. If the width // of a pinned tab is >= kPinnedTabRendererAsTabWidth then the tab is rendered // as a normal tab. This is done to avoid having the title immediately // disappear when transitioning a tab from normal to pinned. -const int kPinnedTabRendererAsTabWidth = kPinnedTabWidth + 30; +const int kPinnedTabRendererAsTabWidth = + browser_defaults::kPinnedTabWidth + 30; // The tab images are designed to overlap the toolbar by 1 pixel. For now we // don't actually overlap the toolbar, so this is used to know how many pixels @@ -428,7 +428,7 @@ gfx::Size TabRendererGtk::GetStandardSize() { // static int TabRendererGtk::GetPinnedWidth() { - return kPinnedTabWidth; + return browser_defaults::kPinnedTabWidth; } // static @@ -598,10 +598,10 @@ void TabRendererGtk::Layout() { kFavIconSize, kFavIconSize); if ((is_pinned() || data_.animating_pinned_change) && bounds_.width() < kPinnedTabRendererAsTabWidth) { - int pin_delta = kPinnedTabRendererAsTabWidth - kPinnedTabWidth; - int ideal_delta = bounds_.width() - kPinnedTabWidth; + int pin_delta = kPinnedTabRendererAsTabWidth - GetPinnedWidth(); + int ideal_delta = bounds_.width() - GetPinnedWidth(); if (ideal_delta < pin_delta) { - int ideal_x = (kPinnedTabWidth - kFavIconSize) / 2; + int ideal_x = (GetPinnedWidth() - kFavIconSize) / 2; int x = favicon_bounds_.x() + static_cast<int>( (1 - static_cast<float>(ideal_delta) / static_cast<float>(pin_delta)) * diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 4e4e7a4..8e051c3 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -13,6 +13,7 @@ #include "app/resource_bundle.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_theme_provider.h" +#include "chrome/browser/defaults.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tabs/tab_strip_model.h" @@ -40,13 +41,12 @@ static const int kStandardTitleWidth = 175; static const int kCloseButtonVertFuzz = 0; static const int kCloseButtonHorzFuzz = 5; static const int kSelectedTitleColor = SK_ColorBLACK; -// Preferred width of pinned tabs. -static const int kPinnedTabWidth = 64; // When a non-pinned tab is pinned the width of the tab animates. If the width // of a pinned tab is >= kPinnedTabRendererAsTabWidth then the tab is rendered // as a normal tab. This is done to avoid having the title immediately // disappear when transitioning a tab from normal to pinned. -static const int kPinnedTabRendererAsTabWidth = kPinnedTabWidth + 30; +static const int kPinnedTabRendererAsTabWidth = + browser_defaults::kPinnedTabWidth + 30; // How long the hover state takes. static const int kHoverDurationMs = 90; @@ -390,7 +390,7 @@ gfx::Size TabRenderer::GetStandardSize() { // static int TabRenderer::GetPinnedWidth() { - return kPinnedTabWidth; + return browser_defaults::kPinnedTabWidth; } //////////////////////////////////////////////////////////////////////////////// @@ -455,10 +455,10 @@ void TabRenderer::Layout() { favicon_bounds_.SetRect(lb.x(), favicon_top, kFavIconSize, kFavIconSize); if ((pinned() || data_.animating_pinned_change) && width() < kPinnedTabRendererAsTabWidth) { - int pin_delta = kPinnedTabRendererAsTabWidth - kPinnedTabWidth; - int ideal_delta = width() - kPinnedTabWidth; + int pin_delta = kPinnedTabRendererAsTabWidth - GetPinnedWidth(); + int ideal_delta = width() - GetPinnedWidth(); if (ideal_delta < pin_delta) { - int ideal_x = (kPinnedTabWidth - kFavIconSize) / 2; + int ideal_x = (GetPinnedWidth() - kFavIconSize) / 2; int x = favicon_bounds_.x() + static_cast<int>( (1 - static_cast<float>(ideal_delta) / static_cast<float>(pin_delta)) * |