private void SetMouseActionArea() { Rectangle glass_bounds = glass.Bounds(); action_area = background; // expand action area to include bounds area action_area.Y = glass_bounds.Y; action_area.Height = glass_bounds.Height; // resize event window to match new action area if (event_window != null) { event_window.MoveResize(action_area.X, action_area.Y, action_area.Width, action_area.Height); } }
protected override void OnSizeAllocated(Gdk.Rectangle alloc) { base.OnSizeAllocated(alloc); int legend_height = LegendHeight(); Gdk.Rectangle bar = new Rectangle(alloc.X + border, alloc.Y + border, alloc.Width - 2 * border, alloc.Height - 2 * border - glass.handle_height); if (left.Allocation.Y != bar.Y || left.Allocation.X != bar.X) { left.SetSizeRequest(-1, bar.Height); this.Move(left, bar.X - Allocation.X, bar.Y - Allocation.Y); } if (right.Allocation.Y != bar.Y || right.Allocation.X != bar.X + bar.Width - right.Allocation.Width) { right.SetSizeRequest(-1, bar.Height); this.Move(right, bar.X - Allocation.X + bar.Width - right.Allocation.Width, bar.Y - Allocation.Y); } background = new Rectangle(bar.X + left.Allocation.Width, bar.Y, bar.Width - left.Allocation.Width - right.Allocation.Width, bar.Height); legend = new Rectangle(background.X, background.Y, background.Width, legend_height); action = background.Union(glass.Bounds()); if (event_window != null) { event_window.MoveResize(action.X, action.Y, action.Width, action.Height); } this.Offset = this.Offset; UpdateButtons(); }