25 #include <glib/gi18n.h>
44 gtk_container_set_border_width (GTK_CONTAINER (message), 10);
46 message->spinner = gtk_spinner_new ();
47 gtk_box_pack_start (GTK_BOX (message), message->spinner,
FALSE,
FALSE, 0);
48 gtk_widget_show (message->spinner);
50 label = gtk_label_new (
_(
"Loading…"));
51 gtk_box_pack_start (GTK_BOX (message), label,
FALSE,
FALSE, 0);
52 gtk_widget_show (label);
59 GtkStyleContext *context;
62 context = gtk_widget_get_style_context (widget);
63 state = gtk_style_context_get_state (context);
64 gtk_style_context_get_padding (context, state, padding);
69 GtkAllocation *allocation)
71 GtkAllocation child_allocation;
75 child_allocation.y = allocation->x + padding.left;
76 child_allocation.x = allocation->y + padding.top;
77 child_allocation.width = MAX (1, allocation->width - (padding.left + padding.right));
78 child_allocation.height = MAX (1, allocation->height - (padding.top + padding.bottom));
80 GTK_WIDGET_CLASS (ev_loading_message_parent_class)->size_allocate (widget, &child_allocation);
81 gtk_widget_set_allocation (widget, allocation);
91 GTK_WIDGET_CLASS (ev_loading_message_parent_class)->get_preferred_width (widget, minimum_size, natural_size);
94 *minimum_size += padding.left + padding.right;
95 *natural_size += padding.left + padding.right;
105 GTK_WIDGET_CLASS (ev_loading_message_parent_class)->get_preferred_height (widget, minimum_size, natural_size);
108 *minimum_size += padding.top + padding.bottom;
109 *natural_size += padding.top + padding.bottom;
116 GtkStyleContext *context;
119 context = gtk_widget_get_style_context (widget);
120 width = gtk_widget_get_allocated_width (widget);
121 height = gtk_widget_get_allocated_height (widget);
123 gtk_render_background (context, cr, 0, 0, width, height);
124 gtk_render_frame (context, cr, 0, 0, width, height);
126 GTK_WIDGET_CLASS (ev_loading_message_parent_class)->draw (widget, cr);
136 gtk_spinner_stop (GTK_SPINNER (message->spinner));
138 GTK_WIDGET_CLASS (ev_loading_message_parent_class)->hide (widget);
146 gtk_spinner_start (GTK_SPINNER (message->spinner));
148 GTK_WIDGET_CLASS (ev_loading_message_parent_class)->show (widget);
154 GtkWidgetClass *gtk_widget_class = GTK_WIDGET_CLASS (klass);
171 "orientation", GTK_ORIENTATION_HORIZONTAL,