summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbase/gfx/gtk_util.cc5
-rwxr-xr-xbase/gfx/gtk_util.h5
-rw-r--r--chrome/app/chrome_dll_main.cc10
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc8
-rw-r--r--chrome/browser/gtk/menu_gtk.cc4
5 files changed, 25 insertions, 7 deletions
diff --git a/base/gfx/gtk_util.cc b/base/gfx/gtk_util.cc
index 0808193..047d9f0 100755
--- a/base/gfx/gtk_util.cc
+++ b/base/gfx/gtk_util.cc
@@ -12,8 +12,11 @@
namespace gfx {
+const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff);
+const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00);
+
void SubtractRectanglesFromRegion(GdkRegion* region,
- const std::vector<gfx::Rect>& cutouts) {
+ const std::vector<Rect>& cutouts) {
for (size_t i = 0; i < cutouts.size(); ++i) {
GdkRectangle rect = cutouts[i].ToGdkRectangle();
GdkRegion* rect_region = gdk_region_rectangle(&rect);
diff --git a/base/gfx/gtk_util.h b/base/gfx/gtk_util.h
index 02b1385..909dec3 100755
--- a/base/gfx/gtk_util.h
+++ b/base/gfx/gtk_util.h
@@ -22,9 +22,12 @@ namespace gfx {
class Rect;
+extern const GdkColor kGdkWhite;
+extern const GdkColor kGdkBlack;
+
// Modify the given region by subtracting the given rectangles.
void SubtractRectanglesFromRegion(GdkRegion* region,
- const std::vector<gfx::Rect>& cutouts);
+ const std::vector<Rect>& cutouts);
// Convert and copy a SkBitmap to a GdkPixbuf. NOTE: This is an expensive
// operation, all of the pixels must be copied and their order swapped.
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index b41e54e..82539ef 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -393,6 +393,10 @@ int ChromeMain(int argc, const char** argv) {
#endif
} else if (process_type.empty()) {
#if defined(OS_LINUX)
+ // Disable user theming.
+ gchar* default_gtkrc_files[] = { NULL };
+ gtk_rc_set_default_files(default_gtkrc_files);
+
// gtk_init() can change |argc| and |argv|, but nobody else uses them.
gtk_init(&argc, const_cast<char***>(&argv));
// Register GTK assertions to go through our logging system.
@@ -404,6 +408,12 @@ int ChromeMain(int argc, const char** argv) {
G_LOG_LEVEL_WARNING),
GtkFatalLogHandler,
NULL);
+
+ // This theme is chosen rather abritrarily. We set many colors ourselves,
+ // so we need to set a light theme or some of the colors will clash.
+ g_object_set(gtk_settings_get_default(),
+ "gtk-theme-name", "Mist",
+ NULL);
#endif
ScopedOleInitializer ole_initializer;
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 7a5464f..6484ab4 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -25,9 +25,9 @@ const char kSecureSchemeColor[] = "#009614";
const char kInsecureSchemeColor[] = "#c80000";
const GdkColor kBackgroundColorByLevel[] = {
- GDK_COLOR_RGB(255, 245, 195), // SecurityLevel SECURE: Yellow.
- GDK_COLOR_RGB(255, 255, 255), // SecurityLevel NORMAL: White.
- GDK_COLOR_RGB(255, 255, 255), // SecurityLevel INSECURE: White.
+ GDK_COLOR_RGB(255, 245, 195), // SecurityLevel SECURE. (yellow)
+ gfx::kGdkWhite, // SecurityLevel NORMAL.
+ gfx::kGdkWhite, // SecurityLevel INSECURE.
};
} // namespace
@@ -439,7 +439,7 @@ gboolean AutocompleteEditViewGtk::HandleViewButtonPress(GdkEventButton* event) {
gboolean AutocompleteEditViewGtk::HandleViewFocusIn() {
model_->OnSetFocus(false);
// TODO(deanm): Some keyword hit business, etc here.
-
+
return FALSE; // Continue propagation.
}
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc
index 47a89f9..7a55648 100644
--- a/chrome/browser/gtk/menu_gtk.cc
+++ b/chrome/browser/gtk/menu_gtk.cc
@@ -129,7 +129,7 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu,
}
if (accel_group && menu_data->accel_key) {
- // If we ever want to let the user do any key remaping, we'll need to
+ // If we ever want to let the user do any key re-mapping, we'll need to
// change the following so we make a gtk_accel_map which keeps the actual
// keys.
gtk_widget_add_accelerator(menu_item,
@@ -150,6 +150,7 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu,
gtk_menu_append(menu, menu_item);
last_menu_item = menu_item;
}
+ gtk_widget_modify_bg(menu, GTK_STATE_NORMAL, &gfx::kGdkWhite);
}
void MenuGtk::BuildMenuFromDelegate() {
@@ -180,6 +181,7 @@ void MenuGtk::BuildMenuFromDelegate() {
gtk_widget_show(menu_item);
gtk_menu_shell_append(GTK_MENU_SHELL(menu_.get()), menu_item);
}
+ gtk_widget_modify_bg(menu_.get(), GTK_STATE_NORMAL, &gfx::kGdkWhite);
}
// static