⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 187542 in webkit


Ignore:
Timestamp:
Jul 28, 2015, 11:48:23 PM (11 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Fix empty space in popup menus when first item is selected
https://bugs.webkit.org/show_bug.cgi?id=147358

Reviewed by Martin Robinson.

It happens when one of the first elements are selected, because we
try to center the current selection on the combo element. When the
menu is large enough to make the element centered we need to leave
empty space at the beginning. This can be fixed by not scrolling
to center the selected item when it's above the combo
element. This ensure the selected item will always be visible,
even if it's not centered. If the selected item is already
centered or below the combo element, the behaviour doesn't change
and we scroll to center it.

  • UIProcess/gtk/WebPopupMenuProxyGtk.cpp:

(WebKit::WebPopupMenuProxyGtk::showPopupMenu):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r187540 r187542  
     12015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Fix empty space in popup menus when first item is selected
     4        https://bugs.webkit.org/show_bug.cgi?id=147358
     5
     6        Reviewed by Martin Robinson.
     7
     8        It happens when one of the first elements are selected, because we
     9        try to center the current selection on the combo element. When the
     10        menu is large enough to make the element centered we need to leave
     11        empty space at the beginning. This can be fixed by not scrolling
     12        to center the selected item when it's above the combo
     13        element. This ensure the selected item will always be visible,
     14        even if it's not centered. If the selected item is already
     15        centered or below the combo element, the behaviour doesn't change
     16        and we scroll to center it.
     17
     18        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
     19        (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
     20
    1212015-07-28  Jincheol Jo  <jincheol.jo@navercorp.com>
    222
  • trunk/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp

    r185502 r187542  
    137137            *x = menuPosition->x();
    138138            *y = menuPosition->y();
    139             *pushIn = TRUE;
     139            *pushIn = menuPosition->y() < 0;
    140140        }, &menuPosition, nullptr, event && event->type == GDK_BUTTON_PRESS ? event->button.button : 1,
    141141        event ? gdk_event_get_time(event) : GDK_CURRENT_TIME);
Note: See TracChangeset for help on using the changeset viewer.