Title: [121829] trunk/Source/WebCore
Revision
121829
Author
[email protected]
Date
2012-07-03 23:18:20 -0700 (Tue, 03 Jul 2012)

Log Message

[GTK] Don't show accel labels in context menu items
https://bugs.webkit.org/show_bug.cgi?id=90437

Reviewed by Martin Robinson.

When a context menu item is created with a GtkMenuItem that has
been created from a GtkAction, if the action has an accelerator,
it's shown in the menu item label, like menu items in a menu
bar. In that case we should reset the accel closure of the menu
item label, like GtkUIManager does for popup menus, to make sure
the accelerator is not shown. This isn't needed for all other
ContextMenuIem constructors, because the GtkAction is created
without accelerator by webkit in those cases.

* platform/gtk/ContextMenuItemGtk.cpp:
(WebCore::ContextMenuItem::ContextMenuItem):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121828 => 121829)


--- trunk/Source/WebCore/ChangeLog	2012-07-04 05:49:44 UTC (rev 121828)
+++ trunk/Source/WebCore/ChangeLog	2012-07-04 06:18:20 UTC (rev 121829)
@@ -1,3 +1,22 @@
+2012-07-03  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Don't show accel labels in context menu items
+        https://bugs.webkit.org/show_bug.cgi?id=90437
+
+        Reviewed by Martin Robinson.
+
+        When a context menu item is created with a GtkMenuItem that has
+        been created from a GtkAction, if the action has an accelerator,
+        it's shown in the menu item label, like menu items in a menu
+        bar. In that case we should reset the accel closure of the menu
+        item label, like GtkUIManager does for popup menus, to make sure
+        the accelerator is not shown. This isn't needed for all other
+        ContextMenuIem constructors, because the GtkAction is created
+        without accelerator by webkit in those cases.
+
+        * platform/gtk/ContextMenuItemGtk.cpp:
+        (WebCore::ContextMenuItem::ContextMenuItem):
+
 2012-07-03  Christophe Dumez  <[email protected]>
 
         [EFL] Move BatteryClientEfl from WebKit to WebCore

Modified: trunk/Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp (121828 => 121829)


--- trunk/Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp	2012-07-04 05:49:44 UTC (rev 121828)
+++ trunk/Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp	2012-07-04 06:18:20 UTC (rev 121829)
@@ -144,6 +144,17 @@
 ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription item)
     : m_platformDescription(item)
 {
+    // Don't show accel labels in context menu items.
+    GtkAction* action = ""
+    if (!action)
+        return;
+
+    if (!gtk_action_get_accel_path(action))
+        return;
+
+    GtkWidget* child = gtk_bin_get_child(GTK_BIN(item));
+    if (GTK_IS_ACCEL_LABEL(child))
+        gtk_accel_label_set_accel_closure(GTK_ACCEL_LABEL(child), 0);
 }
 
 ContextMenuItem::ContextMenuItem(ContextMenu* subMenu)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to