]> Pileus Git - ~andy/gtk/commitdiff
Add pulse style class and use in progress bar and entry
authorAlexander Larsson <alexl@redhat.com>
Fri, 18 Nov 2011 09:15:04 +0000 (10:15 +0100)
committerAlexander Larsson <alexl@redhat.com>
Fri, 18 Nov 2011 09:15:04 +0000 (10:15 +0100)
This is used for indeterminate progress reporting.

gtk/gtkentry.c
gtk/gtkprogressbar.c
gtk/gtkstylecontext.h

index 0acf72d2142ac6458f4bd23430eec7ab89e968d0..9d92af816eb13dd0ab98e80eef5d2e86e43bf919 100644 (file)
@@ -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);
index 48ead0489a660e763c7c03a5908d4d46dc13dfd5..319ac1ab150af441b6f3ad391f1291b111d24d17 100644 (file)
@@ -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);
 
index 634c31adfd6026c5b145e883f0142b1c4a6a29e4..7b5f8e891da8238aa3b239b4926a189a6e092853 100644 (file)
@@ -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;