| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. | 2 * Copyright (C) 2007 Apple Inc. |
| 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 4 * Copyright (C) 2008 Collabora Ltd. | 4 * Copyright (C) 2008 Collabora Ltd. |
| 5 * Copyright (C) 2008, 2009 Google Inc. | 5 * Copyright (C) 2008, 2009 Google Inc. |
| 6 * Copyright (C) 2009 Kenneth Rohde Christiansen | 6 * Copyright (C) 2009 Kenneth Rohde Christiansen |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 // Padding inside the arrowBox. | 298 // Padding inside the arrowBox. |
| 299 float extraPadding = 2 * arrowScaleFactor; | 299 float extraPadding = 2 * arrowScaleFactor; |
| 300 float arrowSize = | 300 float arrowSize = |
| 301 std::min(arrowBoxWidth, | 301 std::min(arrowBoxWidth, |
| 302 static_cast<float>(rect.height() - box.borderTop() - | 302 static_cast<float>(rect.height() - box.borderTop() - |
| 303 box.borderBottom())) - | 303 box.borderBottom())) - |
| 304 2 * extraPadding; | 304 2 * extraPadding; |
| 305 // |arrowX| is the middle position for mock theme engine. | 305 // |arrowX| is the middle position for mock theme engine. |
| 306 extraParams.menuList.arrowX = | 306 extraParams.menuList.arrowX = |
| 307 (box.styleRef().direction() == TextDirection::Rtl) | 307 (box.styleRef().direction() == TextDirection::kRtl) |
| 308 ? rect.x() + extraPadding + (arrowSize / 2) | 308 ? rect.x() + extraPadding + (arrowSize / 2) |
| 309 : right - (arrowSize / 2) - extraPadding; | 309 : right - (arrowSize / 2) - extraPadding; |
| 310 extraParams.menuList.arrowSize = arrowSize; | 310 extraParams.menuList.arrowSize = arrowSize; |
| 311 } else { | 311 } else { |
| 312 // TODO(tkent): This should be 7.0 to match scroll bar buttons. | 312 // TODO(tkent): This should be 7.0 to match scroll bar buttons. |
| 313 float arrowSize = 6.0 * arrowScaleFactor; | 313 float arrowSize = 6.0 * arrowScaleFactor; |
| 314 // Put the 6px arrow at the center of paddingForArrow area. | 314 // Put the 6px arrow at the center of paddingForArrow area. |
| 315 // |arrowX| is the left position for Aura theme engine. | 315 // |arrowX| is the left position for Aura theme engine. |
| 316 extraParams.menuList.arrowX = | 316 extraParams.menuList.arrowX = |
| 317 (box.styleRef().direction() == TextDirection::Rtl) | 317 (box.styleRef().direction() == TextDirection::kRtl) |
| 318 ? left + (arrowBoxWidth - arrowSize) / 2 | 318 ? left + (arrowBoxWidth - arrowSize) / 2 |
| 319 : right - (arrowBoxWidth + arrowSize) / 2; | 319 : right - (arrowBoxWidth + arrowSize) / 2; |
| 320 extraParams.menuList.arrowSize = arrowSize; | 320 extraParams.menuList.arrowSize = arrowSize; |
| 321 } | 321 } |
| 322 extraParams.menuList.arrowColor = box.resolveColor(CSSPropertyColor).rgb(); | 322 extraParams.menuList.arrowColor = box.resolveColor(CSSPropertyColor).rgb(); |
| 323 } | 323 } |
| 324 | 324 |
| 325 bool ThemePainterDefault::paintSliderTrack(const LayoutObject& o, | 325 bool ThemePainterDefault::paintSliderTrack(const LayoutObject& o, |
| 326 const PaintInfo& i, | 326 const PaintInfo& i, |
| 327 const IntRect& rect) { | 327 const IntRect& rect) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 DEFINE_STATIC_REF(Image, cancelPressedImage, | 466 DEFINE_STATIC_REF(Image, cancelPressedImage, |
| 467 (Image::loadPlatformResource("searchCancelPressed"))); | 467 (Image::loadPlatformResource("searchCancelPressed"))); |
| 468 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) | 468 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) |
| 469 ? cancelPressedImage | 469 ? cancelPressedImage |
| 470 : cancelImage, | 470 : cancelImage, |
| 471 paintingRect); | 471 paintingRect); |
| 472 return false; | 472 return false; |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace blink | 475 } // namespace blink |
| OLD | NEW |