diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 15:28:52 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 15:28:52 +0000 |
commit | 7351ada6d9543544b0bbed579c9eabd98d6e98ec (patch) | |
tree | 6a9e5107becef86331a641e8e280b7c4bcfb9a7d /chrome/browser/autocomplete | |
parent | 4d8c97a0fc89283697f3a580a6febad4c2fe972b (diff) | |
download | chromium_src-7351ada6d9543544b0bbed579c9eabd98d6e98ec.zip chromium_src-7351ada6d9543544b0bbed579c9eabd98d6e98ec.tar.gz chromium_src-7351ada6d9543544b0bbed579c9eabd98d6e98ec.tar.bz2 |
Use the new selected icons in Linux Omnibox.
Review URL: http://codereview.chromium.org/100200
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index 72a1c78..1b7a500 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -173,34 +173,39 @@ void SetupLayoutForMatch(PangoLayout* layout, pango_attr_list_unref(attrs); } -GdkPixbuf* IconForMatch(const AutocompleteMatch& match) { +GdkPixbuf* IconForMatch(const AutocompleteMatch& match, bool selected) { // TODO(deanm): These would be better as pixmaps someday. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); static GdkPixbuf* o2_globe = rb.GetPixbufNamed(IDR_O2_GLOBE); + static GdkPixbuf* o2_globe_s = rb.GetPixbufNamed(IDR_O2_GLOBE_SELECTED); static GdkPixbuf* o2_history = rb.GetPixbufNamed(IDR_O2_HISTORY); + static GdkPixbuf* o2_history_s = rb.GetPixbufNamed(IDR_O2_HISTORY_SELECTED); static GdkPixbuf* o2_more = rb.GetPixbufNamed(IDR_O2_MORE); + static GdkPixbuf* o2_more_s = rb.GetPixbufNamed(IDR_O2_MORE_SELECTED); static GdkPixbuf* o2_search = rb.GetPixbufNamed(IDR_O2_SEARCH); + static GdkPixbuf* o2_search_s = rb.GetPixbufNamed(IDR_O2_SEARCH_SELECTED); static GdkPixbuf* o2_star = rb.GetPixbufNamed(IDR_O2_STAR); + static GdkPixbuf* o2_star_s = rb.GetPixbufNamed(IDR_O2_STAR_SELECTED); if (match.starred) - return o2_star; + return selected ? o2_star_s : o2_star; switch (match.type) { case AutocompleteMatch::URL_WHAT_YOU_TYPED: case AutocompleteMatch::NAVSUGGEST: - return o2_globe; + return selected ? o2_globe_s : o2_globe; case AutocompleteMatch::HISTORY_URL: case AutocompleteMatch::HISTORY_TITLE: case AutocompleteMatch::HISTORY_BODY: case AutocompleteMatch::HISTORY_KEYWORD: - return o2_history; + return selected ? o2_history_s : o2_history; case AutocompleteMatch::SEARCH_WHAT_YOU_TYPED: case AutocompleteMatch::SEARCH_HISTORY: case AutocompleteMatch::SEARCH_SUGGEST: case AutocompleteMatch::SEARCH_OTHER_ENGINE: - return o2_search; + return selected ? o2_search_s : o2_search; case AutocompleteMatch::OPEN_HISTORY_PAGE: - return o2_more; + return selected ? o2_more_s : o2_more; default: NOTREACHED(); break; @@ -425,7 +430,7 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, } // Draw the icon for this result time. - DrawFullPixbuf(drawable, gc, IconForMatch(match), + DrawFullPixbuf(drawable, gc, IconForMatch(match, is_selected), kIconLeftPadding, line_rect.y() + kIconTopPadding); // Draw the results text vertically centered in the results space. |