Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: Source/platform/mac/ThemeMac.mm

Issue 394433002: Add :indeterminate pseudo class support for radio button input (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/forms/RadioInputType.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/html/forms/RadioInputType.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698