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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 | 255 |
256 void ThemePainterDefault::setupMenuListArrow(const LayoutBox& box, const IntRect & rect, WebThemeEngine::ExtraParams& extraParams) | 256 void ThemePainterDefault::setupMenuListArrow(const LayoutBox& box, const IntRect & rect, WebThemeEngine::ExtraParams& extraParams) |
257 { | 257 { |
258 const int right = rect.x() + rect.width(); | 258 const int right = rect.x() + rect.width(); |
259 const int middle = rect.y() + rect.height() / 2; | 259 const int middle = rect.y() + rect.height() / 2; |
260 | 260 |
261 extraParams.menuList.arrowY = middle; | 261 extraParams.menuList.arrowY = middle; |
262 if (useMockTheme()) { | 262 if (useMockTheme()) { |
263 // The size and position of the drop-down button is different between | 263 // The size and position of the drop-down button is different between |
264 // the mock theme and the regular aura theme. | 264 // the mock theme and the regular aura theme. |
265 int spacingTop = (box.borderTop() + box.paddingTop()).toInt(); | 265 int extraPadding = 3 * box.styleRef().effectiveZoom(); |
oshima
2016/09/17 01:31:21
define const for 3 and explain what's in CSS pixel
malaykeshav
2016/09/19 18:09:27
Done
| |
266 int spacingBottom = (box.borderBottom() + box.paddingBottom()).toInt(); | 266 // The width available for the arrow is based on the padding provided |
267 int spacingRight = (box.borderRight() + box.paddingRight()).toInt(); | 267 // in the child LayoutBox. |
268 extraParams.menuList.arrowX = (box.styleRef().direction() == RTL) ? rect .x() + 4 + spacingRight: right - 10 - spacingRight; | 268 int arrowBoxWidth = ((box.styleRef().direction() == RTL) ? |
269 extraParams.menuList.arrowSize = rect.height() - spacingBottom - spacing Top; | 269 box.firstChildBox()->paddingLeft() : |
270 box.firstChildBox()->paddingRight()).toInt(); | |
271 int arrowSize = std::min(arrowBoxWidth, rect.height()) - 2 * extraPaddin g; | |
oshima
2016/09/17 01:31:21
80 chars
malaykeshav
2016/09/19 18:09:27
This file doesn't follow the 80 char limit. git cl
| |
272 extraParams.menuList.arrowX = (box.styleRef().direction() == RTL) ? | |
273 rect.x() + extraPadding + (arrowSize / 2): | |
274 right - (arrowSize / 2) - extraPadding; | |
275 extraParams.menuList.arrowSize = arrowSize; | |
270 } else { | 276 } else { |
271 const int arrowSize = 6; | 277 const int arrowSize = 6; |
272 const int arrowPadding = 6; | 278 const int arrowPadding = 6; |
273 extraParams.menuList.arrowX = (box.styleRef().direction() == RTL) | 279 extraParams.menuList.arrowX = (box.styleRef().direction() == RTL) |
274 ? rect.x() + arrowPadding * box.styleRef().effectiveZoom() + box.bor derLeft() | 280 ? rect.x() + arrowPadding * box.styleRef().effectiveZoom() + box.bor derLeft() |
275 : right - (arrowSize + arrowPadding) * box.styleRef().effectiveZoom( ) - box.borderRight(); | 281 : right - (arrowSize + arrowPadding) * box.styleRef().effectiveZoom( ) - box.borderRight(); |
276 extraParams.menuList.arrowSize = arrowSize * box.styleRef().effectiveZoo m(); | 282 extraParams.menuList.arrowSize = arrowSize * box.styleRef().effectiveZoo m(); |
277 } | 283 } |
278 extraParams.menuList.arrowColor = box.resolveColor(CSSPropertyColor).rgb(); | 284 extraParams.menuList.arrowColor = box.resolveColor(CSSPropertyColor).rgb(); |
279 } | 285 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 cancelButtonSize, cancelButtonSize); | 398 cancelButtonSize, cancelButtonSize); |
393 IntRect paintingRect = convertToPaintingRect(inputLayoutBox, cancelButtonObj ect, cancelButtonRect, r); | 399 IntRect paintingRect = convertToPaintingRect(inputLayoutBox, cancelButtonObj ect, cancelButtonRect, r); |
394 | 400 |
395 DEFINE_STATIC_REF(Image, cancelImage, (Image::loadPlatformResource("searchCa ncel"))); | 401 DEFINE_STATIC_REF(Image, cancelImage, (Image::loadPlatformResource("searchCa ncel"))); |
396 DEFINE_STATIC_REF(Image, cancelPressedImage, (Image::loadPlatformResource("s earchCancelPressed"))); | 402 DEFINE_STATIC_REF(Image, cancelPressedImage, (Image::loadPlatformResource("s earchCancelPressed"))); |
397 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) ? can celPressedImage : cancelImage, paintingRect); | 403 paintInfo.context.drawImage(LayoutTheme::isPressed(cancelButtonObject) ? can celPressedImage : cancelImage, paintingRect); |
398 return false; | 404 return false; |
399 } | 405 } |
400 | 406 |
401 } // namespace blink | 407 } // namespace blink |
OLD | NEW |