diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-03 17:43:32 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-03 17:43:32 +0000 |
commit | bb7d413a1d400d5b1dc7fcbb2a7904bf2eb13e5a (patch) | |
tree | 037d649297171cb2d32392931dbfaf5df27831e4 | |
parent | c42799fb803edf7c35d27cdb2ed886ec18455e31 (diff) | |
download | chromium_src-bb7d413a1d400d5b1dc7fcbb2a7904bf2eb13e5a.zip chromium_src-bb7d413a1d400d5b1dc7fcbb2a7904bf2eb13e5a.tar.gz chromium_src-bb7d413a1d400d5b1dc7fcbb2a7904bf2eb13e5a.tar.bz2 |
Put a border around the find bar text entry field.
Review URL: http://codereview.chromium.org/56207
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13091 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | base/gfx/gtk_util.cc | 3 | ||||
-rwxr-xr-x | base/gfx/gtk_util.h | 1 | ||||
-rw-r--r-- | chrome/browser/gtk/find_bar_gtk.cc | 11 |
3 files changed, 9 insertions, 6 deletions
diff --git a/base/gfx/gtk_util.cc b/base/gfx/gtk_util.cc index 047d9f0..1b0fc31 100755 --- a/base/gfx/gtk_util.cc +++ b/base/gfx/gtk_util.cc @@ -14,6 +14,7 @@ namespace gfx { const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff); const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00); +const GdkColor kGdkGreen = GDK_COLOR_RGB(0x00, 0xff, 0x00); void SubtractRectanglesFromRegion(GdkRegion* region, const std::vector<Rect>& cutouts) { @@ -71,7 +72,7 @@ GtkWidget* CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, // inside to get the sizes exactly of how we want the border painted. GtkWidget* ebox = gtk_event_box_new(); gtk_widget_modify_bg(ebox, GTK_STATE_NORMAL, color); - GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1); + GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), top, bottom, left, right); gtk_container_add(GTK_CONTAINER(alignment), child); gtk_container_add(GTK_CONTAINER(ebox), alignment); diff --git a/base/gfx/gtk_util.h b/base/gfx/gtk_util.h index 909dec3..6407554 100755 --- a/base/gfx/gtk_util.h +++ b/base/gfx/gtk_util.h @@ -24,6 +24,7 @@ class Rect; extern const GdkColor kGdkWhite; extern const GdkColor kGdkBlack; +extern const GdkColor kGdkGreen; // Modify the given region by subtracting the given rectangles. void SubtractRectanglesFromRegion(GdkRegion* region, diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc index d6fb447..2fdc9f85 100644 --- a/chrome/browser/gtk/find_bar_gtk.cc +++ b/chrome/browser/gtk/find_bar_gtk.cc @@ -18,6 +18,7 @@ namespace { const GdkColor kBackgroundColor = GDK_COLOR_RGB(0xe6, 0xed, 0xf4); +const GdkColor kBorderColor = GDK_COLOR_RGB(0xbe, 0xc8, 0xd4); // Padding around the container. const int kBarPadding = 4; @@ -91,11 +92,11 @@ void FindBarGtk::InitWidgets() { // font size. gtk_widget_set_size_request(find_text_, -1, 20); gtk_entry_set_has_frame(GTK_ENTRY(find_text_), FALSE); - // TODO(tc): We need a border around the find box. This should probably be - // drawn by the background. I tried drawing one using - // gfx::CreateGtkBorderBin, but I couldn't get it to draw a 1px border on - // top and bottom. - gtk_box_pack_end(GTK_BOX(hbox), find_text_, FALSE, FALSE, 0); + GtkWidget* border_bin = gfx::CreateGtkBorderBin(find_text_, &kBorderColor, + 1, 1, 1, 0); + centering_vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(centering_vbox), border_bin, TRUE, FALSE, 0); + gtk_box_pack_end(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, 0); g_signal_connect(G_OBJECT(find_text_), "changed", |