- view_allocation->width = MAX (1, allocation.width - view_allocation->x * 2 - border_width * 2);
- view_allocation->height = MAX (1, allocation.height - view_allocation->y * 2 - border_width * 2);
+ view_allocation->x += padding.left;
+ view_allocation->y += padding.top;
+ view_allocation->width = MAX (1, allocation.width - padding.left - padding.right - border_width * 2);
+ view_allocation->height = MAX (1, allocation.height - padding.top - padding.bottom - border_width * 2);
+
+ if (priv->shadow_type != GTK_SHADOW_NONE)
+ {
+ view_allocation->width = MAX (1, view_allocation->width - border.left - border.right);
+ view_allocation->height = MAX (1, view_allocation->height - border.top - border.bottom);
+ }