Example #1
0
        void DrawSeparators(Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, bool invalidateOnly, bool drawChildrenSep, List <Gdk.Rectangle> areasList)
        {
            if (type == DockGroupType.Tabbed || VisibleObjects.Count == 0)
            {
                return;
            }

            DockObject last = VisibleObjects [VisibleObjects.Count - 1];

            bool horiz = type == DockGroupType.Horizontal;
            int  x     = Allocation.X;
            int  y     = Allocation.Y;
            int  hw    = horiz ? Frame.HandleSize : Allocation.Width;
            int  hh    = horiz ? Allocation.Height : Frame.HandleSize;

            Gtk.Orientation or = horiz ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal;

            for (int n = 0; n < VisibleObjects.Count; n++)
            {
                DockObject ob  = VisibleObjects [n];
                DockGroup  grp = ob as DockGroup;
                if (grp != null && drawChildrenSep)
                {
                    grp.DrawSeparators(exposedArea, currentHandleGrp, currentHandleIndex, invalidateOnly, areasList);
                }
                if (ob != last)
                {
                    if (horiz)
                    {
                        x += ob.Allocation.Width + Frame.HandlePadding;
                    }
                    else
                    {
                        y += ob.Allocation.Height + Frame.HandlePadding;
                    }

                    if (areasList != null)
                    {
                        if (Frame.ShadedSeparators)
                        {
                            areasList.Add(new Gdk.Rectangle(x, y, hw, hh));
                        }
                    }
                    else if (invalidateOnly)
                    {
                        Frame.Container.QueueDrawArea(x, y, hw, hh);
                    }
                    else
                    {
                        if (Frame.ShadedSeparators)
                        {
                            Frame.ShadedContainer.DrawBackground(Frame.Container, new Gdk.Rectangle(x, y, hw, hh));
                        }
                        else
                        {
                            StateType state = (currentHandleGrp == this && currentHandleIndex == n) ? StateType.Prelight : StateType.Normal;
                            if (!DockFrame.IsWindows)
                            {
                                Gtk.Style.PaintHandle(Frame.Style, Frame.Container.GdkWindow, state, ShadowType.None, exposedArea, Frame, "paned", x, y, hw, hh, or);
                            }
                        }
                    }

                    if (horiz)
                    {
                        x += Frame.HandleSize + Frame.HandlePadding;
                    }
                    else
                    {
                        y += Frame.HandleSize + Frame.HandlePadding;
                    }
                }
            }
        }