Beispiel #1
0
static newtComponent
nmt_newt_label_build_component (NmtNewtComponent *component,
                                gboolean          sensitive)
{
	NmtNewtLabelPrivate *priv = NMT_NEWT_LABEL_GET_PRIVATE (component);
	newtComponent co;
	char *text_lc;

	text_lc = nmt_newt_locale_from_utf8 (priv->text);
	co = newtLabel (-1, -1, text_lc);
	g_free (text_lc);

	if (priv->highlight)
		newtLabelSetColors (co, NMT_NEWT_COLORSET_BAD_LABEL);
	else if (priv->style == NMT_NEWT_LABEL_PLAIN)
		newtLabelSetColors (co, NMT_NEWT_COLORSET_PLAIN_LABEL);

	return co;
}
Beispiel #2
0
static newtComponent
nmt_newt_button_build_component (NmtNewtComponent *component,
                                 gboolean          sensitive)
{
	NmtNewtButtonPrivate *priv = NMT_NEWT_BUTTON_GET_PRIVATE (component);
	newtComponent co;
	char *label = NULL, *label_lc;

	if (sensitive) {
		label_lc = nmt_newt_locale_from_utf8 (priv->label);
		co = newtCompactButton (-1, -1, label_lc);
		g_free (label_lc);
	} else {
		label = g_strdup_printf (" <%s>", priv->label);
		label_lc = nmt_newt_locale_from_utf8 (label);
		co = newtLabel (-1, -1, label_lc);
		g_free (label_lc);
		newtLabelSetColors (co, NMT_NEWT_COLORSET_DISABLED_BUTTON);
	}

	return co;
}