mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 15:40:53 +00:00
libsysprof-ui: add selected property to icon
This commit is contained in:
@ -41,6 +41,7 @@ G_DEFINE_TYPE (SysprofAidIcon, sysprof_aid_icon, GTK_TYPE_FLOW_BOX_CHILD)
|
|||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_AID,
|
PROP_AID,
|
||||||
|
PROP_SELECTED,
|
||||||
N_PROPS
|
N_PROPS
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -129,6 +130,10 @@ sysprof_aid_icon_get_property (GObject *object,
|
|||||||
g_value_set_object (value, sysprof_aid_icon_get_aid (self));
|
g_value_set_object (value, sysprof_aid_icon_get_aid (self));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SELECTED:
|
||||||
|
g_value_set_boolean (value, gtk_widget_get_visible (GTK_WIDGET (self->check)));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
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));
|
sysprof_aid_icon_set_aid (self, g_value_get_object (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SELECTED:
|
||||||
|
gtk_widget_set_visible (GTK_WIDGET (self->check), g_value_get_boolean (value));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
}
|
}
|
||||||
@ -170,6 +179,13 @@ sysprof_aid_icon_class_init (SysprofAidIconClass *klass)
|
|||||||
SYSPROF_TYPE_AID,
|
SYSPROF_TYPE_AID,
|
||||||
(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
|
(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);
|
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||||
|
|
||||||
gtk_widget_class_set_css_name (widget_class, "sysprofaidicon");
|
gtk_widget_class_set_css_name (widget_class, "sysprofaidicon");
|
||||||
|
|||||||
Reference in New Issue
Block a user