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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm

Issue 12079033: mac: Move bookmark hierarchy arrow from a pdf to a png. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rsesek Created 7 years, 11 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 | « chrome/app/theme/menu_hierarchy_arrow.pdf ('k') | chrome/chrome_dll_bundle.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
index 5c636fc93905b6e95dfd77fe2bfab7f0cc59c12a..d1880c7a3efcc409fc500bcfa8695035acc3f8db 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -11,11 +11,14 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h"
#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
+#include "grit/ui_resources.h"
#include "ui/base/l10n/l10n_util_mac.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/mac/nsimage_cache.h"
using content::UserMetricsAction;
+const int kHierarchyButtonXMargin = 4;
@interface BookmarkButtonCell(Private)
- (void)configureBookmarkButtonCell;
@@ -223,8 +226,9 @@ using content::UserMetricsAction;
- (void)setDrawFolderArrow:(BOOL)draw {
drawFolderArrow_ = draw;
if (draw && !arrowImage_) {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
arrowImage_.reset(
- [gfx::GetCachedImageWithName(@"menu_hierarchy_arrow.pdf") retain]);
+ [rb.GetNativeImageNamed(IDR_MENU_HIERARCHY_ARROW).ToNSImage() retain]);
}
}
@@ -233,7 +237,7 @@ using content::UserMetricsAction;
- (NSSize)cellSize {
NSSize cellSize = [super cellSize];
if (drawFolderArrow_) {
- cellSize.width += [arrowImage_ size].width; // plus margin?
+ cellSize.width += [arrowImage_ size].width + 2 * kHierarchyButtonXMargin;
}
return cellSize;
}
@@ -252,7 +256,8 @@ using content::UserMetricsAction;
NSRect imageRect = NSZeroRect;
imageRect.size = [arrowImage_ size];
const CGFloat kArrowOffset = 1.0; // Required for proper centering.
- CGFloat dX = NSWidth(cellFrame) - NSWidth(imageRect);
+ CGFloat dX =
+ NSWidth(cellFrame) - NSWidth(imageRect) - kHierarchyButtonXMargin;
CGFloat dY = (NSHeight(cellFrame) / 2.0) - (NSHeight(imageRect) / 2.0) +
kArrowOffset;
NSRect drawRect = NSOffsetRect(imageRect, dX, dY);
« no previous file with comments | « chrome/app/theme/menu_hierarchy_arrow.pdf ('k') | chrome/chrome_dll_bundle.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698