forked from AuroraMiddleware/gtk
Merge branch 'wip/aplazas/modelbutton-markup-master' into 'master'
ModelButton: Add 'use-markup' property See merge request GNOME/gtk!222
This commit is contained in:
commit
d9dcfffce3
@ -171,6 +171,7 @@ enum
|
||||
PROP_ROLE,
|
||||
PROP_ICON,
|
||||
PROP_TEXT,
|
||||
PROP_USE_MARKUP,
|
||||
PROP_ACTIVE,
|
||||
PROP_MENU_NAME,
|
||||
PROP_INVERTED,
|
||||
@ -389,6 +390,19 @@ gtk_model_button_set_text (GtkModelButton *button,
|
||||
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_TEXT]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_model_button_set_use_markup (GtkModelButton *button,
|
||||
gboolean use_markup)
|
||||
{
|
||||
use_markup = !!use_markup;
|
||||
if (gtk_label_get_use_markup (GTK_LABEL (button->label)) == use_markup)
|
||||
return;
|
||||
|
||||
gtk_label_set_use_markup (GTK_LABEL (button->label), use_markup);
|
||||
update_visibility (button);
|
||||
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_USE_MARKUP]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_model_button_set_active (GtkModelButton *button,
|
||||
gboolean active)
|
||||
@ -507,6 +521,10 @@ gtk_model_button_get_property (GObject *object,
|
||||
g_value_set_string (value, gtk_label_get_text (GTK_LABEL (button->label)));
|
||||
break;
|
||||
|
||||
case PROP_USE_MARKUP:
|
||||
g_value_set_boolean (value, gtk_label_get_use_markup (GTK_LABEL (button->label)));
|
||||
break;
|
||||
|
||||
case PROP_ACTIVE:
|
||||
g_value_set_boolean (value, button->active);
|
||||
break;
|
||||
@ -555,6 +573,10 @@ gtk_model_button_set_property (GObject *object,
|
||||
gtk_model_button_set_text (button, g_value_get_string (value));
|
||||
break;
|
||||
|
||||
case PROP_USE_MARKUP:
|
||||
gtk_model_button_set_use_markup (button, g_value_get_boolean (value));
|
||||
break;
|
||||
|
||||
case PROP_ACTIVE:
|
||||
gtk_model_button_set_active (button, g_value_get_boolean (value));
|
||||
break;
|
||||
@ -956,6 +978,20 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
|
||||
"",
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GtkModelButton:use-markup:
|
||||
*
|
||||
* If %TRUE, XML tags in the text of the button are interpreted as by
|
||||
* pango_parse_markup() to format the enclosed spans of text. If %FALSE, the
|
||||
* text will be displayed verbatim.
|
||||
*/
|
||||
properties[PROP_USE_MARKUP] =
|
||||
g_param_spec_boolean ("use-markup",
|
||||
P_("Use markup"),
|
||||
P_("The text of the button includes XML markup. See pango_parse_markup()"),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GtkModelButton:active:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user