diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index fd7c85ab41..d8688da01a 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -3541,6 +3541,7 @@ gtk_status_icon_get_type GtkLevelBar GTK_LEVEL_BAR_OFFSET_LOW GTK_LEVEL_BAR_OFFSET_HIGH +GTK_LEVEL_BAR_OFFSET_FULL GtkLevelBarMode GtkLevelBar gtk_level_bar_new diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c index 7b50585da5..5661e0269f 100644 --- a/gtk/gtklevelbar.c +++ b/gtk/gtklevelbar.c @@ -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; diff --git a/gtk/gtklevelbar.h b/gtk/gtklevelbar.h index aab7064fa6..77c1693b7b 100644 --- a/gtk/gtklevelbar.h +++ b/gtk/gtklevelbar.h @@ -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;