summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-29 17:38:10 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-29 17:38:10 +0000
commit95ce56621a1202b00716136dc4a6d2664e3a3d07 (patch)
treec127718d01995f9ef0f1848869436f2a5bbc97ef /chrome/browser/gtk/toolbar_star_toggle_gtk.cc
parentd51c0705e8e387ed9451bfd5f769e4aa3a926620 (diff)
downloadchromium_src-95ce56621a1202b00716136dc4a6d2664e3a3d07.zip
chromium_src-95ce56621a1202b00716136dc4a6d2664e3a3d07.tar.gz
chromium_src-95ce56621a1202b00716136dc4a6d2664e3a3d07.tar.bz2
GTK Themes: Native location bar area.
The combined star/location bar/go construct doesn't look native. In GTK mode, make the star and go buttons act like toolbar buttons, and draw a GTK text entry widget onto the toolbar. The omnibox popup is just the size of the entry when in GTK theme mode. There's still a lot of work to be done on this; I want to properly draw focus rings, have the rest of the location box use theme colors, et cetera, but this is less broken then what's currently there. Review URL: http://codereview.chromium.org/159532 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21965 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/toolbar_star_toggle_gtk.cc')
-rw-r--r--chrome/browser/gtk/toolbar_star_toggle_gtk.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
index 631ad2c..9e844d7 100644
--- a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
+++ b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
@@ -8,6 +8,7 @@
#include "base/gfx/rect.h"
#include "chrome/browser/gtk/bookmark_bubble_gtk.h"
#include "chrome/browser/gtk/browser_toolbar_gtk.h"
+#include "chrome/browser/gtk/gtk_chrome_button.h"
#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/browser/profile.h"
#include "chrome/common/notification_service.h"
@@ -15,7 +16,7 @@
ToolbarStarToggleGtk::ToolbarStarToggleGtk(BrowserToolbarGtk* host)
: host_(host),
- widget_(gtk_button_new()),
+ widget_(gtk_chrome_button_new()),
is_starred_(false),
theme_provider_(GtkThemeProvider::GetFrom(host->profile())),
unstarred_(theme_provider_, IDR_STAR, IDR_STAR_P, IDR_STAR_H, IDR_STAR_D),
@@ -90,7 +91,9 @@ gboolean ToolbarStarToggleGtk::OnExpose(GtkWidget* widget, GdkEventExpose* e,
}
void ToolbarStarToggleGtk::UpdateGTKButton() {
- if (theme_provider_->UseGtkTheme()) {
+ bool use_gtk = theme_provider_ && theme_provider_->UseGtkTheme();
+
+ if (use_gtk) {
GdkPixbuf* pixbuf = NULL;
if (is_starred_) {
pixbuf = theme_provider_->GetPixbufNamed(IDR_STARRED_NOBORDER);
@@ -114,4 +117,7 @@ void ToolbarStarToggleGtk::UpdateGTKButton() {
// We effectively double-buffer by virtue of having only one image...
gtk_widget_set_double_buffered(widget_.get(), FALSE);
}
+
+ gtk_chrome_button_set_use_gtk_rendering(
+ GTK_CHROME_BUTTON(widget_.get()), use_gtk);
}