Title: [187542] trunk/Source/WebKit2
Revision
187542
Author
[email protected]
Date
2015-07-28 23:48:23 -0700 (Tue, 28 Jul 2015)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187541 => 187542)


--- trunk/Source/WebKit2/ChangeLog	2015-07-29 06:47:12 UTC (rev 187541)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-29 06:48:23 UTC (rev 187542)
@@ -1,3 +1,23 @@
+2015-07-28  Carlos Garcia Campos  <[email protected]>
+
+        [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):
+
 2015-07-28  Jincheol Jo  <[email protected]>
 
         [EFL] Fix typos in ewk_extension.cpp

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp (187541 => 187542)


--- trunk/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp	2015-07-29 06:47:12 UTC (rev 187541)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp	2015-07-29 06:48:23 UTC (rev 187542)
@@ -136,7 +136,7 @@
             IntPoint* menuPosition = static_cast<IntPoint*>(userData);
             *x = menuPosition->x();
             *y = menuPosition->y();
-            *pushIn = TRUE;
+            *pushIn = menuPosition->y() < 0;
         }, &menuPosition, nullptr, event && event->type == GDK_BUTTON_PRESS ? event->button.button : 1,
         event ? gdk_event_get_time(event) : GDK_CURRENT_TIME);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to