diff options
Diffstat (limited to 'chrome/browser/gtk/tabs')
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 16 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.h | 5 |
2 files changed, 9 insertions, 12 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 38f610b..ab6e88c 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -475,7 +475,7 @@ TabStripGtk::~TabStripGtk() { tab_data_.clear(); } -void TabStripGtk::Init(int width, Profile* profile) { +void TabStripGtk::Init(Profile* profile) { ThemeProvider* theme_provider = profile->GetThemeProvider(); model_->AddObserver(this); @@ -486,7 +486,7 @@ void TabStripGtk::Init(int width, Profile* profile) { tabstrip_.Own(gtk_fixed_new()); gtk_fixed_set_has_window(GTK_FIXED(tabstrip_.get()), TRUE); - gtk_widget_set_size_request(tabstrip_.get(), width, + gtk_widget_set_size_request(tabstrip_.get(), -1, TabGtk::GetMinimumUnselectedSize().height()); gtk_widget_set_app_paintable(tabstrip_.get(), TRUE); gtk_drag_dest_set(tabstrip_.get(), GTK_DEST_DEFAULT_ALL, @@ -520,10 +520,6 @@ void TabStripGtk::Init(int width, Profile* profile) { } } -void TabStripGtk::AddTabStripToBox(GtkWidget* box) { - gtk_box_pack_start(GTK_BOX(box), tabstrip_.get(), FALSE, FALSE, 0); -} - void TabStripGtk::Show() { gtk_widget_show(tabstrip_.get()); } @@ -1330,7 +1326,7 @@ gboolean TabStripGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event, event->area.height = tabstrip->bounds_.height(); gdk_region_union_with_rect(event->region, &event->area); - tabstrip->PaintBackground(event); + tabstrip->PaintBackground(widget, event); // Paint the New Tab button. gtk_container_propagate_expose(GTK_CONTAINER(tabstrip->tabstrip_.get()), @@ -1455,9 +1451,11 @@ void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) { tabstrip->model_->delegate()->AddBlankTab(true); } -void TabStripGtk::PaintBackground(GdkEventExpose* event) { +void TabStripGtk::PaintBackground(GtkWidget* widget, GdkEventExpose* event) { gfx::CanvasPaint canvas(event); - canvas.TileImageInt(*background_, 0, 0, bounds_.width(), bounds_.height()); + // Offset the background by the height of the titlebar. + canvas.TileImageInt(*background_, 0, widget->allocation.y, 0, 0, + bounds_.width(), bounds_.height()); } void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) { diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h index ddb79b0..7c21073 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.h +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h @@ -31,8 +31,7 @@ class TabStripGtk : public TabStripModelObserver, // TODO(jhawkins): We have to pass in |profile| in order to get a pointer to // the theme provider. In views, all instances of views::View have access to // the theme provider. - void Init(int width, Profile* profile); - void AddTabStripToBox(GtkWidget* box); + void Init(Profile* profile); void Show(); void Hide(); @@ -203,7 +202,7 @@ class TabStripGtk : public TabStripModelObserver, static void OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip); // Renders the tabstrip background. - void PaintBackground(GdkEventExpose* event); + void PaintBackground(GtkWidget* widget, GdkEventExpose* event); // Sets the bounds of the tab and moves the tab widget to those bounds. void SetTabBounds(TabGtk* tab, const gfx::Rect& bounds); |