Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: chrome/browser/gtk/browser_toolbar_gtk.cc

Issue 115438: Linux: Just enough toolbar theming to make everything look normal again.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_toolbar_gtk.h ('k') | chrome/browser/gtk/nine_box.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_toolbar_gtk.cc
===================================================================
--- chrome/browser/gtk/browser_toolbar_gtk.cc (revision 16275)
+++ chrome/browser/gtk/browser_toolbar_gtk.cc (working copy)
@@ -13,6 +13,7 @@
#include "base/path_service.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser.h"
+#include "chrome/browser/browser_theme_provider.h"
#include "chrome/browser/gtk/back_forward_menu_model_gtk.h"
#include "chrome/browser/gtk/custom_button.h"
#include "chrome/browser/gtk/go_button_gtk.h"
@@ -98,7 +99,7 @@
// -1 for width means "let GTK do its normal sizing".
gtk_widget_set_size_request(toolbar_, -1, kToolbarHeight);
g_signal_connect(G_OBJECT(toolbar_), "expose-event",
- G_CALLBACK(&OnContentAreaExpose), this);
+ G_CALLBACK(&OnToolbarExpose), this);
// A GtkAccelGroup is not InitiallyUnowned, meaning we get a real reference
// count starting at one. We don't want the lifetime to be managed by the
@@ -315,14 +316,17 @@
}
// static
-gboolean BrowserToolbarGtk::OnContentAreaExpose(GtkWidget* widget,
- GdkEventExpose* e,
- BrowserToolbarGtk* toolbar) {
- // TODO(deanm): We should improve the tiling performance, or not use NineBox.
- // For now at least honor the damage rect to avoid unnecessary painting.
+gboolean BrowserToolbarGtk::OnToolbarExpose(GtkWidget* widget,
+ GdkEventExpose* e,
+ BrowserToolbarGtk* toolbar) {
cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
+ // It would be more intuitive to pass |e->area.y| rather than 0, but the
+ // toolbar is supposed to blend in with the active tab, so we have to pass
+ // coordinates for the IDR_THEME_TOOLBAR bitmap relative to the top of the
+ // tab strip. Since the toolbar's GdkWindow has the same origin as the tab
+ // strip's GdkWindow, we can just pass 0.
toolbar->background_ninebox_.get()->RenderTopCenterStrip(cr,
- e->area.x, -2, e->area.width);
+ e->area.x, 0, e->area.width);
cairo_destroy(cr);
return FALSE; // Allow subwidgets to paint.
@@ -447,14 +451,8 @@
}
void BrowserToolbarGtk::InitNineBox() {
+ // TODO(estade): use |profile_|?
background_ninebox_.reset(new NineBox(
- IDR_CONTENT_TOP_LEFT_CORNER,
- IDR_CONTENT_TOP_CENTER,
- IDR_CONTENT_TOP_RIGHT_CORNER,
- IDR_CONTENT_LEFT_SIDE,
- 0,
- IDR_CONTENT_RIGHT_SIDE,
- IDR_CONTENT_BOTTOM_LEFT_CORNER,
- IDR_CONTENT_BOTTOM_CENTER,
- IDR_CONTENT_BOTTOM_RIGHT_CORNER));
+ browser_->profile()->GetThemeProvider(),
+ 0, IDR_THEME_TOOLBAR, 0, 0, 0, 0, 0, 0, 0));
}
« no previous file with comments | « chrome/browser/gtk/browser_toolbar_gtk.h ('k') | chrome/browser/gtk/nine_box.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698