Changeset 159534 in webkit
- Timestamp:
- Nov 19, 2013 6:12:43 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r159533 r159534 1 2013-11-19 Zhuang Zhigang <zhuangzg@cn.fujitsu.com> 2 3 Implement spin control on WinCE port. 4 https://bugs.webkit.org/show_bug.cgi?id=123254 5 6 Reviewed by Brent Fulgham. 7 8 * rendering/RenderThemeWinCE.cpp: 9 (WebCore::RenderThemeWinCE::adjustInnerSpinButtonStyle): 10 (WebCore::RenderThemeWinCE::paintInnerSpinButton): 11 * rendering/RenderThemeWinCE.h: 12 1 13 2013-11-19 Roger Fong <roger_fong@apple.com> 2 14 -
trunk/Source/WebCore/rendering/RenderThemeWinCE.cpp
r158492 r159534 650 650 #endif 651 651 652 void RenderThemeWinCE::adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle* style, Element*) const 653 { 654 int width = ::GetSystemMetrics(SM_CXVSCROLL); 655 if (width <= 0) 656 width = 17; // Vista's default. 657 style->setWidth(Length(width, Fixed)); 658 style->setMinWidth(Length(width, Fixed)); 659 } 660 661 bool RenderThemeWinCE::paintInnerSpinButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r) 662 { 663 // We split the specified rectangle into two vertically. We can't draw a 664 // spin button of which height is less than 2px. 665 if (r.height() < 2) 666 return false; 667 IntRect upRect(r); 668 upRect.setHeight(r.height() / 2); 669 IntRect downRect(r); 670 downRect.setY(upRect.maxY()); 671 downRect.setHeight(r.height() - upRect.height()); 672 673 unsigned stateUp = DFCS_SCROLLUP; 674 unsigned stateDown = DFCS_SCROLLDOWN; 675 676 if (!isEnabled(o) || isReadOnlyControl(o)) { 677 stateUp |= DFCS_INACTIVE; 678 stateDown |= DFCS_INACTIVE; 679 } else if (isPressed(o)) { 680 if (isSpinUpButtonPartPressed(o)) 681 stateUp |= DFCS_PUSHED; 682 else 683 stateDown |= DFCS_PUSHED; 684 } 685 686 paintInfo.context->drawFrameControl(upRect, DFC_SCROLL, stateUp); 687 paintInfo.context->drawFrameControl(downRect, DFC_SCROLL, stateDown); 688 689 return false; 690 } 691 652 692 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderThemeWinCE.h
r151783 r159534 115 115 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle* style, Element*) const { } 116 116 117 virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 118 virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&); 119 117 120 static void setWebKitIsBeingUnloaded(); 118 121
Note: See TracChangeset
for help on using the changeset viewer.