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

Issue 1125363005: Fix darkly-drawn Show All button in Downloads Shelf. (Closed)

Created:
5 years, 7 months ago by shrike
Modified:
5 years, 7 months ago
CC:
benjhayden+dwatch_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix darkly-drawn Show All button in Downloads Shelf. When the download shelf appears the Show All button at the far right is very dark, almost as if its been drawn several times on top of itself (see the original bug report for a screenshot of the problem). The problem is that the Show All button is layer backed (because the shelf is), so it caches its contents. The Show All button also declares itself to be opaque but wants the shelf background texture to show through. It accomplishes this by simulating a lock focus onto the shelf from within its drawRect:, and calling the shelf's drawRect:. Unfortunately, when the button first draws (into its layer) the shelf is hidden and so the shelf's height is 0.0. The shelf's drawing routines restrict themselves to the shelf's bounds rect - that works most of the time because if the shelf has 0 height there should be no drawing to be done. This optimization doesn't work for the Show All button when it uses the zero-height shelf to draw its background. The proposed fix is to detect the zero-height shelf from within drawRect:, and to use a frame-changed notification from the shelf as the signal to request a redraw. BUG=485782 Committed: https://crrev.com/890dcc45af511f04eeb72462849aa78434f07e59 Cr-Commit-Position: refs/heads/master@{#330120}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Change API to accommodate Show All button background drawing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -6 lines) Patch
M chrome/browser/ui/cocoa/download/download_show_all_button.mm View 1 1 chunk +12 lines, -1 line 0 comments Download
M ui/base/cocoa/nsview_additions.h View 1 1 chunk +6 lines, -1 line 0 comments Download
M ui/base/cocoa/nsview_additions.mm View 1 2 chunks +13 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
shrike
Hello asanka, This is a bug I've seen before, but ran into it repeatedly while ...
5 years, 7 months ago (2015-05-07 23:03:50 UTC) #2
asanka
lgtm assuming this works well with shelf animation. https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm File chrome/browser/ui/cocoa/download/download_show_all_button.mm (right): https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm#newcode81 chrome/browser/ui/cocoa/download/download_show_all_button.mm:81: } ...
5 years, 7 months ago (2015-05-08 17:48:36 UTC) #3
asanka
https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm File chrome/browser/ui/cocoa/download/download_show_all_button.mm (right): https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm#newcode74 chrome/browser/ui/cocoa/download/download_show_all_button.mm:74: [[NSColor colorWithCalibratedWhite:0.8 alpha:1.0] set]; Is there a way to ...
5 years, 7 months ago (2015-05-08 17:49:39 UTC) #4
shrike
https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm File chrome/browser/ui/cocoa/download/download_show_all_button.mm (right): https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm#newcode74 chrome/browser/ui/cocoa/download/download_show_all_button.mm:74: [[NSColor colorWithCalibratedWhite:0.8 alpha:1.0] set]; On 2015/05/08 17:49:39, asanka wrote: ...
5 years, 7 months ago (2015-05-08 18:27:48 UTC) #5
asanka
https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm File chrome/browser/ui/cocoa/download/download_show_all_button.mm (right): https://codereview.chromium.org/1125363005/diff/1/chrome/browser/ui/cocoa/download/download_show_all_button.mm#newcode74 chrome/browser/ui/cocoa/download/download_show_all_button.mm:74: [[NSColor colorWithCalibratedWhite:0.8 alpha:1.0] set]; On 2015/05/08 at 18:27:48, shrike ...
5 years, 7 months ago (2015-05-12 00:20:52 UTC) #6
shrike
Hello asanka, I understand and agree with your concern about the Show All button background ...
5 years, 7 months ago (2015-05-12 21:36:07 UTC) #8
Robert Sesek
I don't have any input here; I'm not too familiar with this bit of code. ...
5 years, 7 months ago (2015-05-13 18:38:55 UTC) #9
shrike
Hello avi, My current proposal for fixing this bug involves adding a variant of cr_drawUsingAncestor:inRect: ...
5 years, 7 months ago (2015-05-13 21:07:07 UTC) #11
Avi (use Gerrit)
lgtm This is fine.
5 years, 7 months ago (2015-05-13 21:49:40 UTC) #12
asanka
On 2015/05/13 at 21:49:40, avi wrote: > lgtm > > This is fine. lgtm from ...
5 years, 7 months ago (2015-05-14 22:09:56 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1125363005/20001
5 years, 7 months ago (2015-05-15 16:41:33 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 7 months ago (2015-05-15 17:29:47 UTC) #16
commit-bot: I haz the power
5 years, 7 months ago (2015-05-15 17:30:32 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/890dcc45af511f04eeb72462849aa78434f07e59
Cr-Commit-Position: refs/heads/master@{#330120}

Powered by Google App Engine
This is Rietveld 408576698