Commit 90383300 authored by Alexander Larsson's avatar Alexander Larsson

listbox: Set activate_signal on listboxrow class

keyboard navigation didn't support activation since we moved
the keynav to the child row widgets. We fix this by adding a
activate signal handler for the row and setting
widget_class->activate_signal to it.

https://bugzilla.gnome.org/show_bug.cgi?id=707778
parent 659a6f3a
......@@ -109,6 +109,11 @@ enum {
LAST_SIGNAL
};
enum {
ROW__ACTIVATE,
ROW__LAST_SIGNAL
};
enum {
PROP_0,
PROP_SELECTION_MODE,
......@@ -206,6 +211,7 @@ static void gtk_list_box_real_get_preferred_width_for_height (Gt
static GParamSpec *properties[LAST_PROPERTY] = { NULL, };
static guint signals[LAST_SIGNAL] = { 0 };
static guint row_signals[ROW__LAST_SIGNAL] = { 0 };
/**
* gtk_list_box_new:
......@@ -2466,6 +2472,17 @@ gtk_list_box_row_real_focus (GtkWidget *widget,
}
}
static void
gtk_list_box_row_real_activate (GtkListBoxRow *row)
{
GtkListBox *list_box;
list_box = gtk_list_box_row_get_box (row);
if (list_box)
gtk_list_box_select_and_activate (list_box, row);
}
static void
gtk_list_box_row_real_show (GtkWidget *widget)
{
......@@ -2792,4 +2809,16 @@ gtk_list_box_row_class_init (GtkListBoxRowClass *klass)
widget_class->get_preferred_width_for_height = gtk_list_box_row_real_get_preferred_width_for_height;
widget_class->size_allocate = gtk_list_box_row_real_size_allocate;
widget_class->focus = gtk_list_box_row_real_focus;
klass->activate = gtk_list_box_row_real_activate;
row_signals[ROW__ACTIVATE] =
g_signal_new (I_("activate"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkListBoxRowClass, activate),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
widget_class->activate_signal = row_signals[ROW__ACTIVATE];
}
......@@ -88,10 +88,11 @@ struct _GtkListBoxRowClass
{
GtkBinClass parent_class;
void (* activate) (GtkListBoxRow *row);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
};
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment