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

Unified Diff: chrome/browser/ui/gtk/find_bar_gtk.cc

Issue 11415220: fix gtk find bar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/find_bar_gtk.cc
diff --git a/chrome/browser/ui/gtk/find_bar_gtk.cc b/chrome/browser/ui/gtk/find_bar_gtk.cc
index 491c0eb7d1267894b63ca91e24a872133ca14ad0..772e567fcce8e4f757a0f9f1a4e5d6734966791f 100644
--- a/chrome/browser/ui/gtk/find_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/find_bar_gtk.cc
@@ -61,9 +61,10 @@ const GdkColor kFindFailureBackgroundColor = GDK_COLOR_RGB(255, 102, 102);
const GdkColor kFindSuccessTextColor = GDK_COLOR_RGB(178, 178, 178);
// Padding around the container.
-const int kBarPaddingTopBottom = 4;
+const int kBarPaddingTop = 2;
+const int kBarPaddingBottom = 3;
const int kEntryPaddingLeft = 6;
-const int kCloseButtonPaddingLeft = 3;
+const int kCloseButtonPadding = 3;
const int kBarPaddingRight = 4;
// The height of the findbar dialog, as dictated by the size of the background
@@ -229,9 +230,9 @@ void FindBarGtk::InitWidgets() {
// the slide effect.
GtkWidget* hbox = gtk_hbox_new(false, 0);
container_ = gtk_util::CreateGtkBorderBin(hbox, NULL,
- kBarPaddingTopBottom, kBarPaddingTopBottom,
+ kBarPaddingTop, kBarPaddingBottom,
kEntryPaddingLeft, kBarPaddingRight);
- gtk_widget_set_size_request(container_, kFindBarWidth, -1);
+ gtk_widget_set_size_request(container_, kFindBarWidth, kFindBarHeight);
ViewIDUtil::SetID(container_, VIEW_ID_FIND_IN_PAGE);
gtk_widget_set_app_paintable(container_, TRUE);
@@ -239,9 +240,14 @@ void FindBarGtk::InitWidgets() {
SlideAnimatorGtk::DOWN,
0, false, true, NULL));
- close_button_.reset(CustomDrawButton::CloseButton(theme_service_));
- gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true,
- kCloseButtonPaddingLeft);
+ GtkWidget* close_alignment = gtk_alignment_new(0, 0.6, 1, 0);
+ close_button_.reset(new CustomDrawButton(
+ theme_service_, IDR_TAB_CLOSE,
+ IDR_TAB_CLOSE_P, IDR_TAB_CLOSE_H, IDR_TAB_CLOSE,
+ GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU));
+ gtk_container_add(GTK_CONTAINER(close_alignment), close_button_->widget());
+ gtk_box_pack_end(GTK_BOX(hbox), close_alignment, FALSE, FALSE,
+ kCloseButtonPadding);
g_signal_connect(close_button_->widget(), "clicked",
G_CALLBACK(OnClickedThunk), this);
gtk_widget_set_tooltip_text(close_button_->widget(),
@@ -537,11 +543,12 @@ void FindBarGtk::Observe(int type,
gtk_misc_set_alignment(GTK_MISC(match_count_label_), 0.5, 1.0);
+ // This is necessary to make the close button dark enough.
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
close_button_->SetBackground(
theme_service_->GetColor(ThemeService::COLOR_TAB_TEXT),
- rb.GetImageNamed(IDR_CLOSE_BAR).AsBitmap(),
- rb.GetImageNamed(IDR_CLOSE_BAR_MASK).AsBitmap());
+ rb.GetImageNamed(IDR_TAB_CLOSE).AsBitmap(),
+ rb.GetImageNamed(IDR_TAB_CLOSE).AsBitmap());
}
UpdateMatchLabelAppearance(match_label_failure_);
« 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