[gtk/matthiasc/for-master] editablelabel: Add a style class while editing
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] editablelabel: Add a style class while editing
- Date: Sat, 18 Jul 2020 14:11:47 +0000 (UTC)
commit 899024cef7bc6c9540e1f14334f4b49fb5f80342
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 18 09:54:55 2020 -0400
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.
gtk/gtkeditablelabel.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/gtk/gtkeditablelabel.c b/gtk/gtkeditablelabel.c
index 7914f9bca7..4ca22ff129 100644
--- a/gtk/gtkeditablelabel.c
+++ b/gtk/gtkeditablelabel.c
@@ -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]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]