level bar: Make the full offset official

We are adding 3 offsets, not just two. Add a define for the
third one, and mention it in the docs.
This commit is contained in:
Matthias Clasen 2016-02-06 16:11:17 +01:00
parent 7b668660a9
commit 8776bb5324
3 changed files with 15 additions and 4 deletions

View File

@ -3541,6 +3541,7 @@ gtk_status_icon_get_type
<TITLE>GtkLevelBar</TITLE>
GTK_LEVEL_BAR_OFFSET_LOW
GTK_LEVEL_BAR_OFFSET_HIGH
GTK_LEVEL_BAR_OFFSET_FULL
GtkLevelBarMode
GtkLevelBar
gtk_level_bar_new

View File

@ -29,9 +29,10 @@
*
* Use gtk_level_bar_set_value() to set the current value, and
* gtk_level_bar_add_offset_value() to set the value offsets at which
* the bar will be considered in a different state. GTK will add two offsets
* by default on the level bar: #GTK_LEVEL_BAR_OFFSET_LOW and
* #GTK_LEVEL_BAR_OFFSET_HIGH, with values 0.25 and 0.75 respectively.
* the bar will be considered in a different state. GTK will add a few
* offsets by default on the level bar: #GTK_LEVEL_BAR_OFFSET_LOW,
* #GTK_LEVEL_BAR_OFFSET_HIGH and #GTK_LEVEL_BAR_OFFSET_FULL, with
* values 0.25, 0.75 and 1.0 respectively.
*
* ## Adding a custom offset on the bar
*
@ -1146,7 +1147,7 @@ gtk_level_bar_init (GtkLevelBar *self)
gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_LOW, 0.25);
gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_HIGH, 0.75);
gtk_level_bar_ensure_offset (self, "full", 1.0);
gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_FULL, 1.0);
priv->block_gadget = NULL;
priv->n_blocks = 0;

View File

@ -54,6 +54,15 @@ G_BEGIN_DECLS
*/
#define GTK_LEVEL_BAR_OFFSET_HIGH "high"
/**
* GTK_LEVEL_BAR_OFFSET_FULL:
*
* The name used for the stock full offset included by #GtkLevelBar.
*
* Since: 3.20
*/
#define GTK_LEVEL_BAR_OFFSET_FULL "full"
typedef struct _GtkLevelBarClass GtkLevelBarClass;
typedef struct _GtkLevelBar GtkLevelBar;
typedef struct _GtkLevelBarPrivate GtkLevelBarPrivate;