summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2011-11-18 10:15:04 +0100
committerAlexander Larsson <alexl@redhat.com>2011-11-18 10:15:04 +0100
commitca829b484c48d9ccbf12032a7f45ae910fd5ace8 (patch)
treea947c534420877ead441132dc3d514fe73c2818c /gtk
parent68c74e142709458b95ccc76d8d21c3f038e42ecf (diff)
downloadgtk+-ca829b484c48d9ccbf12032a7f45ae910fd5ace8.tar.gz
Add pulse style class and use in progress bar and entry
This is used for indeterminate progress reporting.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkentry.c4
-rw-r--r--gtk/gtkprogressbar.c1
-rw-r--r--gtk/gtkstylecontext.h9
3 files changed, 14 insertions, 0 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 0acf72d214..9d92af816e 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3522,6 +3522,8 @@ gtk_entry_draw_progress (GtkWidget *widget,
GtkStyleContext *context,
cairo_t *cr)
{
+ GtkEntry *entry = GTK_ENTRY (widget);
+ GtkEntryPrivate *private = entry->priv;
gint 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_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,
x, y, width, height);
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 48ead0489a..319ac1ab15 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -760,6 +760,7 @@ gtk_progress_bar_paint_activity (GtkProgressBar *pbar,
gtk_style_context_save (context);
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);
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 634c31adfd..7b5f8e891d 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -669,6 +669,15 @@ struct _GtkStyleContextClass
*/
#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;