Nontransparent download progress bar in OS X Yosemite

ASSIGNED

Status

()

Firefox
Theme
ASSIGNED
3 years ago
10 months ago

People

(Reporter: Kuba, Assigned: Gustavo Vera Scuderi)

Tracking

36 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

3 years ago
Created attachment 8585173 [details]
progressbar.png

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20150320202338

Steps to reproduce:

Start downloading a file


Actual results:

The progress bar has white opaque background (see attached screenshot), tested on a fresh Yosemite install with fresh Firefox profile, also tested with Nightly 39.0a1.


Expected results:

The border around the progress bar should be transparent.
(Reporter)

Updated

3 years ago
Component: Untriaged → Theme
(Assignee)

Comment 1

3 years ago
Created attachment 8596204 [details]
nontransparent-progressbar.png

It happens to me too. Firefox 37.0.2 on OS X 10.10.3 Yosemite.

Seems like a bug since progress bars on Yosemite have less height. On Mavericks looks fine.
(Assignee)

Comment 2

3 years ago
Created attachment 8607327 [details]
The progress bar with the older bounds removed

Finally looked at the code and figured out what happened here.

The rect made for the progress bar is still using the pre-Yosemite size, so the new Yosemite styled progress bar aligns itself right in the middle, revealing all the empty space around. This only happens on Yosemite, of course. On Mavericks looks fine.

After a while I (kinda) fixed it. Will post a patch as soon as I clean up the code. However, the progress bar still looks weird considering the new height on Yosemite and given that maybe Apple won't change it in a long time. Maybe we need a new kind of download indicator like the Chrome "download pie".
(Assignee)

Comment 3

3 years ago
Created attachment 8607341 [details] [diff] [review]
Proposed patch v1

This is the first solution I've found. It's not that elegant, but it gets the job done for now.

It uses AppKit for detecting the OS X version at runtime. If it's Mavericks or pre-Mavericks doesn't do anything to what it is now, but if it is Yosemite it will use a different height for the progress bar background.
Attachment #8607341 - Flags: review?(gavin.sharp)
Attachment #8607341 - Flags: review?(smichaud)
Attachment #8607341 - Flags: review?(mstange)
Attachment #8607341 - Flags: review?(gavin.sharp)
Assignee: nobody → gvescu
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I won't be able to get to this review right away.  With luck it'll be sometime next week.
Duplicate of this bug: 1088742
Comment on attachment 8607341 [details] [diff] [review]
Proposed patch v1

Review of attachment 8607341 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/cocoa/nsMacDockSupport.mm
@@ +156,3 @@
>      [mProgressBackground lockFocus];
> +    [[NSColor clearColor] set];
> +    NSRectFill(NSRectFromCGRect(mProgressBoundsMask));

Why did you choose not to clear the whole mProgressBounds?

I think just changing "whiteColor" to "clearColor" should be all that's necessary to fix this bug.
Attachment #8607341 - Flags: review?(smichaud)
Attachment #8607341 - Flags: review?(mstange)
(Assignee)

Comment 7

3 years ago
Just putting clearColor doesn't do, it just makes a clear transparent space (clipping the logo) instead of the white space we see here: https://bugzilla.mozilla.org/attachment.cgi?id=8596204. That's why I choose to reduce the bounds of it.
(Assignee)

Comment 8

3 years ago
However, now that you mention it, I'll try to skip the drawing of the mProgressBounds space if it's Yosemite. Might post another patch later :)
Oh, I see the problem now. Can we store the icon without the progress bar in a different buffer, so that we can always recomposite both original images? Then we don't have to worry about getting the bounds of the progress bar right.
(Assignee)

Comment 10

3 years ago
I think it might be possible to remove the white space drawing altogether. The redraw function for the progress bar just need the mProgressBounds rect values.

Something I noticed last night is that the white background seems to be just for make the downloading progress bar more noticeable. Just look at the result of my fix using clearColor: https://bugzilla.mozilla.org/attachment.cgi?id=8607327. With whiteColor it would be better, but we'll have to clip again to make it have round corners.

Again, I'll try removing the rect drawing when I get home. I guess it would be a better solution than guessing the bounds.

Comment 11

2 years ago
Any news on this? Almost a year later since the last comment (with a nice screenshot!) I still get that progress bar inside a white rectangle.

Comment 12

11 months ago
Still unresolved on 52.0 ESR. Would be great if this could be solved or - in case this is not possible short term - if an option to disable the progress bar on the dock icon be added. I do not find it all that useful personally and rather don't see it at all than in it's current form...

Comment 13

11 months ago
Oh, how about replacing the progress bar with a native macOS feature, those little numbers in a red circle that you get e.g. when Mail has unread messages? Clear the counter when the download window has been opened after the download completed, maybe...
You need to log in before you can comment on or make changes to this bug.