GtkAccelLabel: Add a setter for manual accels

This is needed to keep the a11y keybinding code working.
This commit is contained in:
Matthias Clasen 2014-01-05 11:12:09 -05:00
parent 29cd52c854
commit 7e3f68d950
3 changed files with 29 additions and 0 deletions

View File

@ -140,6 +140,7 @@ gtk_accel_label_get_accel_widget
gtk_accel_label_set_accel_widget
gtk_accel_label_get_accel_width
gtk_accel_label_set_accel
gtk_accel_label_get_accel
gtk_accel_label_refetch
<SUBSECTION Standard>
GTK_ACCEL_LABEL

View File

@ -981,8 +981,32 @@ gtk_accel_label_set_accel (GtkAccelLabel *accel_label,
guint accelerator_key,
GdkModifierType accelerator_mods)
{
g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label));
accel_label->priv->accel_key = accelerator_key;
accel_label->priv->accel_mods = accelerator_mods;
gtk_accel_label_reset (accel_label);
}
/**
* gtk_accel_label_get_accel:
* @accel_label: a #GtkAccelLabel
* @accelerator_key: return location for the keyval
* @accelerator_mods: return location for the modifier mask
*
* Returns the keyval and modifier mask set with
* gtk_accel_label_set_accel().
*
* Since: 3.12
*/
void
gtk_accel_label_get_accel (GtkAccelLabel *accel_label,
guint *accelerator_key,
GdkModifierType *accelerator_mods)
{
g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label));
*accelerator_key = accel_label->priv->accel_key;
*accelerator_mods = accel_label->priv->accel_mods;
}

View File

@ -101,6 +101,10 @@ GDK_AVAILABLE_IN_3_6
void gtk_accel_label_set_accel (GtkAccelLabel *accel_label,
guint accelerator_key,
GdkModifierType accelerator_mods);
GDK_AVAILABLE_IN_3_12
void gtk_accel_label_get_accel (GtkAccelLabel *accel_label,
guint *accelerator_key,
GdkModifierType *accelerator_mods);
/* private */
gchar * _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,