[StThemeNode] Add transition-duration CSS property
Add a CSS property to control style transitions. https://bugzilla.gnome.org/show_bug.cgi?id=619025
This commit is contained in:
parent
0deffbaaf0
commit
d4a8c64d22
@ -36,6 +36,8 @@ struct _StThemeNode {
|
|||||||
int max_width;
|
int max_width;
|
||||||
int max_height;
|
int max_height;
|
||||||
|
|
||||||
|
int transition_duration;
|
||||||
|
|
||||||
char *background_image;
|
char *background_image;
|
||||||
StBorderImage *border_image;
|
StBorderImage *border_image;
|
||||||
StShadow *shadow;
|
StShadow *shadow;
|
||||||
|
@ -20,6 +20,7 @@ G_DEFINE_TYPE (StThemeNode, st_theme_node, G_TYPE_OBJECT)
|
|||||||
static void
|
static void
|
||||||
st_theme_node_init (StThemeNode *node)
|
st_theme_node_init (StThemeNode *node)
|
||||||
{
|
{
|
||||||
|
node->transition_duration = -1;
|
||||||
_st_theme_node_init_drawing_state (node);
|
_st_theme_node_init_drawing_state (node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1548,6 +1549,33 @@ st_theme_node_get_padding (StThemeNode *node,
|
|||||||
return node->padding[side];
|
return node->padding[side];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* st_theme_node_get_transition_duration:
|
||||||
|
* @node: an #StThemeNode
|
||||||
|
*
|
||||||
|
* Get the value of the transition-duration property, which
|
||||||
|
* specifies the transition time between the previous #StThemeNode
|
||||||
|
* and @node.
|
||||||
|
*
|
||||||
|
* Returns: the node's transition duration in milliseconds
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
st_theme_node_get_transition_duration (StThemeNode *node)
|
||||||
|
{
|
||||||
|
gdouble value = 0.0;
|
||||||
|
|
||||||
|
g_return_val_if_fail (ST_IS_THEME_NODE (node), 0);
|
||||||
|
|
||||||
|
if (node->transition_duration > -1)
|
||||||
|
return node->transition_duration;
|
||||||
|
|
||||||
|
st_theme_node_get_double (node, "transition-duration", FALSE, &value);
|
||||||
|
|
||||||
|
node->transition_duration = (int)value;
|
||||||
|
|
||||||
|
return node->transition_duration;
|
||||||
|
}
|
||||||
|
|
||||||
StTextDecoration
|
StTextDecoration
|
||||||
st_theme_node_get_text_decoration (StThemeNode *node)
|
st_theme_node_get_text_decoration (StThemeNode *node)
|
||||||
{
|
{
|
||||||
|
@ -141,6 +141,8 @@ int st_theme_node_get_min_height (StThemeNode *node);
|
|||||||
int st_theme_node_get_max_width (StThemeNode *node);
|
int st_theme_node_get_max_width (StThemeNode *node);
|
||||||
int st_theme_node_get_max_height (StThemeNode *node);
|
int st_theme_node_get_max_height (StThemeNode *node);
|
||||||
|
|
||||||
|
int st_theme_node_get_transition_duration (StThemeNode *node);
|
||||||
|
|
||||||
StTextDecoration st_theme_node_get_text_decoration (StThemeNode *node);
|
StTextDecoration st_theme_node_get_text_decoration (StThemeNode *node);
|
||||||
|
|
||||||
/* Font rule processing is pretty complicated, so we just hardcode it
|
/* Font rule processing is pretty complicated, so we just hardcode it
|
||||||
|
Loading…
Reference in New Issue
Block a user