59
uint startPadding = 6;
60
switch (Frame.CompactGuiLevel) {
61
case 1: sizePadding = 2; break;
62
case 4: startPadding = 3; break;
63
case 5: startPadding = 0; sizePadding = 0; break;
67
case PositionType.Top: al.BottomPadding = sizePadding; al.LeftPadding = al.RightPadding = startPadding; break;
68
case PositionType.Bottom: al.TopPadding = sizePadding; al.LeftPadding = al.RightPadding = startPadding; break;
69
case PositionType.Left: al.RightPadding = sizePadding; al.TopPadding = al.BottomPadding = startPadding; break;
70
case PositionType.Right: al.LeftPadding = sizePadding; al.TopPadding = al.BottomPadding = startPadding; break;
107
DateTime hoverActivationDelay;
109
void DisableHoverActivation ()
111
// Temporarily disables hover activation of items in this bar
112
// Useful to avoid accidental triggers when the bar items
114
hoverActivationDelay = DateTime.Now + TimeSpan.FromSeconds (1.5);
117
internal bool HoverActivationEnabled {
118
get { return DateTime.Now >= hoverActivationDelay; }
116
121
internal DockBarItem AddItem (DockItem item, int size)
123
DisableHoverActivation ();
118
124
DockBarItem it = new DockBarItem (this, item, size);
119
125
box.PackStart (it, false, false, 0);
177
internal void UpdateStyle (DockItem item)
181
protected override void OnSizeRequested (ref Requisition requisition)
183
base.OnSizeRequested (ref requisition);
186
// Add space for the separator
187
if (Orientation == Gtk.Orientation.Vertical)
190
requisition.Height++;
194
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
196
base.OnSizeAllocated (allocation);
197
if (ShowBorder && Child != null) {
199
case PositionType.Left: allocation.Width--; break;
200
case PositionType.Right: allocation.X++; allocation.Width--; break;
201
case PositionType.Top: allocation.Height--; break;
202
case PositionType.Bottom: allocation.Y++; allocation.Height--; break;
204
Child.SizeAllocate (allocation);
169
208
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
171
frame.ShadedContainer.DrawBackground (this);
172
return base.OnExposeEvent (evnt);
210
var alloc = Allocation;
211
using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
212
ctx.Rectangle (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y + alloc.Height);
213
Cairo.LinearGradient gr;
214
if (Orientation == Gtk.Orientation.Vertical)
215
gr = new Cairo.LinearGradient (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y);
217
gr = new Cairo.LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height);
219
gr.AddColorStop (0, Styles.DockBarBackground1);
220
gr.AddColorStop (1, Styles.DockBarBackground2);
226
double offs = ShowBorder ? 1.5 : 0.5;
228
case PositionType.Left:ctx.MoveTo (alloc.X + alloc.Width - offs, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break;
229
case PositionType.Right: ctx.MoveTo (alloc.X + offs, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break;
230
case PositionType.Top: ctx.MoveTo (alloc.X, alloc.Y + alloc.Height - offs); ctx.RelLineTo (Allocation.Width, 0); break;
231
case PositionType.Bottom: ctx.MoveTo (alloc.X, alloc.Y + offs); ctx.RelLineTo (Allocation.Width, 0); break;
234
ctx.Color = Styles.DockBarSeparatorColorLight;
239
PropagateExpose (Child, evnt);
242
using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
247
case PositionType.Left:ctx.MoveTo (alloc.X + alloc.Width - 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break;
248
case PositionType.Right: ctx.MoveTo (alloc.X + 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break;
249
case PositionType.Top: ctx.MoveTo (alloc.X, alloc.Y + alloc.Height + 0.5); ctx.RelLineTo (Allocation.Width, 0); break;
250
case PositionType.Bottom: ctx.MoveTo (alloc.X, alloc.Y + 0.5); ctx.RelLineTo (Allocation.Width, 0); break;
252
ctx.Color = Styles.DockSeparatorColor.ToCairoColor ();