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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 extraParams.menuList.arrowY = middle; | 291 extraParams.menuList.arrowY = middle; |
292 if (useMockTheme()) { | 292 if (useMockTheme()) { |
293 // The size and position of the drop-down button is different between | 293 // The size and position of the drop-down button is different between |
294 // the mock theme and the regular aura theme. | 294 // the mock theme and the regular aura theme. |
295 int extraPadding = | 295 int extraPadding = |
296 mockDropdownMenuListArrowPadding * box.styleRef().effectiveZoom(); | 296 mockDropdownMenuListArrowPadding * box.styleRef().effectiveZoom(); |
297 int arrowBoxWidth = | 297 int arrowBoxWidth = |
298 mockDropdownMenuListArrowWidth * box.styleRef().effectiveZoom(); | 298 mockDropdownMenuListArrowWidth * box.styleRef().effectiveZoom(); |
299 int arrowSize = std::min(arrowBoxWidth, rect.height()) - 2 * extraPadding; | 299 int arrowSize = std::min(arrowBoxWidth, rect.height()) - 2 * extraPadding; |
300 extraParams.menuList.arrowX = | 300 extraParams.menuList.arrowX = |
301 (box.styleRef().direction() == RTL) | 301 (box.styleRef().direction() == TextDirection::Rtl) |
302 ? rect.x() + extraPadding + (arrowSize / 2) | 302 ? rect.x() + extraPadding + (arrowSize / 2) |
303 : right - (arrowSize / 2) - extraPadding; | 303 : right - (arrowSize / 2) - extraPadding; |
304 extraParams.menuList.arrowSize = arrowSize; | 304 extraParams.menuList.arrowSize = arrowSize; |
305 } else { | 305 } else { |
306 const int arrowSize = 6; | 306 const int arrowSize = 6; |
307 const int arrowPadding = 6; | 307 const int arrowPadding = 6; |
308 extraParams.menuList.arrowX = | 308 extraParams.menuList.arrowX = |
309 (box.styleRef().direction() == RTL) | 309 (box.styleRef().direction() == TextDirection::Rtl) |
310 ? rect.x() + arrowPadding * box.styleRef().effectiveZoom() + | 310 ? rect.x() + arrowPadding * box.styleRef().effectiveZoom() + |
311 box.borderLeft() | 311 box.borderLeft() |
312 : right - | 312 : right - |
313 (arrowSize + arrowPadding) * box.styleRef().effectiveZoom() - | 313 (arrowSize + arrowPadding) * box.styleRef().effectiveZoom() - |
314 box.borderRight(); | 314 box.borderRight(); |
315 extraParams.menuList.arrowSize = arrowSize * box.styleRef().effectiveZoom(); | 315 extraParams.menuList.arrowSize = arrowSize * box.styleRef().effectiveZoom(); |
316 } | 316 } |
317 extraParams.menuList.arrowColor = box.resolveColor(CSSPropertyColor).rgb(); | 317 extraParams.menuList.arrowColor = box.resolveColor(CSSPropertyColor).rgb(); |
318 } | 318 } |
319 | 319 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 DEFINE_STATIC_REF(Image, cancelPressedImage, | 461 DEFINE_STATIC_REF(Image, cancelPressedImage, |
462 (Image::loadPlatformResource("searchCancelPressed"))); | 462 (Image::loadPlatformResource("searchCancelPressed"))); |
463 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) | 463 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) |
464 ? cancelPressedImage | 464 ? cancelPressedImage |
465 : cancelImage, | 465 : cancelImage, |
466 paintingRect); | 466 paintingRect); |
467 return false; | 467 return false; |
468 } | 468 } |
469 | 469 |
470 } // namespace blink | 470 } // namespace blink |
OLD | NEW |