Changeset 69495 in webkit
- Timestamp:
- Oct 11, 2010 8:24:11 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69489 r69495 1 2010-10-11 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] Search field icons should be centered vertically in the field 6 https://bugs.webkit.org/show_bug.cgi?id=47441 7 8 Add a pixel dump result which tests the fix. 9 10 * platform/gtk/fast/css/text-input-with-webkit-border-radius-expected.checksum: Added. 11 * platform/gtk/fast/css/text-input-with-webkit-border-radius-expected.png: Added. 12 1 13 2010-10-10 Antonio Gomes <agomes@rim.com> 2 14 -
trunk/WebCore/ChangeLog
r69494 r69495 1 2010-10-11 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] Search field icons should be centered vertically in the field 6 https://bugs.webkit.org/show_bug.cgi?id=47441 7 8 Center search field icons vertically in the search field. 9 10 * platform/gtk/RenderThemeGtk.cpp: 11 (WebCore::centerRectVerticallyInParentInputElement): Added this helper. 12 (WebCore::RenderThemeGtk::paintSearchFieldResultsDecoration): Center the search 13 field icon by adjusting its drawing rect relative to the containing search field. 14 (WebCore::RenderThemeGtk::paintSearchFieldCancelButton): Ditto. 15 1 16 2010-10-11 Pavel Podivilov <podivilov@chromium.org> 2 17 -
trunk/WebCore/platform/gtk/RenderThemeGtk.cpp
r69447 r69495 499 499 } 500 500 501 bool RenderThemeGtk::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& i, const IntRect& rect) 502 { 503 GraphicsContext* context = i.context; 504 501 static IntRect centerRectVerticallyInParentInputElement(RenderObject* object, const IntRect& rect) 502 { 503 IntRect centeredRect(rect); 504 Node* input = object->node()->shadowAncestorNode(); // Get the renderer of <input> element. 505 if (!input->renderer()->isBox()) 506 return centeredRect; 507 508 // If possible center the y-coordinate of the rect vertically in the parent input element. 509 // We also add one pixel here to ensure that the y coordinate is rounded up for box heights 510 // that are even, which looks in relation to the box text. 511 IntRect inputContentBox = toRenderBox(input->renderer())->absoluteContentBox(); 512 centeredRect.setY(inputContentBox.y() + (inputContentBox.height() - centeredRect.height() + 1) / 2); 513 return centeredRect; 514 } 515 516 bool RenderThemeGtk::paintSearchFieldResultsDecoration(RenderObject* object, const PaintInfo& i, const IntRect& rect) 517 { 505 518 static Image* searchImage = Image::loadPlatformThemeIcon(GTK_STOCK_FIND, rect.width()).releaseRef(); 506 context->drawImage(searchImage, DeviceColorSpace, rect);507 519 IntRect centeredRect(centerRectVerticallyInParentInputElement(object, rect)); 520 i.context->drawImage(searchImage, DeviceColorSpace, centeredRect); 508 521 return false; 509 522 } … … 520 533 } 521 534 522 bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& i, const IntRect& rect) 523 { 524 GraphicsContext* context = i.context; 525 535 bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* object, const PaintInfo& i, const IntRect& rect) 536 { 526 537 // TODO: Brightening up the image on hover is desirable here, I believe. 527 538 static Image* cancelImage = Image::loadPlatformThemeIcon(GTK_STOCK_CLEAR, rect.width()).releaseRef(); 528 context->drawImage(cancelImage, DeviceColorSpace, rect);529 539 IntRect centeredRect(centerRectVerticallyInParentInputElement(object, rect)); 540 i.context->drawImage(cancelImage, DeviceColorSpace, centeredRect); 530 541 return false; 531 542 }
Note: See TracChangeset
for help on using the changeset viewer.