mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
editablelabel: Add a style class while editing
Add the .editing style class to the editable label while it is editing. The idea is that themes can show a frame around the entry.
This commit is contained in:
parent
7c02ae00c2
commit
899024cef7
@ -444,6 +444,8 @@ gtk_editable_label_start_editing (GtkEditableLabel *self)
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "entry");
|
||||
gtk_widget_grab_focus (self->entry);
|
||||
|
||||
gtk_widget_add_css_class (self, "editing");
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_EDITING]);
|
||||
}
|
||||
|
||||
@ -480,5 +482,8 @@ gtk_editable_label_stop_editing (GtkEditableLabel *self,
|
||||
}
|
||||
|
||||
gtk_widget_grab_focus (GTK_WIDGET (self));
|
||||
|
||||
gtk_widget_remove_css_class (self, "editing");
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_EDITING]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user