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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm

Issue 2927193002: Omnibox UI: Create right-margin on Cocoa dropdown (Closed)
Patch Set: merge Created 3 years, 6 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
Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
index 2aef7d870d55b5fe9dabe2906f4d4a197ec28045..6f69d1952067200e253a65bc16e35f5952261964 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
@@ -483,8 +483,8 @@ NSAttributedString* CreateClassifiedAttributedString(
base::mac::ObjCCastStrict<OmniboxPopupCellData>([self objectValue]);
OmniboxPopupMatrix* tableView =
base::mac::ObjCCastStrict<OmniboxPopupMatrix>(controlView);
- CGFloat remainingWidth = [OmniboxPopupCell getContentAreaWidth:cellFrame] -
- [tableView contentLeftPadding];
+ CGFloat remainingWidth =
+ [OmniboxPopupCell getTextContentAreaWidth:[tableView contentMaxWidth]];
CGFloat contentsWidth = [cellData getMatchContentsWidth];
CGFloat separatorWidth = [[tableView separator] size].width;
CGFloat descriptionWidth =
@@ -586,8 +586,8 @@ NSAttributedString* CreateClassifiedAttributedString(
OmniboxPopupCellData* cellData =
base::mac::ObjCCastStrict<OmniboxPopupCellData>([self objectValue]);
CGFloat offset = 0.0f;
- CGFloat remainingWidth = [OmniboxPopupCell getContentAreaWidth:cellFrame] -
- [tableView contentLeftPadding];
+ CGFloat remainingWidth =
+ [OmniboxPopupCell getTextContentAreaWidth:[tableView contentMaxWidth]];
CGFloat prefixWidth = [[cellData prefix] size].width;
CGFloat prefixOffset = 0.0f;
@@ -720,8 +720,8 @@ NSAttributedString* CreateClassifiedAttributedString(
return CreateAttributedString(raw_separator, DimTextColor(isDarkTheme));
}
-+ (CGFloat)getContentAreaWidth:(NSRect)cellFrame {
- return NSWidth(cellFrame) - kMaterialTextStartOffset;
++ (CGFloat)getTextContentAreaWidth:(CGFloat)cellContentMaxWidth {
+ return cellContentMaxWidth - kMaterialTextStartOffset;
}
+ (CGFloat)getContentTextHeightForDoubleLine:(BOOL)isDoubleLine {
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698