コード例 #1
0
        public DockFrame()
        {
            shadedContainer = new ShadedContainer();

            dockBarTop    = new DockBar(this, Gtk.PositionType.Top);
            dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom);
            dockBarLeft   = new DockBar(this, Gtk.PositionType.Left);
            dockBarRight  = new DockBar(this, Gtk.PositionType.Right);

            container = new DockContainer(this);
            HBox hbox = new HBox();

            hbox.PackStart(dockBarLeft, false, false, 0);
            hbox.PackStart(container, true, true, 0);
            hbox.PackStart(dockBarRight, false, false, 0);
            mainBox = new VBox();
            mainBox.PackStart(dockBarTop, false, false, 0);
            mainBox.PackStart(hbox, true, true, 0);
            mainBox.PackStart(dockBarBottom, false, false, 0);
            Add(mainBox);
            mainBox.ShowAll();
            mainBox.NoShowAll = true;
            CompactGuiLevel   = 2;
            dockBarTop.UpdateVisibility();
            dockBarBottom.UpdateVisibility();
            dockBarLeft.UpdateVisibility();
            dockBarRight.UpdateVisibility();
        }
コード例 #2
0
 public DockBarItem(DockBar bar, DockItem it, int size)
 {
     Events        = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
     this.size     = size;
     this.bar      = bar;
     this.it       = it;
     VisibleWindow = false;
     UpdateTab();
     lastFrameSize            = bar.Frame.Allocation.Size;
     bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated;
 }
コード例 #3
0
 Gdk.Size GetBarFrameSize(DockBar bar)
 {
     if (bar.OriginalBar != null)
     {
         bar = bar.OriginalBar;
     }
     if (!bar.Visible)
     {
         return(new Gdk.Size(0, 0));
     }
     Gtk.Requisition req = bar.SizeRequest();
     return(new Gdk.Size(req.Width, req.Height));
 }
コード例 #4
0
        public DockBar ExtractDockBar(PositionType pos)
        {
            DockBar db = new DockBar(this, pos);

            switch (pos)
            {
            case PositionType.Left: db.OriginalBar = dockBarLeft; dockBarLeft = db; break;

            case PositionType.Top: db.OriginalBar = dockBarTop; dockBarTop = db; break;

            case PositionType.Right: db.OriginalBar = dockBarRight; dockBarRight = db; break;

            case PositionType.Bottom: db.OriginalBar = dockBarBottom; dockBarBottom = db; break;
            }
            return(db);
        }
コード例 #5
0
        internal AutoHideBox AutoShow(DockItem item, DockBar bar, int size)
        {
            AutoHideBox aframe = new AutoHideBox(this, item, bar.Position, size);

            Gdk.Size sTop  = GetBarFrameSize(dockBarTop);
            Gdk.Size sBot  = GetBarFrameSize(dockBarBottom);
            Gdk.Size sLeft = GetBarFrameSize(dockBarLeft);
            Gdk.Size sRgt  = GetBarFrameSize(dockBarRight);

            int x, y;

            if (bar == dockBarLeft || bar == dockBarRight)
            {
                aframe.HeightRequest = Allocation.Height - sTop.Height - sBot.Height;
                aframe.WidthRequest  = size;
                y = sTop.Height;
                if (bar == dockBarLeft)
                {
                    x = sLeft.Width;
                }
                else
                {
                    x = Allocation.Width - size - sRgt.Width;
                }
            }
            else
            {
                aframe.WidthRequest  = Allocation.Width - sLeft.Width - sRgt.Width;
                aframe.HeightRequest = size;
                x = sLeft.Width;
                if (bar == dockBarTop)
                {
                    y = sTop.Height;
                }
                else
                {
                    y = Allocation.Height - size - sBot.Height;
                }
            }
            AddTopLevel(aframe, x, y);
            aframe.AnimateShow();
            return(aframe);
        }
コード例 #6
0
        internal void UpdateSize(DockBar bar, AutoHideBox aframe)
        {
            Gdk.Size sTop  = GetBarFrameSize(dockBarTop);
            Gdk.Size sBot  = GetBarFrameSize(dockBarBottom);
            Gdk.Size sLeft = GetBarFrameSize(dockBarLeft);
            Gdk.Size sRgt  = GetBarFrameSize(dockBarRight);

            if (bar == dockBarLeft || bar == dockBarRight)
            {
                aframe.HeightRequest = Allocation.Height - sTop.Height - sBot.Height;
                if (bar == dockBarRight)
                {
                    aframe.X = Allocation.Width - aframe.Allocation.Width - sRgt.Width;
                }
            }
            else
            {
                aframe.WidthRequest = Allocation.Width - sLeft.Width - sRgt.Width;
                if (bar == dockBarBottom)
                {
                    aframe.Y = Allocation.Height - aframe.Allocation.Height - sBot.Height;
                }
            }
        }