| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 return LengthBox(0, zoomed_box.Right().Value(), 0, | 460 return LengthBox(0, zoomed_box.Right().Value(), 0, |
| 461 zoomed_box.Left().Value()); | 461 zoomed_box.Left().Value()); |
| 462 default: | 462 default: |
| 463 return Theme::ControlBorder(part, font_description, zoomed_box, | 463 return Theme::ControlBorder(part, font_description, zoomed_box, |
| 464 zoom_factor); | 464 zoom_factor); |
| 465 } | 465 } |
| 466 } | 466 } |
| 467 | 467 |
| 468 LengthBox ThemeMac::ControlPadding(ControlPart part, | 468 LengthBox ThemeMac::ControlPadding(ControlPart part, |
| 469 const FontDescription& font_description, | 469 const FontDescription& font_description, |
| 470 const LengthBox& zoomed_box, | 470 const Length& zoomed_box_top, |
| 471 const Length& zoomed_box_right, |
| 472 const Length& zoomed_box_bottom, |
| 473 const Length& zoomed_box_left, |
| 471 float zoom_factor) const { | 474 float zoom_factor) const { |
| 472 switch (part) { | 475 switch (part) { |
| 473 case kPushButtonPart: { | 476 case kPushButtonPart: { |
| 474 // Just use 8px. AppKit wants to use 11px for mini buttons, but that | 477 // Just use 8px. AppKit wants to use 11px for mini buttons, but that |
| 475 // padding is just too large for real-world Web sites (creating a huge | 478 // padding is just too large for real-world Web sites (creating a huge |
| 476 // necessary minimum width for buttons whose space is by definition | 479 // necessary minimum width for buttons whose space is by definition |
| 477 // constrained, since we select mini only for small cramped environments. | 480 // constrained, since we select mini only for small cramped environments. |
| 478 // This also guarantees the HTML <button> will match our rendering by | 481 // This also guarantees the HTML <button> will match our rendering by |
| 479 // default, since we're using a consistent padding. | 482 // default, since we're using a consistent padding. |
| 480 const int padding = 8 * zoom_factor; | 483 const int padding = 8 * zoom_factor; |
| 481 return LengthBox(2, padding, 3, padding); | 484 return LengthBox(2, padding, 3, padding); |
| 482 } | 485 } |
| 483 default: | 486 default: |
| 484 return Theme::ControlPadding(part, font_description, zoomed_box, | 487 return Theme::ControlPadding(part, font_description, zoomed_box_top, |
| 485 zoom_factor); | 488 zoomed_box_right, zoomed_box_bottom, |
| 489 zoomed_box_left, zoom_factor); |
| 486 } | 490 } |
| 487 } | 491 } |
| 488 | 492 |
| 489 void ThemeMac::AddVisualOverflow(ControlPart part, | 493 void ThemeMac::AddVisualOverflow(ControlPart part, |
| 490 ControlStates states, | 494 ControlStates states, |
| 491 float zoom_factor, | 495 float zoom_factor, |
| 492 IntRect& zoomed_rect) const { | 496 IntRect& zoomed_rect) const { |
| 493 BEGIN_BLOCK_OBJC_EXCEPTIONS | 497 BEGIN_BLOCK_OBJC_EXCEPTIONS |
| 494 switch (part) { | 498 switch (part) { |
| 495 case kCheckboxPart: { | 499 case kCheckboxPart: { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 zoomed_rect = | 549 zoomed_rect = |
| 546 InflateRect(zoomed_rect, zoomed_size, kStepperMargin, zoom_factor); | 550 InflateRect(zoomed_rect, zoomed_size, kStepperMargin, zoom_factor); |
| 547 break; | 551 break; |
| 548 } | 552 } |
| 549 default: | 553 default: |
| 550 break; | 554 break; |
| 551 } | 555 } |
| 552 END_BLOCK_OBJC_EXCEPTIONS | 556 END_BLOCK_OBJC_EXCEPTIONS |
| 553 } | 557 } |
| 554 } | 558 } |
| OLD | NEW |