forked from AuroraMiddleware/gtk
modelbutton: Remove accel poking
Stop manually poking GtkApplication for accels. GtkApplication already feeds them into the action muxer machinery, so that is where will get them.
This commit is contained in:
parent
6e8c78714d
commit
1db5382c6d
@ -980,48 +980,6 @@ gtk_model_button_finalize (GObject *object)
|
|||||||
G_OBJECT_CLASS (gtk_model_button_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gtk_model_button_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_button_root (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GtkModelButton *self = GTK_MODEL_BUTTON (widget);
|
|
||||||
GtkRoot *root;
|
|
||||||
GtkApplication *app;
|
|
||||||
const char *action_name;
|
|
||||||
GVariant *action_target;
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_model_button_parent_class)->root (widget);
|
|
||||||
|
|
||||||
if (!self->accel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
root = gtk_widget_get_root (widget);
|
|
||||||
|
|
||||||
if (!GTK_IS_WINDOW (root))
|
|
||||||
return;
|
|
||||||
|
|
||||||
app = gtk_window_get_application (GTK_WINDOW (root));
|
|
||||||
|
|
||||||
if (!app)
|
|
||||||
return;
|
|
||||||
|
|
||||||
action_name = gtk_actionable_get_action_name (GTK_ACTIONABLE (widget));
|
|
||||||
action_target = gtk_actionable_get_action_target_value (GTK_ACTIONABLE (widget));
|
|
||||||
|
|
||||||
if (action_name)
|
|
||||||
{
|
|
||||||
char *detailed;
|
|
||||||
char **accels;
|
|
||||||
|
|
||||||
detailed = g_action_print_detailed_name (action_name, action_target);
|
|
||||||
accels = gtk_application_get_accels_for_action (app, detailed);
|
|
||||||
|
|
||||||
update_accel (self, accels[0]);
|
|
||||||
|
|
||||||
g_strfreev (accels);
|
|
||||||
g_free (detailed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gtk_model_button_focus (GtkWidget *widget,
|
gtk_model_button_focus (GtkWidget *widget,
|
||||||
GtkDirectionType direction)
|
GtkDirectionType direction)
|
||||||
@ -1094,7 +1052,6 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
|
|||||||
widget_class->state_flags_changed = gtk_model_button_state_flags_changed;
|
widget_class->state_flags_changed = gtk_model_button_state_flags_changed;
|
||||||
widget_class->direction_changed = gtk_model_button_direction_changed;
|
widget_class->direction_changed = gtk_model_button_direction_changed;
|
||||||
widget_class->focus = gtk_model_button_focus;
|
widget_class->focus = gtk_model_button_focus;
|
||||||
widget_class->root = gtk_model_button_root;
|
|
||||||
widget_class->get_accessible = gtk_model_button_get_accessible;
|
widget_class->get_accessible = gtk_model_button_get_accessible;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user