mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 16:30:15 +00:00
label: Stop connecting to notify::gtk-enable-accels
Leftover from when GtkAccelLabel was a GtkLabel subclass. GtkAccelLabel connects to this itself these days though.
This commit is contained in:
parent
f0b33cdc53
commit
3b7cb31157
@ -411,7 +411,6 @@ static GParamSpec *label_props[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static GQuark quark_shortcuts_connected;
|
||||
static GQuark quark_mnemonics_visible_connected;
|
||||
static GQuark quark_gtk_signal;
|
||||
static GQuark quark_link;
|
||||
@ -1093,7 +1092,6 @@ gtk_label_class_init (GtkLabelClass *class)
|
||||
|
||||
gtk_widget_class_set_css_name (widget_class, I_("label"));
|
||||
|
||||
quark_shortcuts_connected = g_quark_from_static_string ("gtk-label-shortcuts-connected");
|
||||
quark_mnemonics_visible_connected = g_quark_from_static_string ("gtk-label-mnemonics-visible-connected");
|
||||
quark_gtk_signal = g_quark_from_static_string ("gtk-signal");
|
||||
quark_link = g_quark_from_static_string ("link");
|
||||
@ -1515,48 +1513,10 @@ gtk_label_setup_mnemonic (GtkLabel *label)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
label_shortcut_setting_apply (GtkLabel *label)
|
||||
{
|
||||
gtk_label_recalculate (label);
|
||||
}
|
||||
|
||||
static void
|
||||
label_shortcut_setting_traverse_container (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
if (GTK_IS_LABEL (widget))
|
||||
label_shortcut_setting_apply (GTK_LABEL (widget));
|
||||
else if (GTK_IS_CONTAINER (widget))
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
label_shortcut_setting_traverse_container, data);
|
||||
}
|
||||
|
||||
static void
|
||||
label_shortcut_setting_changed (GtkSettings *settings)
|
||||
{
|
||||
GList *list, *l;
|
||||
|
||||
list = gtk_window_list_toplevels ();
|
||||
|
||||
for (l = list; l ; l = l->next)
|
||||
{
|
||||
GtkWidget *widget = l->data;
|
||||
|
||||
if (gtk_widget_get_settings (widget) == settings)
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
label_shortcut_setting_traverse_container, NULL);
|
||||
}
|
||||
|
||||
g_list_free (list);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_root (GtkWidget *widget)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (widget);
|
||||
GtkSettings *settings;
|
||||
gboolean shortcuts_connected;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_label_parent_class)->root (widget);
|
||||
|
||||
@ -1564,23 +1524,6 @@ gtk_label_root (GtkWidget *widget)
|
||||
|
||||
/* The PangoContext is replaced when the display changes, so clear the layouts */
|
||||
gtk_label_clear_layout (GTK_LABEL (widget));
|
||||
|
||||
settings = gtk_widget_get_settings (widget);
|
||||
|
||||
shortcuts_connected =
|
||||
GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (settings), quark_shortcuts_connected));
|
||||
|
||||
if (! shortcuts_connected)
|
||||
{
|
||||
g_signal_connect (settings, "notify::gtk-enable-accels",
|
||||
G_CALLBACK (label_shortcut_setting_changed),
|
||||
NULL);
|
||||
|
||||
g_object_set_qdata (G_OBJECT (settings), quark_shortcuts_connected,
|
||||
GINT_TO_POINTER (TRUE));
|
||||
}
|
||||
|
||||
label_shortcut_setting_apply (GTK_LABEL (widget));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user