mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 23:24:16 +00:00
GtkProgressBar: implement clipping
This allows progress bars to have shadows. https://bugzilla.gnome.org/show_bug.cgi?id=733361
This commit is contained in:
parent
17ad36bf8b
commit
c2907b8532
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "gtkprogressbar.h"
|
#include "gtkprogressbar.h"
|
||||||
#include "gtkorientableprivate.h"
|
#include "gtkorientableprivate.h"
|
||||||
|
#include "gtkwidgetprivate.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
@ -111,6 +112,8 @@ static void gtk_progress_bar_get_property (GObject *object,
|
|||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
static void gtk_progress_bar_size_allocate (GtkWidget *widget,
|
||||||
|
GtkAllocation *allocation);
|
||||||
static void gtk_progress_bar_get_preferred_width (GtkWidget *widget,
|
static void gtk_progress_bar_get_preferred_width (GtkWidget *widget,
|
||||||
gint *minimum,
|
gint *minimum,
|
||||||
gint *natural);
|
gint *natural);
|
||||||
@ -144,6 +147,7 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
|
|||||||
gobject_class->finalize = gtk_progress_bar_finalize;
|
gobject_class->finalize = gtk_progress_bar_finalize;
|
||||||
|
|
||||||
widget_class->draw = gtk_progress_bar_draw;
|
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_width = gtk_progress_bar_get_preferred_width;
|
||||||
widget_class->get_preferred_height = gtk_progress_bar_get_preferred_height;
|
widget_class->get_preferred_height = gtk_progress_bar_get_preferred_height;
|
||||||
|
|
||||||
@ -439,6 +443,15 @@ get_current_text (GtkProgressBar *pbar)
|
|||||||
return g_strdup_printf ("%.0f %%", priv->fraction * 100.0);
|
return g_strdup_printf ("%.0f %%", priv->fraction * 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
static void
|
||||||
gtk_progress_bar_get_preferred_width (GtkWidget *widget,
|
gtk_progress_bar_get_preferred_width (GtkWidget *widget,
|
||||||
gint *minimum,
|
gint *minimum,
|
||||||
|
Loading…
Reference in New Issue
Block a user