summaryrefslogtreecommitdiff
path: root/gtk/gtkmenutrackeritem.c
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2016-10-12 13:56:57 -0700
committerMatthias Clasen <mclasen@redhat.com>2016-10-13 06:34:50 -0400
commit133da654338544c9d8bf657eb3da3f5902e8889b (patch)
tree5a8052db351427b827eef5c2cf8a9473f5c827b0 /gtk/gtkmenutrackeritem.c
parent9e2b1ad39e86b2352116f49214cf195cb3e0e970 (diff)
downloadgtk+-133da654338544c9d8bf657eb3da3f5902e8889b.tar.gz
menusectionbox: add support for "text-direction" attribute
This allows the use of a "text-direction" hint set to one of "none", "rtl", or "ltr" to enforce the text direction of a "horizontal-buttons" display-hint. This is useful when a menu has buttons that map to physical space in the UI and therefore must match the application widgetry. https://bugzilla.gnome.org/show_bug.cgi?id=772775
Diffstat (limited to 'gtk/gtkmenutrackeritem.c')
-rw-r--r--gtk/gtkmenutrackeritem.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/gtkmenutrackeritem.c b/gtk/gtkmenutrackeritem.c
index 7d8952185c..ef1b60cd9f 100644
--- a/gtk/gtkmenutrackeritem.c
+++ b/gtk/gtkmenutrackeritem.c
@@ -726,6 +726,16 @@ gtk_menu_tracker_item_get_display_hint (GtkMenuTrackerItem *self)
return display_hint;
}
+const gchar *
+gtk_menu_tracker_item_get_text_direction (GtkMenuTrackerItem *self)
+{
+ const gchar *text_direction = NULL;
+
+ g_menu_item_get_attribute (self->item, "text-direction", "&s", &text_direction);
+
+ return text_direction;
+}
+
GMenuModel *
_gtk_menu_tracker_item_get_link (GtkMenuTrackerItem *self,
const gchar *link_name)