summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 21:34:18 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 21:34:18 +0000
commitef6fdb767d0a059f67c782ab40c396d5c076c4d1 (patch)
tree22246d402b5df5f315ed62de7a33d9185003b215
parent2c8b37092f12f1d13b8b7ef87d0269eb11644ff0 (diff)
downloadchromium_src-ef6fdb767d0a059f67c782ab40c396d5c076c4d1.zip
chromium_src-ef6fdb767d0a059f67c782ab40c396d5c076c4d1.tar.gz
chromium_src-ef6fdb767d0a059f67c782ab40c396d5c076c4d1.tar.bz2
Adds code to position the tab overview button during animations. It
appears that some times Layout isn't invoked on initial size, so that positioning the tab overview button only during Layout isn't enough. BUG=none TEST=none Review URL: http://codereview.chromium.org/155306 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20318 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/browser/gtk/tabs/tab_strip_gtk.cc13
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.h5
2 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index b6b71d9..36d2c0e 100755
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -544,8 +544,7 @@ void TabStripGtk::Layout() {
LayoutNewTabButton(static_cast<double>(tab_right), current_unselected_width_);
#if defined(OS_CHROMEOS)
- gtk_fixed_move(GTK_FIXED(tabstrip_.get()), tab_overview_button_->widget(),
- bounds_.width() - tab_overview_button_->width(), 0);
+ LayoutTabOverviewButton();
#endif
gtk_widget_queue_draw(tabstrip_.get());
}
@@ -1000,6 +999,13 @@ void TabStripGtk::LayoutNewTabButton(double last_tab_right,
bounds.x(), bounds.y());
}
+#if defined OS_CHROMEOS
+void TabStripGtk::LayoutTabOverviewButton() {
+ gtk_fixed_move(GTK_FIXED(tabstrip_.get()), tab_overview_button_->widget(),
+ bounds_.width() - tab_overview_button_->width(), 0);
+}
+#endif
+
void TabStripGtk::GetDesiredTabWidths(int tab_count,
double* unselected_width,
double* selected_width) const {
@@ -1373,6 +1379,9 @@ void TabStripGtk::AnimationLayout(double unselected_width) {
tab_x = end_of_tab + kTabHOffset;
}
LayoutNewTabButton(tab_x, unselected_width);
+#if defined(OS_CHROMEOS)
+ LayoutTabOverviewButton();
+#endif
gtk_widget_queue_draw(tabstrip_.get());
}
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h
index 1add69e..0da33f9 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h
@@ -288,6 +288,11 @@ class TabStripGtk : public TabStripModelObserver,
// during animations, so we can't use current_unselected_width_.
void LayoutNewTabButton(double last_tab_right, double unselected_width);
+#if defined(OS_CHROMEOS)
+ // Positions the tab overview button.
+ void LayoutTabOverviewButton();
+#endif
+
// -- Link Drag & Drop ------------------------------------------------------
// Returns the bounds to render the drop at, in screen coordinates. Sets