| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 9 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
| 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Padding on the right side of the arrow icon. | 26 // Padding on the right side of the arrow icon. |
| 27 const int kHierarchyButtonRightPadding = 4; | 27 const int kHierarchyButtonRightPadding = 4; |
| 28 | 28 |
| 29 // Padding on the left side of the arrow icon. | 29 // Padding on the left side of the arrow icon. |
| 30 int HierarchyButtonLeftPadding() { | 30 int HierarchyButtonLeftPadding() { |
| 31 return ui::MaterialDesignController::IsModeMaterial() ? 11 : 2; | 31 return ui::MaterialDesignController::IsModeMaterial() ? 11 : 2; |
| 32 } | 32 } |
| 33 | 33 |
| 34 const int kIconTextSpacer = 4; | 34 const int kIconTextSpacer = 4; |
| 35 const int kTextRightPadding = 1; | 35 const int kTextRightPadding = 3; |
| 36 const int kIconLeftPadding = 1; | 36 const int kIconLeftPadding = 3; |
| 37 | 37 |
| 38 const int kDefaultFontSize = 12; | 38 const int kDefaultFontSize = 12; |
| 39 | 39 |
| 40 }; // namespace | 40 }; // namespace |
| 41 | 41 |
| 42 @interface OffTheSideButtonCell : BookmarkButtonCell | 42 @interface OffTheSideButtonCell : BookmarkButtonCell |
| 43 @end | 43 @end |
| 44 @implementation OffTheSideButtonCell | 44 @implementation OffTheSideButtonCell |
| 45 | 45 |
| 46 - (BOOL)isOffTheSideButtonCell { | 46 - (BOOL)isOffTheSideButtonCell { |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 if (!ui::MaterialDesignController::IsModeMaterial()) { | 436 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 437 return 0; | 437 return 0; |
| 438 } | 438 } |
| 439 return -1; | 439 return -1; |
| 440 } | 440 } |
| 441 | 441 |
| 442 - (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView { | 442 - (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView { |
| 443 // In Material Design on Retina, and not in a folder menu, nudge the hover | 443 // In Material Design on Retina, and not in a folder menu, nudge the hover |
| 444 // background by 1px. | 444 // background by 1px. |
| 445 const CGFloat kLineWidth = [controlView cr_lineWidth]; | 445 const CGFloat kLineWidth = [controlView cr_lineWidth]; |
| 446 if ([self tag] == kMaterialStandardButtonTypeWithLimitedClickFeedback && | 446 if ([self isMaterialDesignButtonType] && ![self isFolderButtonCell] && |
| 447 ![self isFolderButtonCell] && kLineWidth < 1) { | 447 kLineWidth < 1) { |
| 448 return -kLineWidth; | 448 return -kLineWidth; |
| 449 } | 449 } |
| 450 return 0.0; | 450 return 0.0; |
| 451 } | 451 } |
| 452 | 452 |
| 453 | 453 |
| 454 @end | 454 @end |
| OLD | NEW |