summaryrefslogtreecommitdiff
path: root/gtk/gtkshortcutssection.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-11-14 22:34:19 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-11-14 22:34:19 -0500
commit9b041ae93060f22985ba2c100a1b97e50e615f48 (patch)
tree53a620a38ec2c1bc0720e42420c34123b254dfa6 /gtk/gtkshortcutssection.c
parent705d371362c005a4ea699d0b617cdf9d8a336877 (diff)
downloadgtk+-9b041ae93060f22985ba2c100a1b97e50e615f48.tar.gz
shortcuts: Support direction-specific shortcuts
The prime example for direction-dependent shortcuts is using <Alt>Left or <Alt>Right to go back. Support this by adding a direction property to GtkShortcutsShortcut, and filtering by the current text direction. https://bugzilla.gnome.org/show_bug.cgi?id=757888
Diffstat (limited to 'gtk/gtkshortcutssection.c')
-rw-r--r--gtk/gtkshortcutssection.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index 9d8de020de..eb32ccb3f0 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -557,12 +557,18 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self)
if (n_rows == 0 || n_rows + height > self->max_height)
{
GtkWidget *column;
+ GtkSizeGroup *group;
column = gtk_box_new (GTK_ORIENTATION_VERTICAL, 22);
gtk_widget_show (column);
- g_object_set_data_full (G_OBJECT (column), "accel-size-group", gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL), g_object_unref);
- g_object_set_data_full (G_OBJECT (column), "title-size-group", gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL), g_object_unref);
+ group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ gtk_size_group_set_ignore_hidden (group, TRUE);
+ g_object_set_data_full (G_OBJECT (column), "accel-size-group", group, g_object_unref);
+
+ group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ gtk_size_group_set_ignore_hidden (group, TRUE);
+ g_object_set_data_full (G_OBJECT (column), "title-size-group", group, g_object_unref);
if (n_columns % 2 == 0)
{
@@ -598,14 +604,19 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self)
if (n_columns % 2 == 1)
{
GtkWidget *column;
+ GtkSizeGroup *group;
GList *content;
guint n;
column = gtk_box_new (GTK_ORIENTATION_VERTICAL, 22);
gtk_widget_show (column);
- g_object_set_data_full (G_OBJECT (column), "accel-size-group", gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL), g_object_unref);
- g_object_set_data_full (G_OBJECT (column), "title-size-group", gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL), g_object_unref);
+ group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ gtk_size_group_set_ignore_hidden (group, TRUE);
+ g_object_set_data_full (G_OBJECT (column), "accel-size-group", group, g_object_unref);
+ group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ gtk_size_group_set_ignore_hidden (group, TRUE);
+ g_object_set_data_full (G_OBJECT (column), "title-size-group", group, g_object_unref);
gtk_container_add (GTK_CONTAINER (current_page), column);