| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 bool pressed = states & PressedControlState; | 161 bool pressed = states & PressedControlState; |
| 162 if (pressed != oldPressed) | 162 if (pressed != oldPressed) |
| 163 [cell setHighlighted:pressed]; | 163 [cell setHighlighted:pressed]; |
| 164 | 164 |
| 165 // Enabled state | 165 // Enabled state |
| 166 bool oldEnabled = [cell isEnabled]; | 166 bool oldEnabled = [cell isEnabled]; |
| 167 bool enabled = states & EnabledControlState; | 167 bool enabled = states & EnabledControlState; |
| 168 if (enabled != oldEnabled) | 168 if (enabled != oldEnabled) |
| 169 [cell setEnabled:enabled]; | 169 [cell setEnabled:enabled]; |
| 170 | 170 |
| 171 #if BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING | 171 if (![cell respondsToSelector:@selector(drawFocusRingMaskWithFrame:inView:)]
) { |
| 172 // Focused state | 172 // Focused state |
| 173 bool oldFocused = [cell showsFirstResponder]; | 173 bool oldFocused = [cell showsFirstResponder]; |
| 174 bool focused = states & FocusControlState; | 174 bool focused = states & FocusControlState; |
| 175 if (focused != oldFocused) | 175 if (focused != oldFocused) |
| 176 [cell setShowsFirstResponder:focused]; | 176 [cell setShowsFirstResponder:focused]; |
| 177 #endif | 177 } |
| 178 | 178 |
| 179 // Checked and Indeterminate | 179 // Checked and Indeterminate |
| 180 bool oldIndeterminate = [cell state] == NSMixedState; | 180 bool oldIndeterminate = [cell state] == NSMixedState; |
| 181 bool indeterminate = (states & IndeterminateControlState); | 181 bool indeterminate = (states & IndeterminateControlState); |
| 182 bool checked = states & CheckedControlState; | 182 bool checked = states & CheckedControlState; |
| 183 bool oldChecked = [cell state] == NSOnState; | 183 bool oldChecked = [cell state] == NSOnState; |
| 184 if (oldIndeterminate != indeterminate || checked != oldChecked) | 184 if (oldIndeterminate != indeterminate || checked != oldChecked) |
| 185 [cell setState:indeterminate ? NSMixedState : (checked ? NSOnState : NSO
ffState)]; | 185 [cell setState:indeterminate ? NSMixedState : (checked ? NSOnState : NSO
ffState)]; |
| 186 | 186 |
| 187 // Window inactive state does not need to be checked explicitly, since we pa
int parented to | 187 // Window inactive state does not need to be checked explicitly, since we pa
int parented to |
| (...skipping 531 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 |