| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 radioCell = [[NSButtonCell alloc] init]; | 360 radioCell = [[NSButtonCell alloc] init]; |
| 361 [radioCell setButtonType:NSRadioButton]; | 361 [radioCell setButtonType:NSRadioButton]; |
| 362 [radioCell setTitle:nil]; | 362 [radioCell setTitle:nil]; |
| 363 [radioCell setFocusRingType:NSFocusRingTypeExterior]; | 363 [radioCell setFocusRingType:NSFocusRingTypeExterior]; |
| 364 } | 364 } |
| 365 | 365 |
| 366 // Set the control size based off the rectangle we're painting into. | 366 // Set the control size based off the rectangle we're painting into. |
| 367 setControlSize(radioCell, radioSizes(), zoomedRect.size(), zoomFactor); | 367 setControlSize(radioCell, radioSizes(), zoomedRect.size(), zoomFactor); |
| 368 | 368 |
| 369 // Update the various states we respond to. | 369 // Update the various states we respond to. |
| 370 // Cocoa draws NSMixedState NSRadioButton as NSOnState so we don't want that
. |
| 371 states &= ~IndeterminateControlState; |
| 370 updateStates(radioCell, states); | 372 updateStates(radioCell, states); |
| 371 | 373 |
| 372 return radioCell; | 374 return radioCell; |
| 373 } | 375 } |
| 374 | 376 |
| 375 static void paintRadio(ControlStates states, GraphicsContext* context, const Int
Rect& zoomedRect, float zoomFactor, ScrollView* scrollView) | 377 static void paintRadio(ControlStates states, GraphicsContext* context, const Int
Rect& zoomedRect, float zoomFactor, ScrollView* scrollView) |
| 376 { | 378 { |
| 377 // Determine the width and height needed for the control and prepare the cel
l for painting. | 379 // Determine the width and height needed for the control and prepare the cel
l for painting. |
| 378 NSButtonCell *radioCell = radio(states, zoomedRect, zoomFactor); | 380 NSButtonCell *radioCell = radio(states, zoomedRect, zoomFactor); |
| 379 GraphicsContextStateSaver stateSaver(*context); | 381 GraphicsContextStateSaver stateSaver(*context); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 break; | 739 break; |
| 738 case InnerSpinButtonPart: | 740 case InnerSpinButtonPart: |
| 739 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); | 741 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); |
| 740 break; | 742 break; |
| 741 default: | 743 default: |
| 742 break; | 744 break; |
| 743 } | 745 } |
| 744 } | 746 } |
| 745 | 747 |
| 746 } | 748 } |
| OLD | NEW |