Improve docs about GtkStyleContext padding/border/margin

GTK_STYLE_PROPERTY_BORDER_WIDTH is of style GtkBorder, not gint.

Also make it clearer what the definition and ordering of these 3
properties is. Reorder them in the header to be more logical.
This commit is contained in:
Milan Bouchet-Valat 2011-01-08 18:11:59 +01:00
parent 27ee3fec96
commit 44da5a0094
2 changed files with 23 additions and 11 deletions

View File

@ -3421,6 +3421,7 @@ gtk_style_context_get_border_color (GtkStyleContext *context,
* @border: (out): return value for the border settings
*
* Gets the border for a given state as a #GtkBorder.
* See %GTK_STYLE_PROPERTY_BORDER_WIDTH.
*
* Since: 3.0
**/
@ -3460,6 +3461,7 @@ gtk_style_context_get_border (GtkStyleContext *context,
* @padding: (out): return value for the padding settings
*
* Gets the padding for a given state as a #GtkBorder.
* See %GTK_STYLE_PROPERTY_PADDING.
*
* Since: 3.0
**/
@ -3499,6 +3501,7 @@ gtk_style_context_get_padding (GtkStyleContext *context,
* @margin: (out): return value for the margin settings
*
* Gets the margin for a given state as a #GtkBorder.
* See %GTK_STYLE_PROPERTY_MARGIN.
*
* Since: 3.0
**/

View File

@ -78,31 +78,40 @@ struct _GtkStyleContextClass
*/
#define GTK_STYLE_PROPERTY_FONT "font"
/**
* GTK_STYLE_PROPERTY_MARGIN:
*
* A property holding the rendered element's margin as a #GtkBorder. The
* margin is defined as the spacing between the border of the element
* and its surrounding elements.
*/
#define GTK_STYLE_PROPERTY_MARGIN "margin"
/**
* GTK_STYLE_PROPERTY_PADDING:
*
* A property holding the rendered element's padding as a #GtkBorder. The
* padding is defined as the spacing between the inner part of the element border
* and its child.
* and its child. It's the innermost spacing property of the padding/border/margin
* series.
*/
#define GTK_STYLE_PROPERTY_PADDING "padding"
/**
* GTK_STYLE_PROPERTY_BORDER_WIDTH:
*
* A property holding the rendered element's border width in pixels as a #gint.
* A property holding the rendered element's border width in pixels as
* a #GtkBorder. The border is the intermediary spacing property of the
* padding/border/margin series.
*
* gtk_render_frame() uses this property to find out the frame line width,
* so #GtkWidget<!-- -->s rendering frames may need to add up this padding when
* requesting size
*/
#define GTK_STYLE_PROPERTY_BORDER_WIDTH "border-width"
/**
* GTK_STYLE_PROPERTY_MARGIN:
*
* A property holding the rendered element's margin as a #GtkBorder. The
* margin is defined as the spacing between the border of the element
* and its surrounding elements. It is external to #GtkWidget<!-- -->s's
* size allocations, and the most external spacing property of the
* padding/border/margin series.
*/
#define GTK_STYLE_PROPERTY_MARGIN "margin"
/**
* GTK_STYLE_PROPERTY_BORDER_RADIUS:
*