From ace73a6f51a0ddd11ebe43e07011342220f47fb0 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 7 Jun 2019 00:15:00 -0700 Subject: [PATCH] libsysprof-ui: add selected property to icon --- src/libsysprof-ui/sysprof-aid-icon.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/libsysprof-ui/sysprof-aid-icon.c b/src/libsysprof-ui/sysprof-aid-icon.c index 5dc43fbc..eba2b4ff 100644 --- a/src/libsysprof-ui/sysprof-aid-icon.c +++ b/src/libsysprof-ui/sysprof-aid-icon.c @@ -41,6 +41,7 @@ G_DEFINE_TYPE (SysprofAidIcon, sysprof_aid_icon, GTK_TYPE_FLOW_BOX_CHILD) enum { PROP_0, PROP_AID, + PROP_SELECTED, N_PROPS }; @@ -129,6 +130,10 @@ sysprof_aid_icon_get_property (GObject *object, g_value_set_object (value, sysprof_aid_icon_get_aid (self)); break; + case PROP_SELECTED: + g_value_set_boolean (value, gtk_widget_get_visible (GTK_WIDGET (self->check))); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -148,6 +153,10 @@ sysprof_aid_icon_set_property (GObject *object, sysprof_aid_icon_set_aid (self, g_value_get_object (value)); break; + case PROP_SELECTED: + gtk_widget_set_visible (GTK_WIDGET (self->check), g_value_get_boolean (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -170,6 +179,13 @@ sysprof_aid_icon_class_init (SysprofAidIconClass *klass) SYSPROF_TYPE_AID, (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + properties [PROP_SELECTED] = + g_param_spec_boolean ("selected", + "Selected", + "If the item is selected", + FALSE, + (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_properties (object_class, N_PROPS, properties); gtk_widget_class_set_css_name (widget_class, "sysprofaidicon");