diff options
Diffstat (limited to 'gtk/gtkprogressbar.c')
-rw-r--r-- | gtk/gtkprogressbar.c | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index 5fc2971377..a6cdade7d0 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -279,19 +279,19 @@ gtk_progress_bar_real_update (GtkProgress *progress) pbar->activity_pos += pbar->activity_step; if (pbar->activity_pos + size >= widget->allocation.width - - widget->style->klass->xthickness) + widget->style->xthickness) { pbar->activity_pos = widget->allocation.width - - widget->style->klass->xthickness - size; + widget->style->xthickness - size; pbar->activity_dir = 1; } } else { pbar->activity_pos -= pbar->activity_step; - if (pbar->activity_pos <= widget->style->klass->xthickness) + if (pbar->activity_pos <= widget->style->xthickness) { - pbar->activity_pos = widget->style->klass->xthickness; + pbar->activity_pos = widget->style->xthickness; pbar->activity_dir = 0; } } @@ -305,19 +305,19 @@ gtk_progress_bar_real_update (GtkProgress *progress) pbar->activity_pos += pbar->activity_step; if (pbar->activity_pos + size >= widget->allocation.height - - widget->style->klass->ythickness) + widget->style->ythickness) { pbar->activity_pos = widget->allocation.height - - widget->style->klass->ythickness - size; + widget->style->ythickness - size; pbar->activity_dir = 1; } } else { pbar->activity_pos -= pbar->activity_step; - if (pbar->activity_pos <= widget->style->klass->ythickness) + if (pbar->activity_pos <= widget->style->ythickness) { - pbar->activity_pos = widget->style->klass->ythickness; + pbar->activity_pos = widget->style->ythickness; pbar->activity_dir = 0; } } @@ -367,7 +367,7 @@ gtk_progress_bar_size_request (GtkWidget *widget, pango_layout_set_text (layout, buf, -1); pango_layout_get_extents (layout, NULL, &logical_rect); - pango_layout_unref (layout); + g_object_unref (G_OBJECT (layout)); g_free (buf); } @@ -377,11 +377,11 @@ gtk_progress_bar_size_request (GtkWidget *widget, if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE) { requisition->width = MAX (MIN_HORIZONTAL_BAR_WIDTH, - 2 * widget->style->klass->xthickness + 3 + + 2 * widget->style->xthickness + 3 + logical_rect.width / PANGO_SCALE + 2 * TEXT_SPACING); requisition->height = MAX (MIN_HORIZONTAL_BAR_HEIGHT, - 2 * widget->style->klass->ythickness + 3 + + 2 * widget->style->ythickness + 3 + logical_rect.height / PANGO_SCALE + 2 * TEXT_SPACING); } else @@ -395,11 +395,11 @@ gtk_progress_bar_size_request (GtkWidget *widget, if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE) { requisition->width = MAX (MIN_VERTICAL_BAR_WIDTH, - 2 * widget->style->klass->xthickness + 3 + + 2 * widget->style->xthickness + 3 + logical_rect.width / PANGO_SCALE + 2 * TEXT_SPACING); requisition->height = MAX (MIN_VERTICAL_BAR_HEIGHT, - 2 * widget->style->klass->ythickness + 3 + + 2 * widget->style->ythickness + 3 + logical_rect.height / PANGO_SCALE + 2 * TEXT_SPACING); } else @@ -429,14 +429,14 @@ gtk_progress_bar_act_mode_enter (GtkProgress *progress) if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT) { - pbar->activity_pos = widget->style->klass->xthickness; + pbar->activity_pos = widget->style->xthickness; pbar->activity_dir = 0; } else { pbar->activity_pos = widget->allocation.width - - widget->style->klass->xthickness - (widget->allocation.height - - widget->style->klass->ythickness * 2); + widget->style->xthickness - (widget->allocation.height - + widget->style->ythickness * 2); pbar->activity_dir = 1; } } @@ -446,14 +446,14 @@ gtk_progress_bar_act_mode_enter (GtkProgress *progress) if (pbar->orientation == GTK_PROGRESS_TOP_TO_BOTTOM) { - pbar->activity_pos = widget->style->klass->ythickness; + pbar->activity_pos = widget->style->ythickness; pbar->activity_dir = 0; } else { pbar->activity_pos = widget->allocation.height - - widget->style->klass->ythickness - (widget->allocation.width - - widget->style->klass->xthickness * 2); + widget->style->ythickness - (widget->allocation.width - + widget->style->xthickness * 2); pbar->activity_dir = 1; } } @@ -482,10 +482,10 @@ gtk_progress_bar_paint (GtkProgress *progress) if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT || pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT) space = widget->allocation.width - - 2 * widget->style->klass->xthickness; + 2 * widget->style->xthickness; else space = widget->allocation.height - - 2 * widget->style->klass->ythickness; + 2 * widget->style->ythickness; percentage = gtk_progress_get_current_percentage (progress); @@ -511,9 +511,9 @@ gtk_progress_bar_paint (GtkProgress *progress) GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", pbar->activity_pos, - widget->style->klass->ythickness, + widget->style->ythickness, size, - widget->allocation.height - widget->style->klass->ythickness * 2); + widget->allocation.height - widget->style->ythickness * 2); return; } else @@ -524,9 +524,9 @@ gtk_progress_bar_paint (GtkProgress *progress) progress->offscreen_pixmap, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", - widget->style->klass->xthickness, + widget->style->xthickness, pbar->activity_pos, - widget->allocation.width - widget->style->klass->xthickness * 2, + widget->allocation.width - widget->style->xthickness * 2, size); return; } @@ -547,14 +547,14 @@ gtk_progress_bar_paint (GtkProgress *progress) progress->offscreen_pixmap, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", - widget->style->klass->xthickness, - widget->style->klass->ythickness, + widget->style->xthickness, + widget->style->ythickness, amount, - widget->allocation.height - widget->style->klass->ythickness * 2); + widget->allocation.height - widget->style->ythickness * 2); } else { - x = widget->style->klass->xthickness; + x = widget->style->xthickness; for (i = 0; i <= pbar->in_block; i++) { @@ -566,9 +566,9 @@ gtk_progress_bar_paint (GtkProgress *progress) GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", x, - widget->style->klass->ythickness, + widget->style->ythickness, block_delta, - widget->allocation.height - widget->style->klass->ythickness * 2); + widget->allocation.height - widget->style->ythickness * 2); x += block_delta; } @@ -584,16 +584,16 @@ gtk_progress_bar_paint (GtkProgress *progress) GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", widget->allocation.width - - widget->style->klass->xthickness - amount, - widget->style->klass->ythickness, + widget->style->xthickness - amount, + widget->style->ythickness, amount, widget->allocation.height - - widget->style->klass->ythickness * 2); + widget->style->ythickness * 2); } else { x = widget->allocation.width - - widget->style->klass->xthickness; + widget->style->xthickness; for (i = 0; i <= pbar->in_block; i++) { @@ -607,10 +607,10 @@ gtk_progress_bar_paint (GtkProgress *progress) GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", x, - widget->style->klass->ythickness, + widget->style->ythickness, block_delta, widget->allocation.height - - widget->style->klass->ythickness * 2); + widget->style->ythickness * 2); } } break; @@ -623,17 +623,17 @@ gtk_progress_bar_paint (GtkProgress *progress) progress->offscreen_pixmap, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", - widget->style->klass->xthickness, + widget->style->xthickness, widget->allocation.height - - widget->style->klass->ythickness - amount, + widget->style->ythickness - amount, widget->allocation.width - - widget->style->klass->xthickness * 2, + widget->style->xthickness * 2, amount); } else { y = widget->allocation.height - - widget->style->klass->ythickness; + widget->style->ythickness; for (i = 0; i <= pbar->in_block; i++) { @@ -646,10 +646,10 @@ gtk_progress_bar_paint (GtkProgress *progress) progress->offscreen_pixmap, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", - widget->style->klass->xthickness, + widget->style->xthickness, y, widget->allocation.width - - widget->style->klass->xthickness * 2, + widget->style->xthickness * 2, block_delta); } } @@ -663,15 +663,15 @@ gtk_progress_bar_paint (GtkProgress *progress) progress->offscreen_pixmap, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", - widget->style->klass->xthickness, - widget->style->klass->ythickness, + widget->style->xthickness, + widget->style->ythickness, widget->allocation.width - - widget->style->klass->xthickness * 2, + widget->style->xthickness * 2, amount); } else { - y = widget->style->klass->ythickness; + y = widget->style->ythickness; for (i = 0; i <= pbar->in_block; i++) { @@ -683,10 +683,10 @@ gtk_progress_bar_paint (GtkProgress *progress) progress->offscreen_pixmap, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, widget, "bar", - widget->style->klass->xthickness, + widget->style->xthickness, y, widget->allocation.width - - widget->style->klass->xthickness * 2, + widget->style->xthickness * 2, block_delta); y += block_delta; @@ -714,22 +714,22 @@ gtk_progress_bar_paint (GtkProgress *progress) pango_layout_set_text (layout, buf, -1); pango_layout_get_extents (layout, NULL, &logical_rect); - x = widget->style->klass->xthickness + 1 + - (widget->allocation.width - 2 * widget->style->klass->xthickness - + x = widget->style->xthickness + 1 + + (widget->allocation.width - 2 * widget->style->xthickness - 3 - logical_rect.width / PANGO_SCALE) * progress->x_align; - y = widget->style->klass->ythickness + 1 + - (widget->allocation.height - 2 * widget->style->klass->ythickness - + y = widget->style->ythickness + 1 + + (widget->allocation.height - 2 * widget->style->ythickness - 3 - logical_rect.height / PANGO_SCALE) * progress->y_align; - rect.x = widget->style->klass->xthickness + 1; - rect.y = widget->style->klass->ythickness + 1; + rect.x = widget->style->xthickness + 1; + rect.y = widget->style->ythickness + 1; rect.width = widget->allocation.width - - 2 * widget->style->klass->xthickness - 3; + 2 * widget->style->xthickness - 3; rect.height = widget->allocation.height - - 2 * widget->style->klass->ythickness - 3; + 2 * widget->style->ythickness - 3; gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &rect); @@ -740,7 +740,7 @@ gtk_progress_bar_paint (GtkProgress *progress) gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], NULL); - pango_layout_unref (layout); + g_object_unref (G_OBJECT (layout)); g_free (buf); } } |