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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc

Issue 99222: Fix a small undercalculation of the space available a result description. (Closed)
Patch Set: Rename content_width. Created 11 years, 8 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/autocomplete/autocomplete_popup_view_gtk.cc
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
index 1a997f242c7e4f761800f7b74f97566af5055870..9497334c3f5b0cbc228d8158fe0007c393db3616 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
@@ -440,9 +440,9 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget,
// if there is also a description to be shown.
bool has_description = !match.description.empty();
int text_width = window_rect.width() - (kIconAreaWidth + kRightPadding);
- int content_width = has_description ?
+ int allocated_content_width = has_description ?
text_width * kContentWidthPercentage : text_width;
- pango_layout_set_width(layout_, content_width * PANGO_SCALE);
+ pango_layout_set_width(layout_, allocated_content_width * PANGO_SCALE);
SetupLayoutForMatch(layout_, match.contents, match.contents_class,
&kContentTextColor, std::string());
@@ -464,7 +464,7 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget,
if (has_description) {
pango_layout_set_width(layout_,
- (text_width - content_width) * PANGO_SCALE);
+ (text_width - actual_content_width) * PANGO_SCALE);
SetupLayoutForMatch(layout_, match.description, match.description_class,
is_selected ? &kDescriptionSelectedTextColor :
&kDescriptionTextColor,
« 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