[gtk/matthiasc/for-master: 3/3] dropdown: Add an icon the search entry
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 3/3] dropdown: Add an icon the search entry
- Date: Thu, 22 Oct 2020 18:34:37 +0000 (UTC)
commit 3a08706e4034d0bf4ddfc7516a178a63287e2120
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 22 14:33:41 2020 -0400
dropdown: Add an icon the search entry
A small detail for #3291.
gtk/gtkdropdown.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkdropdown.c b/gtk/gtkdropdown.c
index 80dc7a1ae6..d33f1e9524 100644
--- a/gtk/gtkdropdown.c
+++ b/gtk/gtkdropdown.c
@@ -251,6 +251,8 @@ gtk_drop_down_dispose (GObject *object)
{
GtkDropDown *self = GTK_DROP_DOWN (object);
+ gtk_widget_unparent (gtk_widget_get_first_child (self->search_entry));
+
g_clear_pointer (&self->popup, gtk_widget_unparent);
g_clear_pointer (&self->button, gtk_widget_unparent);
@@ -594,11 +596,19 @@ set_default_factory (GtkDropDown *self)
static void
gtk_drop_down_init (GtkDropDown *self)
{
+ GtkWidget *icon;
+
g_type_ensure (GTK_TYPE_BUILTIN_ICON);
g_type_ensure (GTK_TYPE_LIST_ITEM_WIDGET);
gtk_widget_init_template (GTK_WIDGET (self));
+ icon = g_object_new (GTK_TYPE_IMAGE,
+ "accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
+ "icon-name", "system-search-symbolic",
+ NULL);
+ gtk_widget_insert_after (icon, self->search_entry, NULL);
+
set_default_factory (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]