summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/ContextMenuItemGtk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/gtk/ContextMenuItemGtk.cpp')
-rw-r--r--WebCore/platform/gtk/ContextMenuItemGtk.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/WebCore/platform/gtk/ContextMenuItemGtk.cpp b/WebCore/platform/gtk/ContextMenuItemGtk.cpp
index aaec206..b2fa853 100644
--- a/WebCore/platform/gtk/ContextMenuItemGtk.cpp
+++ b/WebCore/platform/gtk/ContextMenuItemGtk.cpp
@@ -59,7 +59,7 @@ static const char* gtkStockIDFromContextMenuAction(const ContextMenuAction& acti
case ContextMenuItemTagSelectAll:
return GTK_STOCK_SELECT_ALL;
case ContextMenuItemTagSpellingGuess:
- return GTK_STOCK_INFO;
+ return NULL;
case ContextMenuItemTagIgnoreSpelling:
return GTK_STOCK_NO;
case ContextMenuItemTagLearnSpelling:
@@ -117,6 +117,12 @@ ContextMenuItem::ContextMenuItem(GtkMenuItem* item)
m_platformDescription.checked = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item));
} else
m_platformDescription.type = ActionType;
+#if GTK_CHECK_VERSION (2, 16, 0)
+ m_platformDescription.title = String::fromUTF8(gtk_menu_item_get_label(GTK_MENU_ITEM(item)));
+#else
+ GtkWidget* label = gtk_bin_get_child(GTK_BIN(item));
+ m_platformDescription.title = String::fromUTF8(gtk_label_get_label(GTK_LABEL(label)));
+#endif
m_platformDescription.action = *static_cast<ContextMenuAction*>(g_object_get_data(G_OBJECT(item), WEBKIT_CONTEXT_MENU_ACTION));
@@ -205,13 +211,12 @@ void ContextMenuItem::setAction(ContextMenuAction action)
String ContextMenuItem::title() const
{
- notImplemented();
- return String();
+ return m_platformDescription.title;
}
-void ContextMenuItem::setTitle(const String&)
+void ContextMenuItem::setTitle(const String& title)
{
- notImplemented();
+ m_platformDescription.title = title;
}
PlatformMenuDescription ContextMenuItem::platformSubMenu() const