mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
Merge branch 'prop-action-state-hints' into 'master'
property action: Add state hints See merge request GNOME/glib!906
This commit is contained in:
@@ -158,6 +158,29 @@ g_property_action_get_state_type (GAction *action)
|
|||||||
static GVariant *
|
static GVariant *
|
||||||
g_property_action_get_state_hint (GAction *action)
|
g_property_action_get_state_hint (GAction *action)
|
||||||
{
|
{
|
||||||
|
GPropertyAction *paction = G_PROPERTY_ACTION (action);
|
||||||
|
|
||||||
|
if (paction->pspec->value_type == G_TYPE_INT)
|
||||||
|
{
|
||||||
|
GParamSpecInt *pspec = (GParamSpecInt *)paction->pspec;
|
||||||
|
return g_variant_new ("(ii)", pspec->minimum, pspec->maximum);
|
||||||
|
}
|
||||||
|
else if (paction->pspec->value_type == G_TYPE_UINT)
|
||||||
|
{
|
||||||
|
GParamSpecUInt *pspec = (GParamSpecUInt *)paction->pspec;
|
||||||
|
return g_variant_new ("(uu)", pspec->minimum, pspec->maximum);
|
||||||
|
}
|
||||||
|
else if (paction->pspec->value_type == G_TYPE_FLOAT)
|
||||||
|
{
|
||||||
|
GParamSpecFloat *pspec = (GParamSpecFloat *)paction->pspec;
|
||||||
|
return g_variant_new ("(dd)", (double)pspec->minimum, (double)pspec->maximum);
|
||||||
|
}
|
||||||
|
else if (paction->pspec->value_type == G_TYPE_DOUBLE)
|
||||||
|
{
|
||||||
|
GParamSpecDouble *pspec = (GParamSpecDouble *)paction->pspec;
|
||||||
|
return g_variant_new ("(dd)", pspec->minimum, pspec->maximum);
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user