Summary: | [GTK] Move progress bar painting out of gtk2drawing.c | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Martin Robinson <mrobinson> | ||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cgarcia, dbates, joone | ||||||
Priority: | P3 | Keywords: | Gtk | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Bug Depends on: | 52258 | ||||||||
Bug Blocks: | 51155 | ||||||||
Attachments: |
|
Description
Martin Robinson
2011-01-13 11:44:27 PST
Created attachment 79324 [details]
Patch
Comment on attachment 79324 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=79324&action=review This won't compile when PROGRESS_TAG is disabled/undefined since calculateProgressRect() is only declared in RenderThemeGtk.h when PROGRESS_TAG is defined. > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:565 > +void RenderThemeGtk::calculateProgressRect(RenderObject* renderObject, IntRect& rect) Given the name of this function, it seems a bit weird that this function adjusts the rectangle of the progress bar instead of returning a rectangle. > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:577 > + int newWidth = max(2, rect.width() / progressActivityBlocks); Where does the 2 come from? > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:581 > + rect.setX(rect.x() + (animationProgress * 2 * movableWidth)); Where does the 2 come from? The parentheses are not needed for the second addend since multiplication has a higher precedence that addition. > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:583 > + rect.setX(rect.x() + ((1.0 - animationProgress) * 2 * movableWidth)); Ditto. (In reply to comment #2) > (From update of attachment 79324 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=79324&action=review > > This won't compile when PROGRESS_TAG is disabled/undefined since calculateProgressRect() is only declared in RenderThemeGtk.h when PROGRESS_TAG is defined. Disregard this comment. Additional context reveals that RenderThemeGtk::calculateProgressRect() is enclosed within an ENABLE(PROGRESS_TAG). Comment on attachment 79324 [details]
Patch
This patch look sane to me. I am curious about where the 2's come from in lines 576 thru 583 in RenderThemeGtk.cpp.
Comment on attachment 79324 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=79324&action=review > Source/WebCore/platform/gtk/RenderThemeGtk2.cpp:491 > + widgetContext.gtkPaintBox(progressRect, widget, GTK_STATE_NORMAL, GTK_SHADOW_IN, "bar"); This should be GTK_STATE_PRELIGHT, GTK_SHADOW_OUT Created attachment 79447 [details]
Patch with extra comments and Carlos' fix
Committed r76192: <http://trac.webkit.org/changeset/76192> |