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

Unified Diff: chrome/browser/ui/gtk/website_settings/permission_selector.cc

Issue 10966010: [gtk] fix up appearance of website settings dropdown menus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/website_settings/permission_selector.cc
diff --git a/chrome/browser/ui/gtk/website_settings/permission_selector.cc b/chrome/browser/ui/gtk/website_settings/permission_selector.cc
index ba2be8d2c90fde3b6c0bd2d982c01fb2ea911d02..de60af01c1b913fa1948a328bfcf03db531bc75f 100644
--- a/chrome/browser/ui/gtk/website_settings/permission_selector.cc
+++ b/chrome/browser/ui/gtk/website_settings/permission_selector.cc
@@ -73,19 +73,31 @@ PermissionSelector::PermissionSelector(GtkThemeService* theme_service,
gtk_box_pack_start(GTK_BOX(widget_), label, FALSE, FALSE, 0);
// Add the menu button.
- menu_button_ = gtk_button_new_with_label(
+ menu_button_ = theme_service->BuildChromeButton();
+ GtkWidget* button_hbox = gtk_hbox_new(FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(menu_button_), button_hbox);
+
+ GtkWidget* button_label = theme_service->BuildLabel(
UTF16ToUTF8(WebsiteSettingsUI::PermissionActionToUIString(
- setting, default_setting, source)).c_str());
+ setting, default_setting, source)),
+ ui::kGdkBlack);
+ gtk_box_pack_start(GTK_BOX(button_hbox), button_label, FALSE, FALSE,
+ ui::kControlSpacing);
+
bool user_setting = source == content_settings::SETTING_SOURCE_USER;
gtk_widget_set_sensitive(GTK_WIDGET(menu_button_), user_setting);
if (user_setting) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- pixbuf = rb.GetNativeImageNamed(IDR_APP_DROPARROW).ToGdkPixbuf();
- GtkWidget* arrow = gtk_image_new_from_pixbuf(pixbuf);
- gtk_button_set_image(GTK_BUTTON(menu_button_), arrow);
- gtk_button_set_image_position(GTK_BUTTON(menu_button_),
- base::i18n::IsRTL() ? GTK_POS_LEFT
- : GTK_POS_RIGHT);
+ GtkWidget* arrow = NULL;
+ // We don't handle theme changes, which is a bug but they are very unlikely
+ // to occur while a bubble is grabbing input.
+ if (theme_service->UsingNativeTheme()) {
+ arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+ } else {
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ arrow = gtk_image_new_from_pixbuf(
+ rb.GetNativeImageNamed(IDR_APP_DROPARROW).ToGdkPixbuf());
+ }
+ gtk_box_pack_start(GTK_BOX(button_hbox), arrow, FALSE, FALSE, 0);
markusheintz_ 2012/09/20 13:04:49 Does this work for RTL mode?
Evan Stade 2012/09/20 14:15:38 yes
}
gtk_button_set_relief(GTK_BUTTON(menu_button_), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(widget_), menu_button_, FALSE, FALSE, 0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698