static void SetMode() { H.Clear(); Event.Clear(); if (activeBorderGraphic.HasValue) { G.Close(activeBorderGraphic.Value); activeBorderGraphic = null; } switch (mode) { case Mode.General: { ModeSwitcher(); VirtualDesktop(); WindowArrangement(); WindowFocus(); WindowBorder(); ShiftParentheses(); TabAlt(); CapsControl(); ViKeys(); Terminal(); Launcher(); break; } case Mode.Game: { ModeSwitcher(); VirtualDesktop(); Launcher(); break; } } }
static void WindowBorder() { var o = BORDER_OFFSET + BORDER_SIZE / 2; activeBorderGraphic = G.New(c => { var a = W.Active(); if (!a.isValid) { return; } if (BORDER_IGNORE_TITLES.Contains(W.Title(a))) { return; } G.Rect(c, BORDER_COLOR, BORDER_SIZE, a.x - o, a.y - o, a.w + 2 * o, a.h + 2 * o); }); Event.onFocus += w => G.Redraw(activeBorderGraphic.Value); Event.onMove += w => G.Redraw(activeBorderGraphic.Value); }