diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-07-18 16:31:17 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-07-18 16:32:46 -0400 |
commit | c2907b8532698d8a60bcecb80c6084b9711a55a9 (patch) | |
tree | 18921a61dc4653ae80e415fe3605002e824e8f73 | |
parent | 17ad36bf8b7037eb28a97cf6b477c3aa6762cbe9 (diff) | |
download | gtk+-c2907b8532698d8a60bcecb80c6084b9711a55a9.tar.gz |
GtkProgressBar: implement clipping
This allows progress bars to have shadows.
https://bugzilla.gnome.org/show_bug.cgi?id=733361
-rw-r--r-- | gtk/gtkprogressbar.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index e191012fa2..9291982d34 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -28,6 +28,7 @@ #include "gtkprogressbar.h" #include "gtkorientableprivate.h" +#include "gtkwidgetprivate.h" #include "gtkprivate.h" #include "gtkintl.h" @@ -111,6 +112,8 @@ static void gtk_progress_bar_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gtk_progress_bar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); static void gtk_progress_bar_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural); @@ -144,6 +147,7 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class) gobject_class->finalize = gtk_progress_bar_finalize; widget_class->draw = gtk_progress_bar_draw; + widget_class->size_allocate = gtk_progress_bar_size_allocate; widget_class->get_preferred_width = gtk_progress_bar_get_preferred_width; widget_class->get_preferred_height = gtk_progress_bar_get_preferred_height; @@ -440,6 +444,15 @@ get_current_text (GtkProgressBar *pbar) } static void +gtk_progress_bar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) +{ + GTK_WIDGET_CLASS (gtk_progress_bar_parent_class)->size_allocate (widget, allocation); + + _gtk_widget_set_simple_clip (widget); +} + +static void gtk_progress_bar_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) |