| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Google, Inc. | 3 * Copyright (C) 2008, 2009 Google, Inc. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 IntSize size = m_layoutTheme.popupButtonSizes()[[popupButton controlSize]]; | 161 IntSize size = m_layoutTheme.popupButtonSizes()[[popupButton controlSize]]; |
| 162 size.setHeight(size.height() * zoomLevel); | 162 size.setHeight(size.height() * zoomLevel); |
| 163 size.setWidth(r.width()); | 163 size.setWidth(r.width()); |
| 164 | 164 |
| 165 // Now inflate it to account for the shadow. | 165 // Now inflate it to account for the shadow. |
| 166 IntRect inflatedRect = r; | 166 IntRect inflatedRect = r; |
| 167 if (r.width() >= m_layoutTheme.minimumMenuListSize(o->styleRef())) | 167 if (r.width() >= m_layoutTheme.minimumMenuListSize(o->styleRef())) |
| 168 inflatedRect = ThemeMac::inflateRect(inflatedRect, size, m_layoutTheme.p
opupButtonMargins(), zoomLevel); | 168 inflatedRect = ThemeMac::inflateRect(inflatedRect, size, m_layoutTheme.p
opupButtonMargins(), zoomLevel); |
| 169 | 169 |
| 170 LocalCurrentGraphicsContext localContext(paintInfo.context, &paintInfo.rect,
ThemeMac::inflateRectForFocusRing(inflatedRect)); | 170 LocalCurrentGraphicsContext localContext(paintInfo.context, &paintInfo.rect,
ThemeMac::inflateRectForFocusRing(inflatedRect)); |
| 171 GraphicsContextStateSaver stateSaver(*paintInfo.context); | |
| 172 | |
| 173 // On Leopard, the cell will draw outside of the given rect, so we have to | |
| 174 // clip to the rect. | |
| 175 paintInfo.context->clip(inflatedRect); | |
| 176 | 171 |
| 177 if (zoomLevel != 1.0f) { | 172 if (zoomLevel != 1.0f) { |
| 178 inflatedRect.setWidth(inflatedRect.width() / zoomLevel); | 173 inflatedRect.setWidth(inflatedRect.width() / zoomLevel); |
| 179 inflatedRect.setHeight(inflatedRect.height() / zoomLevel); | 174 inflatedRect.setHeight(inflatedRect.height() / zoomLevel); |
| 180 paintInfo.context->translate(inflatedRect.x(), inflatedRect.y()); | 175 paintInfo.context->translate(inflatedRect.x(), inflatedRect.y()); |
| 181 paintInfo.context->scale(zoomLevel, zoomLevel); | 176 paintInfo.context->scale(zoomLevel, zoomLevel); |
| 182 paintInfo.context->translate(-inflatedRect.x(), -inflatedRect.y()); | 177 paintInfo.context->translate(-inflatedRect.x(), -inflatedRect.y()); |
| 183 } | 178 } |
| 184 | 179 |
| 185 NSView *view = m_layoutTheme.documentViewFor(o); | 180 NSView *view = m_layoutTheme.documentViewFor(o); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 [search setSearchMenuTemplate:nil]; | 589 [search setSearchMenuTemplate:nil]; |
| 595 | 590 |
| 596 m_layoutTheme.updateActiveState([search searchButtonCell], o); | 591 m_layoutTheme.updateActiveState([search searchButtonCell], o); |
| 597 | 592 |
| 598 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:m_layoutTheme.d
ocumentViewFor(o)]; | 593 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:m_layoutTheme.d
ocumentViewFor(o)]; |
| 599 [[search searchButtonCell] setControlView:nil]; | 594 [[search searchButtonCell] setControlView:nil]; |
| 600 return false; | 595 return false; |
| 601 } | 596 } |
| 602 | 597 |
| 603 } // namespace blink | 598 } // namespace blink |
| OLD | NEW |