128
128
cairo.Arc (x+radius, y+radius, radius, Math.PI, (Math.PI*1.5));
132
protected virtual void GetBorderFrame (Cairo.Context cairo)
134
/* Override coordinates to align to the cairo grid */
135
double X, Y, Width, Height;
136
X = x + cairo.LineWidth/2.0;
137
Y = y + cairo.LineWidth/2.0;
138
Width = width - cairo.LineWidth;
139
Height = height - cairo.LineWidth;
144
cairo.Rectangle (X, Y, Width, Height);
146
cairo.MoveTo (X+radius, Y);
147
cairo.Arc (X+Width-radius, Y+radius, radius, (Math.PI*1.5), (Math.PI*2));
148
cairo.Arc (X+Width-radius, Y+Height-radius, radius, 0, (Math.PI*0.5));
149
cairo.Arc (X+radius, Y+Height-radius, radius, (Math.PI*0.5), Math.PI);
150
cairo.Arc (X+radius, Y+radius, radius, Math.PI, (Math.PI*1.5));
132
154
protected virtual void Paint (Gdk.Rectangle area)
134
156
if (!IsDrawable) {
142
// Why thickness?? Isn't it useless?
143
x = childAlloc.X + Style.XThickness;
144
y = childAlloc.Y + Style.YThickness;
164
/* You shouldn't change the size of the drawing area
165
* to avoid glitches when switching panes, though
166
* you can enlarge the big frame.
167
* This workaround is enlarging only the frame which has
168
* radius == 0, so when the window is not composited.
169
* Pretty ugly, I should think on something better.
171
* int offset = radius == 0 ? 1 : 0;
173
* x = childAlloc.X - offset;
174
* y = childAlloc.Y - offset;
175
* width = childAlloc.Width + offset * 2;
176
* height = childAlloc.Height + offset * 2;
148
width = childAlloc.Width - 2 * Style.XThickness;
149
height = childAlloc.Height - 2 * Style.Ythickness;
181
width = childAlloc.Width;
182
height = childAlloc.Height;
151
184
if (this.radius < 0.0) {
152
185
radius = Math.Min (width, height);
232
264
requisition.Width = Math.Max (requisition.Width, cr.Width);
233
265
requisition.Height += cr.Height;
235
requisition.Width += (int)(BorderWidth + Style.XThickness * 2);
236
requisition.Height += (int)(BorderWidth + Style.Ythickness * 2);
267
requisition.Width += (int)(BorderWidth + 2);
268
requisition.Height += (int)(BorderWidth + 2);
239
271
protected override void OnSizeAllocated (Rectangle allocation)
241
273
Rectangle new_alloc;
243
new_alloc.X = (int) BorderWidth + Style.XThickness;
275
new_alloc.X = (int) BorderWidth + 1;
244
276
new_alloc.Width = Math.Max (1, allocation.Width - new_alloc.X * 2);
245
new_alloc.Y = (int) BorderWidth + Style.Ythickness;
246
new_alloc.Height = Math.Max (1, allocation.Height
277
new_alloc.Y = (int) BorderWidth + 1;
278
new_alloc.Height = Math.Max (1, allocation.Height - new_alloc.Y * 2);
250
279
new_alloc.X += allocation.X;
251
280
new_alloc.Y += allocation.Y;
252
281
if (IsMapped && new_alloc != childAlloc) {