protected override void OnSizeAllocated(Gdk.Rectangle allocation) { base.OnSizeAllocated(allocation); allocation.X += (int)BorderWidth; allocation.Y += (int)BorderWidth; allocation.Width -= 2 * (int)BorderWidth; allocation.Height -= 2 * (int)BorderWidth; Gdk.Rectangle btnAlloc; btnAlloc.Width = btnWidth; btnAlloc.X = allocation.X + allocation.Width - btnAlloc.Width + 1; btnAlloc.Y = allocation.Y; btnAlloc.Height = upReq.Height; up.SizeAllocate(btnAlloc); btnAlloc.Y += btnAlloc.Height; btnAlloc.Height = downReq.Height; down.SizeAllocate(btnAlloc); btnAlloc.Y += btnAlloc.Height; btnAlloc.Height = expandReq.Height; expand.SizeAllocate(btnAlloc); tilesAlloc.X = allocation.X + (int)lineWidth + tileSpacing; tilesAlloc.Y = allocation.Y + (int)lineWidth + tileSpacing; tilesAlloc.Width = btnAlloc.X - tilesAlloc.X - tileSpacing - (int)space - 2 * (int)lineWidth; tilesAlloc.Height = allocation.Height - 2 * (tileSpacing + (int)lineWidth); UpdateTilesLayout(); }
protected override void OnSizeAllocated(Gdk.Rectangle allocation) { base.OnSizeAllocated(allocation); if (expandButton != null && expandButton.Visible) { double frameSize = 2 * lineWidth + space; Gdk.Rectangle r; r.Height = expandButton.HeightRequest; r.Width = expandButton.WidthRequest; r.X = allocation.X + allocation.Width - r.Width - (int)frameSize; r.Y = allocation.Y + allocation.Height - r.Height - (int)frameSize; expandButton.SizeAllocate(r); } if (Child != null && Child.Visible) { double frameSize = 2 * lineWidth + childPadding; int wi = allocation.Width - (int)(2 * frameSize); int he = allocation.Height - (int)(2 * frameSize + barHeight); Gdk.Rectangle r = new Gdk.Rectangle(allocation.X + (int)frameSize, allocation.Y + (int)frameSize, wi, he); Child.SizeAllocate(r); } }