- pbar = GTK_PROGRESS_BAR (progress);
- widget = GTK_WIDGET (progress);
-
- if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS ||
- GTK_PROGRESS (pbar)->activity_mode)
- {
- if (GTK_PROGRESS (pbar)->activity_mode)
- {
- guint size;
-
- /* advance the block */
-
- if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
- pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
- {
- /* Update our activity step. */
-
- pbar->activity_step = widget->allocation.width * pbar->pulse_fraction;
-
- size = MAX (2, widget->allocation.width / pbar->activity_blocks);
-
- if (pbar->activity_dir == 0)
- {
- pbar->activity_pos += pbar->activity_step;
- if (pbar->activity_pos + size >=
- widget->allocation.width -
- widget->style->xthickness)
- {
- pbar->activity_pos = widget->allocation.width -
- widget->style->xthickness - size;
- pbar->activity_dir = 1;
- }
- }
- else
- {
- pbar->activity_pos -= pbar->activity_step;
- if (pbar->activity_pos <= widget->style->xthickness)
- {
- pbar->activity_pos = widget->style->xthickness;
- pbar->activity_dir = 0;
- }
- }
- }
- else
- {
- /* Update our activity step. */
-
- pbar->activity_step = widget->allocation.height * pbar->pulse_fraction;
-
- size = MAX (2, widget->allocation.height / pbar->activity_blocks);
-
- if (pbar->activity_dir == 0)
- {
- pbar->activity_pos += pbar->activity_step;
- if (pbar->activity_pos + size >=
- widget->allocation.height -
- widget->style->ythickness)
- {
- pbar->activity_pos = widget->allocation.height -
- widget->style->ythickness - size;
- pbar->activity_dir = 1;
- }
- }
- else
- {
- pbar->activity_pos -= pbar->activity_step;
- if (pbar->activity_pos <= widget->style->ythickness)
- {
- pbar->activity_pos = widget->style->ythickness;
- pbar->activity_dir = 0;
- }
- }
- }
- }
- pbar->dirty = TRUE;
- gtk_widget_queue_draw (GTK_WIDGET (progress));
- }
- else