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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 { | 486 { |
487 static const IntSize sizes[3] = { IntSize(19, 27), IntSize(15, 22), IntSize(
13, 15) }; | 487 static const IntSize sizes[3] = { IntSize(19, 27), IntSize(15, 22), IntSize(
13, 15) }; |
488 return sizes; | 488 return sizes; |
489 } | 489 } |
490 | 490 |
491 // We don't use controlSizeForFont() for steppers because the stepper height | 491 // We don't use controlSizeForFont() for steppers because the stepper height |
492 // should be equal to or less than the corresponding text field height, | 492 // should be equal to or less than the corresponding text field height, |
493 static NSControlSize stepperControlSizeForFont(const FontDescription& fontDescri
ption) | 493 static NSControlSize stepperControlSizeForFont(const FontDescription& fontDescri
ption) |
494 { | 494 { |
495 int fontSize = fontDescription.computedPixelSize(); | 495 int fontSize = fontDescription.computedPixelSize(); |
496 if (fontSize >= 18) | 496 if (fontSize >= 27) |
497 return NSRegularControlSize; | 497 return NSRegularControlSize; |
498 if (fontSize >= 13) | 498 if (fontSize >= 22) |
499 return NSSmallControlSize; | 499 return NSSmallControlSize; |
500 return NSMiniControlSize; | 500 return NSMiniControlSize; |
501 } | 501 } |
502 | 502 |
503 static void paintStepper(ControlStates states, GraphicsContext* context, const I
ntRect& zoomedRect, float zoomFactor, ScrollView*) | 503 static void paintStepper(ControlStates states, GraphicsContext* context, const I
ntRect& zoomedRect, float zoomFactor, ScrollView*) |
504 { | 504 { |
505 // We don't use NSStepperCell because there are no ways to draw an | 505 // We don't use NSStepperCell because there are no ways to draw an |
506 // NSStepperCell with the up button highlighted. | 506 // NSStepperCell with the up button highlighted. |
507 | 507 |
508 HIThemeButtonDrawInfo drawInfo; | 508 HIThemeButtonDrawInfo drawInfo; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 break; | 719 break; |
720 case InnerSpinButtonPart: | 720 case InnerSpinButtonPart: |
721 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); | 721 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); |
722 break; | 722 break; |
723 default: | 723 default: |
724 break; | 724 break; |
725 } | 725 } |
726 } | 726 } |
727 | 727 |
728 } | 728 } |
OLD | NEW |