Add pulse style class and use in progress bar and entry
This is used for indeterminate progress reporting.
This commit is contained in:
parent
68c74e1427
commit
ca829b484c
@ -3522,6 +3522,8 @@ gtk_entry_draw_progress (GtkWidget *widget,
|
|||||||
GtkStyleContext *context,
|
GtkStyleContext *context,
|
||||||
cairo_t *cr)
|
cairo_t *cr)
|
||||||
{
|
{
|
||||||
|
GtkEntry *entry = GTK_ENTRY (widget);
|
||||||
|
GtkEntryPrivate *private = entry->priv;
|
||||||
gint x, y, width, height;
|
gint x, y, width, height;
|
||||||
|
|
||||||
get_progress_area (widget, &x, &y, &width, &height);
|
get_progress_area (widget, &x, &y, &width, &height);
|
||||||
@ -3531,6 +3533,8 @@ gtk_entry_draw_progress (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_style_context_save (context);
|
gtk_style_context_save (context);
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
|
||||||
|
if (private->progress_pulse_mode)
|
||||||
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PULSE);
|
||||||
|
|
||||||
gtk_render_activity (context, cr,
|
gtk_render_activity (context, cr,
|
||||||
x, y, width, height);
|
x, y, width, height);
|
||||||
|
@ -760,6 +760,7 @@ gtk_progress_bar_paint_activity (GtkProgressBar *pbar,
|
|||||||
|
|
||||||
gtk_style_context_save (context);
|
gtk_style_context_save (context);
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
|
||||||
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PULSE);
|
||||||
|
|
||||||
gtk_render_activity (context, cr, area.x, area.y, area.width, area.height);
|
gtk_render_activity (context, cr, area.x, area.y, area.width, area.height);
|
||||||
|
|
||||||
|
@ -669,6 +669,15 @@ struct _GtkStyleContextClass
|
|||||||
*/
|
*/
|
||||||
#define GTK_STYLE_REGION_TAB "tab"
|
#define GTK_STYLE_REGION_TAB "tab"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GTK_STYLE_CLASS_PULSE:
|
||||||
|
*
|
||||||
|
* A CSS class to use when rendering a pulse in an indeterminate progress bar.
|
||||||
|
*
|
||||||
|
* This is used by #GtkProgressBar and #GtkEntry.
|
||||||
|
*/
|
||||||
|
#define GTK_STYLE_CLASS_PULSE "pulse"
|
||||||
|
|
||||||
|
|
||||||
GType gtk_style_context_get_type (void) G_GNUC_CONST;
|
GType gtk_style_context_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user