Open Bug 1189189 Opened 4 years ago Updated 3 years ago

GTK <progress> widget is rounded on left (filled portion), squarish on right (un-filled portion), with Ambiance (default Ubuntu GTK theme)

Categories

(Core :: Widget: Gtk, defect, P4)

Unspecified
Linux
defect

Tracking

()

Tracking Status
firefox42 --- affected

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: regression, Whiteboard: tpi:+)

Attachments

(6 files)

Attached image screenshot
STR:
 1. Load data:text/html,<progress value="0.5">
   (optional: add a "width" to make the asymmetry clearer)
 2. Compare left edge of progress to right edge.

ACTUAL RESULTS:
Left edge looks nice and rounded. Right edge looks like a square with rounded corners.

EXPECTED RESULTS:
Both edges nice & rounded.

This is a regression from the switch to GTK3, I'm pretty sure.

See attached screenshot, comparing Nightly 42.0a1 2015-07-29 (top) to Firefox 39 (bottom).
Blocks: gtk3
Summary: GTK <progress> widget looks asymmetrical → GTK <progress> widget is rounded on left (filled portion), squarish on right (un-filled portion)
Keywords: regression
OS: Unspecified → Linux
It's odd that there is a difference in radius between the progress chunk and the trough, but this fine with Adwaita, so this may just be a quirk of Ambiance.

We need to compare with a native GTK app to know whether this is the intended appearance.
Here's a screenshot of the nautilus file-copy dialog, for a slow file-copy operation. It looks squarish (with rounded corners) on both ends.

So, the bug in my original Firefox screenshot here is actually the left edge, which is currently rounded, but *should* be squarish with rounded corners to match the native theme & native apps.
Summary: GTK <progress> widget is rounded on left (filled portion), squarish on right (un-filled portion) → GTK <progress> widget is rounded on left (filled portion), squarish on right (un-filled portion), with Ambiance (default Ubuntu GTK theme)
(I wonder if the issue here is that GTK expects the filled progress region to be clipped to the widget's border, or something like that? and we're drawing them separately, in the wrong order?)

Also: This bug mostly (but not quite entirely) goes away at higher zoom-levels & widget-heights.  At the default widget-size, the left edge of the progress region looks entirely rounded, but as I zoom in, there's a flat portion that stretches out, & it ends up looking squarish with rounded corners (slightly more rounded than they should be, though -- it's not quite symmetrical with the right side).
Here's a screenshot after hitting "Ctrl +" five times when viewing data:text/html,<progress value="0.5">.

As you can see, the left edge of the progress area becomes squarish.  But unlike with the native-app (nautilus) screenshot, the left corners are still a bit more rounded than the corners at the far right edge of the widget. (and they seem to be protruding from the widget's border a bit)
The filled progress area is noticably protruding from the borders on the top and bottom, too, in the Firefox Nightly screenshots here (but not in Nautilus).  Karl, do you see anything similar to that with Adwaita?  I wonder if we're just sizing the filled portion of the progress bar incorrectly...  Seems like we must either be making that piece too big, or we're expected to clip & failing to do so per beginning of comment 3.
Flags: needinfo?(karlt)
renders as expected AFAIK
(In reply to Daniel Holbert [:dholbert] from comment #3)
> (I wonder if the issue here is that GTK expects the filled progress region
> to be clipped to the widget's border, or something like that? and we're
> drawing them separately, in the wrong order?)

The trough is behind the filled region.  I don't think we have that wrong
because we don't clip out the filled region when drawing the trough.

Clipping the filled region to the trough wouldn't fix the right edge, which
has too much radius.

(In reply to Daniel Holbert [:dholbert] from comment #5)
> The filled progress area is noticably protruding from the borders on the top
> and bottom, too, in the Firefox Nightly screenshots here (but not in
> Nautilus).  Karl, do you see anything similar to that with Adwaita?  I
> wonder if we're just sizing the filled portion of the progress bar
> incorrectly...  Seems like we must either be making that piece too big, or

Yes, I think it is too big for the trough.

Either we are passing the wrong rect to the gtk_render_* function, or the
widget border or padding is wrong.

I guess that we are missing padding or border or container border or margin,
or possibly something specific to progress widgets.

The rects and borders in the theming code are selected to mimic the layout and
drawing code of the corresponding gtk widgets.  I suspect we're missing one
piece of the equation, which happens to not be used in Adwaita.
Flags: needinfo?(karlt)
Attached image Adwaita 3.18
This is what progress bars look like natively on adwaita 3.18. Firefox, obviously doesn’t match it.
Duplicate of this bug: 1221498
Priority: -- → P4
Whiteboard: tpi:+
You need to log in before you can comment on or make changes to this bug.