From 08fb74a9f12f59c531cc5d7acdb0afea183dba12 Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Fri, 13 Mar 2009 17:50:34 +0000 Subject: Improve the look of the Linux omnibox. - Paint a border around the input widget, which makes it fit better into the toolbar. A bordered widget is also very nice to have for debugging, so I abstracted a small helper for making a bordered bin. - Improve the results popup by painting with some Pango attributes. Sort of looks awful over NX, but I'm hoping it looks better on a real session. BUG=8236 Review URL: http://codereview.chromium.org/46035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11644 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'chrome/browser/autocomplete') diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index 94a5cdf..4cd305f 100755 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -41,7 +41,6 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk( // Set up a 1 pixel border around the popup. gtk_container_set_border_width(GTK_CONTAINER(window_), 1); gtk_widget_modify_bg(window_, GTK_STATE_NORMAL, &kPopupBorderColor); - gtk_widget_modify_base(window_, GTK_STATE_NORMAL, &kPopupBorderColor); } AutocompletePopupViewGtk::~AutocompletePopupViewGtk() { @@ -73,11 +72,14 @@ void AutocompletePopupViewGtk::UpdatePopupAppearance() { vbox_ = gtk_vbox_new(FALSE, 0); for (size_t i = 0; i < result.size(); ++i) { - std::string utf8; - utf8.append(WideToUTF8(result.match_at(i).contents)); - utf8.append(" - "); - utf8.append(WideToUTF8(result.match_at(i).description)); - GtkWidget* label = gtk_label_new(utf8.c_str()); + GtkWidget* label = gtk_label_new(NULL); + char* markup = g_markup_printf_escaped( + "%s %s", + WideToUTF8(result.match_at(i).contents).c_str(), + WideToUTF8(result.match_at(i).description).c_str()); + gtk_label_set_markup(GTK_LABEL(label), markup); + g_free (markup); + // We need to put the labels in an event box for background painting. GtkWidget* ebox = gtk_event_box_new(); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); -- cgit v1.1