Changeset 57603 in webkit
- Timestamp:
- Apr 14, 2010 1:39:31 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57599 r57603 1 2010-04-14 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Add ThemeMac::ensuredView and get rid of a workaround in ThemeMac::paintButton. 6 https://bugs.webkit.org/show_bug.cgi?id=37601 7 8 * platform/mac/ThemeMac.h: 9 * platform/mac/ThemeMac.mm: 10 (-[WebCoreFlippedView isFlipped]): 11 (WebCore::paintButton): 12 (WebCore::ThemeMac::ensuredView): 13 1 14 2010-04-14 Jay Civelli <jcivelli@chromium.org> 2 15 -
trunk/WebCore/platform/mac/ThemeMac.h
r37790 r57603 50 50 virtual void paint(ControlPart, ControlStates, GraphicsContext*, const IntRect&, float zoomFactor, ScrollView*) const; 51 51 virtual void inflateControlPaintRect(ControlPart, ControlStates, IntRect&, float zoomFactor) const; 52 53 // FIXME: Once RenderThemeMac is converted over to use Theme then this can be internal to ThemeMac. 54 static NSView* ensuredView(ScrollView*); 52 55 }; 53 56 -
trunk/WebCore/platform/mac/ThemeMac.mm
r54299 r57603 36 36 using namespace std; 37 37 38 // This is a view whose sole purpose is to tell AppKit that it's flipped. 39 @interface WebCoreFlippedView : NSView 40 @end 41 42 @implementation WebCoreFlippedView 43 44 - (BOOL)isFlipped 45 { 46 return YES; 47 } 48 49 @end 50 38 51 // FIXME: Default buttons really should be more like push buttons and not like buttons. 39 52 … … 406 419 } 407 420 408 NSView *view = scrollView->documentView();421 NSView *view = ThemeMac::ensuredView(scrollView); 409 422 NSWindow *window = [view window]; 410 423 NSButtonCell *previousDefaultButtonCell = [window defaultButtonCell]; … … 416 429 [window setDefaultButtonCell:nil]; 417 430 418 if (!view) {419 context->save();420 context->translate(inflatedRect.x(), inflatedRect.y());421 context->scale(FloatSize(1, -1));422 context->translate(0, -inflatedRect.height());423 inflatedRect.setLocation(IntPoint());424 }425 426 431 [buttonCell drawWithFrame:NSRect(inflatedRect) inView:view]; 427 432 [buttonCell setControlView:nil]; 428 433 429 if (!view)430 context->restore();431 432 434 if (![previousDefaultButtonCell isEqual:buttonCell]) 433 435 [window setDefaultButtonCell:previousDefaultButtonCell]; … … 436 438 } 437 439 440 // This will ensure that we always return a valid NSView, even if ScrollView doesn't have an associated document NSView. 441 // If the ScrollView doesn't have an NSView, we will return a fake NSView whose sole purpose is to tell AppKit that it's flipped. 442 NSView *ThemeMac::ensuredView(ScrollView* scrollView) 443 { 444 if (NSView *documentView = scrollView->documentView()) 445 return documentView; 446 447 // Use a fake flipped view. 448 static NSView *flippedView = [[WebCoreFlippedView alloc] init]; 449 450 return flippedView; 451 } 452 438 453 // Theme overrides 439 454
Note: See TracChangeset
for help on using the changeset viewer.