mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 19:00:12 +00:00
Remove an unnecessary warning
Don't warn if there's more than one mnemonic label for a widget, and skip invisible labels. Bug 665015
This commit is contained in:
parent
d7e8388e9d
commit
2637240abe
@ -197,20 +197,21 @@ find_label (GtkWidget *widget)
|
|||||||
GList *labels;
|
GList *labels;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GtkWidget *temp_widget;
|
GtkWidget *temp_widget;
|
||||||
|
GList *ptr;
|
||||||
|
|
||||||
labels = gtk_widget_list_mnemonic_labels (widget);
|
labels = gtk_widget_list_mnemonic_labels (widget);
|
||||||
label = NULL;
|
label = NULL;
|
||||||
if (labels)
|
ptr = labels;
|
||||||
|
while (ptr)
|
||||||
{
|
{
|
||||||
if (labels->data)
|
if (ptr->data && gtk_widget_get_visible (GTK_WIDGET (ptr->data)))
|
||||||
{
|
{
|
||||||
if (labels->next)
|
label = ptr->data;
|
||||||
g_warning ("Widget (%s) has more than one label", G_OBJECT_TYPE_NAME (widget));
|
break;
|
||||||
else
|
|
||||||
label = labels->data;
|
|
||||||
}
|
}
|
||||||
g_list_free (labels);
|
ptr = ptr->next;
|
||||||
}
|
}
|
||||||
|
g_list_free (labels);
|
||||||
|
|
||||||
/* Ignore a label within a button; bug #136602 */
|
/* Ignore a label within a button; bug #136602 */
|
||||||
if (label && GTK_IS_BUTTON (widget))
|
if (label && GTK_IS_BUTTON (widget))
|
||||||
|
Loading…
Reference in New Issue
Block a user