diff options
Diffstat (limited to 'chrome/browser/gtk/browser_toolbar_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/browser_toolbar_gtk.cc | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc index bd1639d..a628394 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_toolbar_gtk.cc @@ -189,8 +189,6 @@ void BrowserToolbarGtk::Init(Profile* profile, go_.reset(new GoButtonGtk(location_bar_.get(), browser_)); gtk_box_pack_start(GTK_BOX(location_hbox), go_->widget(), FALSE, FALSE, 0); - g_signal_connect(location_hbox, "expose-event", - G_CALLBACK(OnLocationHboxExpose), this); gtk_box_pack_start(GTK_BOX(toolbar_), location_hbox, TRUE, TRUE, ShouldOnlyShowLocation() ? 1 : 0); @@ -391,12 +389,17 @@ void BrowserToolbarGtk::UpdateTabContents(TabContents* contents, gfx::Rect BrowserToolbarGtk::GetPopupBounds() const { GtkWidget* left; GtkWidget* right; - if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { - left = go_->widget(); - right = star_->widget(); + if (theme_provider_->UseGtkTheme()) { + left = location_bar_->widget(); + right = location_bar_->widget(); } else { - left = star_->widget(); - right = go_->widget(); + if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { + left = go_->widget(); + right = star_->widget(); + } else { + left = star_->widget(); + right = go_->widget(); + } } // TODO(deanm): The go and star buttons probably share the same window, @@ -518,45 +521,6 @@ gboolean BrowserToolbarGtk::OnToolbarExpose(GtkWidget* widget, } // static -gboolean BrowserToolbarGtk::OnLocationHboxExpose(GtkWidget* location_hbox, - GdkEventExpose* e, - BrowserToolbarGtk* toolbar) { - if (toolbar->theme_provider_->UseGtkTheme() && - !toolbar->ShouldOnlyShowLocation()) { - // To get the proper look surrounding the location bar, we fake out the - // theme engine into drawing a button. We fake out GTK by constructing a - // box that's from the top left corner of the bookmark button to the bottom - // right of the go button and fill it with a button's box (or the opposite - // if in RTL mode). - GtkWidget* star = toolbar->star_->widget(); - GtkWidget* left = NULL; - GtkWidget* right = NULL; - if (gtk_widget_get_direction(star) == - GTK_TEXT_DIR_LTR) { - left = toolbar->star_->widget(); - right = toolbar->go_->widget(); - } else { - left = toolbar->go_->widget(); - right = toolbar->star_->widget(); - } - - gint x = left->allocation.x; - gint y = left->allocation.y; - gint width = (right->allocation.x - left->allocation.x) + - right->allocation.width; - gint height = (right->allocation.y - left->allocation.y) + - right->allocation.height; - - gtk_paint_box(star->style, location_hbox->window, - GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, - location_hbox, "button", - x, y, width, height); - } - - return FALSE; -} - -// static void BrowserToolbarGtk::OnButtonClick(GtkWidget* button, BrowserToolbarGtk* toolbar) { int tag = -1; |