Changeset 127597 in webkit


Ignore:
Timestamp:
Sep 5, 2012 8:58:09 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Unify size of popup menu for touch and non-touch.
https://bugs.webkit.org/show_bug.cgi?id=95606

Patch by Kevin Ellis <kevers@chromium.org> on 2012-09-05
Reviewed by Adam Barth.

Use minimum height for popup menus entries regardless of whether the
popup menu is displayed on a touch screen. Replaces use of touch
padding. Height meets minimum size requirement for a low error rate
while still looking aesthetic for non-touch.

Covered by existing tests.

  • platform/chromium/PopupListBox.cpp:

(WebCore::PopupListBox::getRowHeight):

  • platform/chromium/PopupMenuChromium.cpp:

(WebCore):

  • platform/chromium/PopupMenuChromium.h:

(PopupMenuChromium):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r127596 r127597  
     12012-09-05  Kevin Ellis  <kevers@chromium.org>
     2
     3        [chromium] Unify size of popup menu for touch and non-touch.
     4        https://bugs.webkit.org/show_bug.cgi?id=95606
     5
     6        Reviewed by Adam Barth.
     7
     8        Use minimum height for popup menus entries regardless of whether the
     9        popup menu is displayed on a touch screen.  Replaces use of touch
     10        padding.  Height meets minimum size requirement for a low error rate
     11        while still looking aesthetic for non-touch.
     12
     13        Covered by existing tests.
     14
     15        * platform/chromium/PopupListBox.cpp:
     16        (WebCore::PopupListBox::getRowHeight):
     17        * platform/chromium/PopupMenuChromium.cpp:
     18        (WebCore):
     19        * platform/chromium/PopupMenuChromium.h:
     20        (PopupMenuChromium):
     21
    1222012-09-05  Mihnea Ovidenie  <mihnea@adobe.com>
    223
  • trunk/Source/WebCore/platform/chromium/PopupListBox.cpp

    r126121 r127597  
    615615int PopupListBox::getRowHeight(int index)
    616616{
    617     int paddingForTouch = 0;
    618     if (m_settings.deviceSupportsTouch)
    619         paddingForTouch = PopupMenuChromium::optionPaddingForTouch();
    620617    if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone())
    621618        return PopupMenuChromium::minimumRowHeight();
     
    633630    int linePaddingHeight = m_popupClient->menuStyle().menuType() == PopupMenuStyle::AutofillPopup ? kLinePaddingHeight : 0;
    634631    int calculatedRowHeight = max(fontHeight, iconHeight) + linePaddingHeight * 2;
    635     return (max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight()) + paddingForTouch);
     632    return max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight());
    636633}
    637634
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp

    r126643 r127597  
    4141namespace WebCore {
    4242
    43 int PopupMenuChromium::s_minimumRowHeight = 0;
    44 int PopupMenuChromium::s_optionPaddingForTouch = 16;
     43int PopupMenuChromium::s_minimumRowHeight = 28;
    4544
    4645// The settings used for the drop down menu.
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h

    r111539 r127597  
    5858    static void setMinimumRowHeight(int minimumRowHeight) { s_minimumRowHeight = minimumRowHeight; }
    5959
    60     static int optionPaddingForTouch() { return s_optionPaddingForTouch; }
    61     static void setOptionPaddingForTouch(int optionPaddingForTouch) { s_optionPaddingForTouch = optionPaddingForTouch; }
    62 
    6360private:
    6461    PopupMenuClient* client() const { return m_popupClient; }
     
    6865
    6966    static int s_minimumRowHeight;
    70     static int s_optionPaddingForTouch;
    7167};
    7268
Note: See TracChangeset for help on using the changeset viewer.