[gnome-shell] Add get_horizontal/vertical_padding() methods



commit 730e8ffdf9c4668ecbd362a3e84812c0d10e129e
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Thu Mar 11 18:04:08 2010 +0100

    Add get_horizontal/vertical_padding() methods
    
    Add get_horizontal_padding() and get_vertical_padding() methods,
    that return the total padding (LEFT+RIGHT or TOP+BOTTOM).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=597983

 src/st/st-theme-node.c |   38 ++++++++++++++++++++++++++++++++++++++
 src/st/st-theme-node.h |    3 +++
 2 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c
index b0e61c7..76b8b1a 100644
--- a/src/st/st-theme-node.c
+++ b/src/st/st-theme-node.c
@@ -2175,6 +2175,44 @@ st_theme_node_get_border_image (StThemeNode *node)
 }
 
 /**
+ * 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 a33736e..87c6884 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]