Beispiel #1
0
        protected override void DoSync()
        {
            DND.ClearFaults(this);
            Gtk.Orientation faultOrientation =
                Orientation == Gtk.Orientation.Horizontal ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal;
            Gdk.Rectangle tbAlloc = toolbar.Allocation;

            Gtk.Widget[] children = toolbar.Children;
            if (children.Length == 0)
            {
                DND.AddFault(this, 0, faultOrientation, tbAlloc);
                return;
            }

            if (faultOrientation == Gtk.Orientation.Horizontal)
            {
                DND.AddHFault(this, 0, null, children[0]);
                DND.AddHFault(this, children.Length, children[children.Length - 1], null);
            }
            else
            {
                DND.AddVFault(this, 0, null, children[0]);
                DND.AddVFault(this, children.Length, children[children.Length - 1], null);
            }

            for (int i = 1; i < children.Length; i++)
            {
                if (faultOrientation == Gtk.Orientation.Horizontal)
                {
                    DND.AddHFault(this, i, children[i - 1], children[i]);
                }
                else
                {
                    DND.AddVFault(this, i, children[i - 1], children[i]);
                }
            }
        }