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

Unified Diff: chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm

Issue 2723233006: Cocoa Page Info: Take built-in padding into account for "Site settings" button placement. (Closed)
Patch Set: Remove dependency (not needed for this CL). Created 3 years, 9 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/ui/cocoa/website_settings/website_settings_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm
index dbbb27337ecda272f46c32a15125b5692bb45aed..d542f98d6904ca5d56e9711dcf259f91f2657f24 100644
--- a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm
@@ -70,6 +70,9 @@ const CGFloat kSectionHorizontalPadding = 16;
// align with other text.
const CGFloat kLinkButtonXAdjustment = 1;
+// Built-in margin for NSButton to take into account.
+const CGFloat kNSButtonBuiltinMargin = 4;
+
// Security Section ------------------------------------------------------------
// Spacing between security summary, security details, and cert decisions text.
@@ -441,13 +444,13 @@ bool IsInternalURL(const GURL& url) {
- (CGFloat)layoutViewAtRTLStart:(NSView*)view withYPosition:(CGFloat)yPos {
CGFloat xPos;
if (base::i18n::IsRTL()) {
- xPos =
- kDefaultWindowWidth - kSectionHorizontalPadding - NSWidth([view frame]);
+ xPos = kDefaultWindowWidth - kSectionHorizontalPadding -
+ NSWidth([view frame]) + kNSButtonBuiltinMargin;
} else {
- xPos = kSectionHorizontalPadding;
+ xPos = kSectionHorizontalPadding - kNSButtonBuiltinMargin;
}
- [view setFrameOrigin:NSMakePoint(xPos, yPos)];
- return yPos + NSHeight([view frame]);
+ [view setFrameOrigin:NSMakePoint(xPos, yPos - kNSButtonBuiltinMargin)];
+ return yPos + NSHeight([view frame]) - kNSButtonBuiltinMargin;
}
// Set the Y position of |view| to the given position, and return the position
« 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