summaryrefslogtreecommitdiff
path: root/gtk/gtkprogressbar.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1998-11-06 16:03:17 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-11-06 16:03:17 +0000
commit093032a4c1940919ef403556d4912f371c3bfc24 (patch)
tree78ec24e0d6ce2d84453f27ba496673f53206db8e /gtk/gtkprogressbar.c
parent4b0e615fc5e2ab8c996f08e5401ba459eca7f078 (diff)
downloadgtk+-themes-2.tar.gz
Queue a clear/redraw, not just a redraw, so the focus gets undrawnthemes-2
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue a clear/redraw, not just a redraw, so the focus gets undrawn properly. * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): Chain to gtk_widget_unrealize() instead of duplicating code. Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed last vestiges of old DND. Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c: Restored inner border to entries, erase cursors to background image. Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() - it was identical to paint_flat_box(). * gtk/gtkstyle.c: Coding style fixups. * gtk/gtkwindow.c (gtk_window_move_resize): removed useless test. * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: Change 'side' for paint_[box/shadow]_gap and paint_extension to be GtkPositionType instead of a random int. * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use "frame" as detail - an aspectframe should draw identical to a frame. Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed from combine_child_shapes(). * gdk/gdkwindow.c: Merge propagate_shapes() and propagate_combine_shapes() to remove code duplication.
Diffstat (limited to 'gtk/gtkprogressbar.c')
-rw-r--r--gtk/gtkprogressbar.c238
1 files changed, 119 insertions, 119 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 115bf8bf18..429f8a435d 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -379,47 +379,47 @@ gtk_progress_bar_paint (GtkProgress *progress)
if (progress->offscreen_pixmap)
{
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_NORMAL, GTK_SHADOW_IN,
- NULL, widget, "trough",
- 0, 0,
- widget->allocation.width,
- widget->allocation.height);
-
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_NORMAL, GTK_SHADOW_IN,
+ NULL, widget, "trough",
+ 0, 0,
+ widget->allocation.width,
+ widget->allocation.height);
+
if (progress->activity_mode)
{
if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
{
size = MAX (2, widget->allocation.width / pbar->activity_blocks);
-
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- pbar->activity_pos,
- widget->style->klass->ythickness,
- size,
- widget->allocation.height - widget->style->klass->ythickness * 2);
+
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ pbar->activity_pos,
+ widget->style->klass->ythickness,
+ size,
+ widget->allocation.height - widget->style->klass->ythickness * 2);
return;
}
else
{
size = MAX (2, widget->allocation.height / pbar->activity_blocks);
-
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- widget->style->klass->xthickness,
- pbar->activity_pos,
- widget->allocation.width - widget->style->klass->xthickness * 2,
- size);
+
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ widget->style->klass->xthickness,
+ pbar->activity_pos,
+ widget->allocation.width - widget->style->klass->xthickness * 2,
+ size);
return;
}
}
-
+
amount = percentage * space;
if (amount > 0)
@@ -431,14 +431,14 @@ gtk_progress_bar_paint (GtkProgress *progress)
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
{
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- widget->style->klass->xthickness,
- widget->style->klass->ythickness,
- amount,
- widget->allocation.height - widget->style->klass->ythickness * 2);
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ widget->style->klass->xthickness,
+ widget->style->klass->ythickness,
+ amount,
+ widget->allocation.height - widget->style->klass->ythickness * 2);
}
else
{
@@ -449,56 +449,56 @@ gtk_progress_bar_paint (GtkProgress *progress)
block_delta = (((i + 1) * space) / pbar->blocks)
- ((i * space) / pbar->blocks);
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- x,
- widget->style->klass->ythickness,
- block_delta,
- widget->allocation.height - widget->style->klass->ythickness * 2);
-
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ x,
+ widget->style->klass->ythickness,
+ block_delta,
+ widget->allocation.height - widget->style->klass->ythickness * 2);
+
x += block_delta;
}
}
break;
-
+
case GTK_PROGRESS_RIGHT_TO_LEFT:
-
+
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
{
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- widget->allocation.width -
- widget->style->klass->xthickness - amount,
- widget->style->klass->ythickness,
- amount,
- widget->allocation.height -
- widget->style->klass->ythickness * 2);
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ widget->allocation.width -
+ widget->style->klass->xthickness - amount,
+ widget->style->klass->ythickness,
+ amount,
+ widget->allocation.height -
+ widget->style->klass->ythickness * 2);
}
else
{
x = widget->allocation.width -
widget->style->klass->xthickness;
-
+
for (i = 0; i <= pbar->in_block; i++)
{
block_delta = (((i + 1) * space) / pbar->blocks) -
((i * space) / pbar->blocks);
-
- x -= block_delta;
-
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- x,
- widget->style->klass->ythickness,
- block_delta,
- widget->allocation.height -
- widget->style->klass->ythickness * 2);
+
+ x -= block_delta;
+
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ x,
+ widget->style->klass->ythickness,
+ block_delta,
+ widget->allocation.height -
+ widget->style->klass->ythickness * 2);
}
}
break;
@@ -507,86 +507,86 @@ gtk_progress_bar_paint (GtkProgress *progress)
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
{
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- widget->style->klass->xthickness,
- widget->allocation.height -
- widget->style->klass->ythickness - amount,
- widget->allocation.width -
- widget->style->klass->xthickness * 2,
- amount);
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ widget->style->klass->xthickness,
+ widget->allocation.height -
+ widget->style->klass->ythickness - amount,
+ widget->allocation.width -
+ widget->style->klass->xthickness * 2,
+ amount);
}
else
{
y = widget->allocation.height -
widget->style->klass->ythickness;
-
+
for (i = 0; i <= pbar->in_block; i++)
{
block_delta = (((i + 1) * space) / pbar->blocks) -
((i * space) / pbar->blocks);
- y -= block_delta;
-
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- widget->style->klass->xthickness,
- y,
- widget->allocation.width -
- widget->style->klass->xthickness * 2,
- block_delta);
+ y -= block_delta;
+
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ widget->style->klass->xthickness,
+ y,
+ widget->allocation.width -
+ widget->style->klass->xthickness * 2,
+ block_delta);
}
}
break;
-
+
case GTK_PROGRESS_TOP_TO_BOTTOM:
-
+
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
- {
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- widget->style->klass->xthickness,
- widget->style->klass->ythickness,
- widget->allocation.width -
- widget->style->klass->xthickness * 2,
- amount);
- }
+ {
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ widget->style->klass->xthickness,
+ widget->style->klass->ythickness,
+ widget->allocation.width -
+ widget->style->klass->xthickness * 2,
+ amount);
+ }
else
{
y = widget->style->klass->ythickness;
-
+
for (i = 0; i <= pbar->in_block; i++)
{
-
+
block_delta = (((i + 1) * space) / pbar->blocks)
- ((i * space) / pbar->blocks);
-
- gtk_paint_box (widget->style,
- progress->offscreen_pixmap,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL, widget, "bar",
- widget->style->klass->xthickness,
- y,
- widget->allocation.width -
- widget->style->klass->xthickness * 2,
- block_delta);
-
+
+ gtk_paint_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
+ NULL, widget, "bar",
+ widget->style->klass->xthickness,
+ y,
+ widget->allocation.width -
+ widget->style->klass->xthickness * 2,
+ block_delta);
+
y += block_delta;
}
}
break;
-
+
default:
break;
}
}
-
+
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
gint x;