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

Unified Diff: chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm

Issue 2710043002: [Mac] Ensure security state label doesn't overlap divider (Closed)
Patch Set: Created 3 years, 10 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/location_bar/security_state_bubble_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
index 63d57f320db196887ba8373d648969414f8225ba..3d52003c25b39d5a03f3c62d99044adff1e71fd0 100644
--- a/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
@@ -30,8 +30,8 @@
namespace {
-// Padding between the icon and label.
-CGFloat kIconLabelPadding = 4.0;
+// Padding between the label and icon/divider.
+CGFloat kLabelPadding = 4.0;
// Inset for the background.
const CGFloat kBackgroundYInset = 4.0;
@@ -164,10 +164,13 @@ void SecurityStateBubbleDecoration::DrawInFrame(NSRect frame,
fraction:image_alpha
respectFlipped:YES
hints:nil];
- if (is_rtl)
- text_right_offset = NSMinX(image_rect) - kIconLabelPadding;
- else
- text_left_offset = NSMaxX(image_rect) + kIconLabelPadding;
+ if (is_rtl) {
+ text_left_offset += DividerPadding();
+ text_right_offset = NSMinX(image_rect);
+ } else {
+ text_right_offset -= DividerPadding();
+ text_left_offset = NSMaxX(image_rect);
+ }
}
// Set the text color and draw the text.
@@ -200,6 +203,7 @@ void SecurityStateBubbleDecoration::DrawInFrame(NSRect frame,
text_rect.origin.y = std::round(NSMidY(text_rect) - textHeight / 2.0) - 1;
text_rect.size.width = text_right_offset - text_left_offset;
text_rect.size.height = textHeight;
+ text_rect = NSInsetRect(text_rect, kLabelPadding, 0);
NSAffineTransform* transform = [NSAffineTransform transform];
CGFloat progress = GetAnimationProgress();
« 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