diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-10-21 11:40:46 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-10-21 11:40:46 +0200 |
commit | f4d57dbe98bf92ee03f015230c8252f38a50caf8 (patch) | |
tree | 671d1a36cb09ce7453ca6c8c1c78a58c32a8ca77 /gtk/gtkprogressbar.c | |
parent | 0a3fa74a5235dd2e559bbe659e021feaf326f560 (diff) | |
download | gtk+-f4d57dbe98bf92ee03f015230c8252f38a50caf8.tar.gz |
Make GtkProgressBar a no-window widget
It doesn't really have a good reason for having a window.
Diffstat (limited to 'gtk/gtkprogressbar.c')
-rw-r--r-- | gtk/gtkprogressbar.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index a0fe787524..4131efc122 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -84,8 +84,6 @@ static void gtk_progress_bar_get_property (GObject *object, GParamSpec *pspec); static void gtk_progress_bar_size_request (GtkWidget *widget, GtkRequisition *requisition); -static void gtk_progress_bar_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); static void gtk_progress_bar_real_update (GtkProgressBar *progress); static gboolean gtk_progress_bar_draw (GtkWidget *widget, cairo_t *cr); @@ -111,10 +109,8 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class) gobject_class->get_property = gtk_progress_bar_get_property; gobject_class->finalize = gtk_progress_bar_finalize; - widget_class->realize = gtk_progress_bar_realize; widget_class->draw = gtk_progress_bar_draw; widget_class->size_request = gtk_progress_bar_size_request; - widget_class->size_allocate = gtk_progress_bar_size_allocate; g_object_class_override_property (gobject_class, PROP_ORIENTATION, @@ -276,39 +272,8 @@ gtk_progress_bar_init (GtkProgressBar *pbar) priv->text = NULL; priv->fraction = 0.0; -} -static void -gtk_progress_bar_realize (GtkWidget *widget) -{ - GtkAllocation allocation; - GdkWindow *window; - GdkWindowAttr attributes; - gint attributes_mask; - - gtk_widget_set_realized (widget, TRUE); - - gtk_widget_get_allocation (widget, &allocation); - - attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = allocation.x; - attributes.y = allocation.y; - attributes.width = allocation.width; - attributes.height = allocation.height; - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.event_mask = gtk_widget_get_events (widget); - attributes.event_mask |= GDK_EXPOSURE_MASK; - - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; - window = gdk_window_new (gtk_widget_get_parent_window (widget), - &attributes, attributes_mask); - gtk_widget_set_window (widget, window); - gdk_window_set_user_data (window, widget); - - gtk_widget_style_attach (widget); - gtk_style_set_background (gtk_widget_get_style (widget), - window, GTK_STATE_ACTIVE); + gtk_widget_set_has_window (GTK_WIDGET (pbar), FALSE); } static void @@ -573,18 +538,6 @@ gtk_progress_bar_size_request (GtkWidget *widget, } static void -gtk_progress_bar_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - gtk_widget_set_allocation (widget, allocation); - - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (gtk_widget_get_window (widget), - allocation->x, allocation->y, - allocation->width, allocation->height); -} - -static void gtk_progress_bar_act_mode_enter (GtkProgressBar *pbar) { GtkProgressBarPrivate *priv = pbar->priv; |