summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasvitkine <asvitkine@chromium.org>2016-01-25 15:12:49 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-25 23:14:32 +0000
commitbf571b6dcf58bd8a28fdd5e15b4428e5c2a0b44f (patch)
tree511daf2bb29da7686f582370efdb65f8df6b660a
parentd485ba70f05e5fe831ae90625a44bf5b0d880dd7 (diff)
downloadchromium_src-bf571b6dcf58bd8a28fdd5e15b4428e5c2a0b44f.zip
chromium_src-bf571b6dcf58bd8a28fdd5e15b4428e5c2a0b44f.tar.gz
chromium_src-bf571b6dcf58bd8a28fdd5e15b4428e5c2a0b44f.tar.bz2
[Mac] Fix BMB chevron button being black on Chrome open.
It seems the issue is caused by the button being drawn into a layer early on and being cached. Adding a -setNeedsDisplay: when we actually determine whether it should be visible fixes the problem - so that the first actual paint to the screen has the correct appearance. I'm not sure why Cocoa draws it to a layer earlier than this (this doesn't happen for other buttons), nor why it's background color is black when that happens. However, this change does fix the bad appearance. BUG=563395 Review URL: https://codereview.chromium.org/1630453002 Cr-Commit-Position: refs/heads/master@{#371344}
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index 0d5f650..fb6d1c0 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -865,6 +865,11 @@ void RecordAppLaunch(Profile* profile, GURL url) {
int bookmarkChildren = bookmarkModel_->bookmark_bar_node()->child_count();
if (bookmarkChildren > displayedButtonCount_) {
[offTheSideButton_ setHidden:NO];
+ // Set the off the side button as needing re-display. This is needed to
+ // avoid the button being shown with a black background the first time
+ // it's displayed. See https://codereview.chromium.org/1630453002/ for
+ // more context.
+ [offTheSideButton_ setNeedsDisplay:YES];
} else {
// If we just deleted the last item in an off-the-side menu so the
// button will be going away, make sure the menu goes away.