summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 22:28:34 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 22:28:34 +0000
commit4af9568e74b21d36de909fe46480b60f11a0772d (patch)
treea112aaaf8ad68cb5071f49d18fc841cc725311f0 /chrome
parent4950cc8b4c0579e8c434f777c81ecf153c186d38 (diff)
downloadchromium_src-4af9568e74b21d36de909fe46480b60f11a0772d.zip
chromium_src-4af9568e74b21d36de909fe46480b60f11a0772d.tar.gz
chromium_src-4af9568e74b21d36de909fe46480b60f11a0772d.tar.bz2
UI tweaks for the tab strip on linux.
BUG=none TEST=none Review URL: http://codereview.chromium.org/125012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc17
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.h3
2 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index 9265ace..18139fe 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -923,7 +923,7 @@ void TabStripGtk::GenerateIdealBounds() {
// NOTE: This currently assumes a tab's height doesn't differ based on
// selected state or the number of tabs in the strip!
int tab_height = TabGtk::GetStandardSize().height();
- double tab_x = 0;
+ double tab_x = tab_start_x();
for (int i = 0; i < tab_count; ++i) {
TabGtk* tab = GetTabAt(i);
double tab_width = unselected;
@@ -940,6 +940,10 @@ void TabStripGtk::GenerateIdealBounds() {
void TabStripGtk::LayoutNewTabButton(double last_tab_right,
double unselected_width) {
+#if defined(LINUX2)
+ gtk_fixed_move(GTK_FIXED(tabstrip_.get()), newtab_button_->widget(), 0,
+ kNewTabButtonVOffset);
+#else
int delta = abs(Round(unselected_width) - TabGtk::GetStandardSize().width());
if (delta > 1 && !resize_layout_scheduled_) {
// We're shrinking tabs, so we need to anchor the New Tab button to the
@@ -952,6 +956,7 @@ void TabStripGtk::LayoutNewTabButton(double last_tab_right,
Round(last_tab_right - kTabHOffset) + kNewTabButtonHOffset,
kNewTabButtonVOffset);
}
+#endif
}
void TabStripGtk::GetDesiredTabWidths(int tab_count,
@@ -1025,6 +1030,14 @@ void TabStripGtk::GetDesiredTabWidths(int tab_count,
}
}
+int TabStripGtk::tab_start_x() const {
+#if defined(LINUX2)
+ return newtab_button_->width() + kNewTabButtonHOffset;
+#else
+ return 0;
+#endif
+}
+
void TabStripGtk::ResizeLayoutTabs() {
resize_layout_factory_.RevokeAll();
@@ -1303,7 +1316,7 @@ void TabStripGtk::DropInfo::SetContainerShapeMask() {
// - animation tick
void TabStripGtk::AnimationLayout(double unselected_width) {
int tab_height = TabGtk::GetStandardSize().height();
- double tab_x = 0;
+ double tab_x = tab_start_x();
for (int i = 0; i < GetTabCount(); ++i) {
TabAnimation* animation = active_animation_.get();
double tab_width = TabAnimation::GetCurrentTabWidth(this, animation, i);
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h
index 3f49712..cc05ea2 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h
@@ -235,6 +235,9 @@ class TabStripGtk : public TabStripModelObserver,
double* unselected_width,
double* selected_width) const;
+ // Returns the x-coordinate tabs start from.
+ int tab_start_x() const;
+
// Perform an animated resize-relayout of the TabStrip immediately.
void ResizeLayoutTabs();