Beispiel #1
0
/* Called when an icon of a view has changed */
static void _xfdashboard_view_selector_on_view_icon_changed(XfdashboardView *inView, ClutterImage *inImage, gpointer inUserData)
{
	XfdashboardButton					*button;

	g_return_if_fail(XFDASHBOARD_IS_VIEW(inView));
	g_return_if_fail(XFDASHBOARD_IS_TOGGLE_BUTTON(inUserData));

	button=XFDASHBOARD_BUTTON(inUserData);
	xfdashboard_label_set_icon_name(XFDASHBOARD_LABEL(button), xfdashboard_view_get_icon(inView));
}
Beispiel #2
0
/* Set/get properties */
static void _xfdashboard_button_set_property(GObject *inObject,
												guint inPropID,
												const GValue *inValue,
												GParamSpec *inSpec)
{
	XfdashboardButton			*self=XFDASHBOARD_BUTTON(inObject);

	switch(inPropID)
	{
		case PROP_STYLE:
			xfdashboard_label_set_style(XFDASHBOARD_LABEL(self), g_value_get_enum(inValue));
			break;

		default:
			G_OBJECT_WARN_INVALID_PROPERTY_ID(inObject, inPropID, inSpec);
			break;
	}
}
Beispiel #3
0
void xfdashboard_text_box_set_secondary_icon(XfdashboardTextBox *self, const gchar *inIconName)
{
	XfdashboardTextBoxPrivate	*priv;

	g_return_if_fail(XFDASHBOARD_IS_TEXT_BOX(self));
	g_return_if_fail(!inIconName || strlen(inIconName)>0);

	priv=self->priv;

	/* Set themed icon name or icon file name for primary icon */
	if(g_strcmp0(priv->secondaryIconName, inIconName)!=0)
	{
		/* Set new primary icon name */
		if(priv->secondaryIconName)
		{
			g_free(priv->secondaryIconName);
			priv->secondaryIconName=NULL;
		}

		if(inIconName)
		{
			/* Load and set new icon */
			priv->secondaryIconName=g_strdup(inIconName);
			xfdashboard_label_set_icon_name(XFDASHBOARD_LABEL(priv->actorSecondaryIcon), priv->secondaryIconName);

			/* Show icon */
			priv->showSecondaryIcon=TRUE;
			clutter_actor_show(priv->actorSecondaryIcon);
			clutter_actor_queue_relayout(CLUTTER_ACTOR(self));
		}
			else
			{
				/* Hide icon */
				priv->showSecondaryIcon=FALSE;
				clutter_actor_hide(priv->actorSecondaryIcon);
				clutter_actor_queue_relayout(CLUTTER_ACTOR(self));
			}

		/* Notify about property change */
		g_object_notify_by_pspec(G_OBJECT(self), XfdashboardTextBoxProperties[PROP_SECONDARY_ICON_NAME]);
	}
}