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

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

Issue 150176: GTK: First draft of using native themes, partially based on evan's CL 118358. (Closed)
Patch Set: And the codereview tool is back. Created 11 years, 6 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
Index: chrome/browser/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc
index 118287d7d79f00dbf746c6cc8765542bb4469483..b10712adaef089dd6ad7ff8764b6d53be2c09946 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/gtk/location_bar_view_gtk.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/alternate_nav_url_fetcher.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/gtk_util.h"
#include "chrome/common/page_transition_types.h"
@@ -116,10 +117,17 @@ void LocationBarViewGtk::Init() {
G_CALLBACK(&HandleExposeThunk), this);
GtkWidget* align = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(align),
- kTopMargin + kBorderThickness,
- kBottomMargin + kBorderThickness,
- kEditLeftRightPadding, kEditLeftRightPadding);
+ // TODO(erg): Redo this so that it adjusts during theme changes.
+ if (GtkThemeProvider::UseSystemThemeGraphics(profile_)) {
+ gtk_alignment_set_padding(GTK_ALIGNMENT(align),
+ 0, 0,
+ kEditLeftRightPadding, kEditLeftRightPadding);
+ } else {
+ gtk_alignment_set_padding(GTK_ALIGNMENT(align),
+ kTopMargin + kBorderThickness,
+ kBottomMargin + kBorderThickness,
+ kEditLeftRightPadding, kEditLeftRightPadding);
+ }
gtk_container_add(GTK_CONTAINER(align), location_entry_->widget());
gtk_box_pack_start(GTK_BOX(hbox_.get()), align, TRUE, TRUE, 0);

Powered by Google App Engine
This is Rietveld 408576698