diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index b0e61c7ff..76b8b1a16 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -2174,6 +2174,44 @@ st_theme_node_get_border_image (StThemeNode *node) return NULL; } +/** + * st_theme_node_get_horizontal_padding: + * @node: a #StThemeNode + * + * Gets the total horizonal padding (left + right padding) + * + * Return value: the total horizonal padding + * in pixels + */ +double +st_theme_node_get_horizontal_padding (StThemeNode *node) +{ + double padding = 0.0; + padding += st_theme_node_get_padding (node, ST_SIDE_LEFT); + padding += st_theme_node_get_padding (node, ST_SIDE_RIGHT); + + return padding; +} + +/** + * st_theme_node_get_vertical_padding: + * @node: a #StThemeNode + * + * Gets the total vertical padding (top + bottom padding) + * + * Return value: the total vertical padding + * in pixels + */ +double +st_theme_node_get_vertical_padding (StThemeNode *node) +{ + double padding = 0.0; + padding += st_theme_node_get_padding (node, ST_SIDE_TOP); + padding += st_theme_node_get_padding (node, ST_SIDE_BOTTOM); + + return padding; +} + /** * st_theme_node_get_shadow: * @node: a #StThemeNode diff --git a/src/st/st-theme-node.h b/src/st/st-theme-node.h index a33736e00..87c6884ee 100644 --- a/src/st/st-theme-node.h +++ b/src/st/st-theme-node.h @@ -129,6 +129,9 @@ void st_theme_node_get_border_color (StThemeNode *node, double st_theme_node_get_padding (StThemeNode *node, StSide side); +double st_theme_node_get_horizontal_padding (StThemeNode *node); +double st_theme_node_get_vertical_padding (StThemeNode *node); + int st_theme_node_get_width (StThemeNode *node); int st_theme_node_get_height (StThemeNode *node); int st_theme_node_get_min_width (StThemeNode *node);