[webkit-reviews] review granted: [Bug 28125] [Haiku] Adding ScrollbarTheme to WebCore. : [Attachment 34410] Patch to add the ScrollbarTheme files for Haiku.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Aug 9 08:00:41 PDT 2009
Eric Seidel <eric at webkit.org> has granted Maxime Simon
<simon.maxime at gmail.com>'s request for review:
Bug 28125: [Haiku] Adding ScrollbarTheme to WebCore.
https://bugs.webkit.org/show_bug.cgi?id=28125
Attachment 34410: Patch to add the ScrollbarTheme files for Haiku.
https://bugs.webkit.org/attachment.cgi?id=34410&action=review
------- Additional Comments from Eric Seidel <eric at webkit.org>
I would have written:
return IntRect(scrollbar->x(), scrollbar->y(),
77 scrollbar->width() < 2 * thickness ?
scrollbar->width() / 2 : thickness, thickness);
78 return IntRect(scrollbar->x(), scrollbar->y(),
79 thickness, scrollbar->height() < 2 * thickness ?
scrollbar->height() / 2 : thickness);
As:
int buttonWidth(int scrollbarWidth, int thickness)
{
return scrollbarWidth < 2 * thickness ? scrollbarWidth / 2 : thickness;
}
IntPoint buttonOrigin(scrollbar->x(), scrollbar->y());
IntSize buttonSize = scrollbar->orientation() == HorizontalScrollbar
? IntSize(buttonWidth(scrollbar->width()),
thickness)
: IntSize(thickness,
buttonWidth(scrollbar->width());
return IntRect(buttonOrigin, buttonSize);
That way you can re-use buttonWidth() on the next function too.
The code looks OK as is though.
More information about the webkit-reviews
mailing list