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

Unified Diff: chrome/browser/ui/cocoa/browser_window_touch_bar.mm

Issue 2928183002: [Mac] Move Back/Forward Touch Bar Icons 2 pts lower (Closed)
Patch Set: 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
« 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/browser_window_touch_bar.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_touch_bar.mm b/chrome/browser/ui/cocoa/browser_window_touch_bar.mm
index fbe2e7b1b9c1327afd6cd9e25a3d0dadfeddd78f..2fab43539071b54f9d241fb9d89376d46ce47e93 100644
--- a/chrome/browser/ui/cocoa/browser_window_touch_bar.mm
+++ b/chrome/browser/ui/cocoa/browser_window_touch_bar.mm
@@ -375,10 +375,25 @@ class HomePrefNotificationBridge {
}
- (NSView*)backOrForwardTouchBarView {
- NSArray* images = @[
+ NSMutableArray* images = [NSMutableArray arrayWithArray:@[
CreateNSImageFromIcon(ui::kBackArrowIcon),
CreateNSImageFromIcon(ui::kForwardArrowIcon)
- ];
+ ]];
+
+ // Offset the icons so that it matches the height of the other Touch Bar
+ // items.
+ const int kIconYOffset = 2;
+ for (NSUInteger i = 0; i < [images count]; i++) {
+ NSImage* image = [images objectAtIndex:i];
+ NSSize size = [image size];
+ size.height += kIconYOffset;
+
+ NSImage* offsettedImage = [[[NSImage alloc] initWithSize:size] autorelease];
+ [offsettedImage lockFocus];
+ [image drawInRect:NSMakeRect(0, 0, size.width, size.height - kIconYOffset)];
+ [offsettedImage unlockFocus];
+ [images replaceObjectAtIndex:i withObject:offsettedImage];
+ }
NSSegmentedControl* control = [NSSegmentedControl
segmentedControlWithImages:images
« 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