Exemple #1
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;

            tracker                 = new MouseTracker(this);
            tracker.TrackMotion     = false;
            tracker.HoveredChanged += (sender, e) => {
                if (crossfade == null)
                {
                    return;
                }

                AnimateHover(tracker.Hovered);
                if (tracker.Hovered)
                {
                    crossfade.ShowSecondary();
                }
                else
                {
                    crossfade.ShowPrimary();
                }
            };

            Styles.Changed += UpdateStyle;
        }
Exemple #2
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);
        }
Exemple #3
0
        public DockFrame()
        {
            Mono.TextEditor.GtkWorkarounds.FixContainerLeak(this);

            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();
        }
Exemple #4
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 ();
        }
Exemple #5
0
		public DockFrame ()
		{
			GtkWorkarounds.FixContainerLeak (this);

			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;
			UpdateDockbarsVisibility ();

			DefaultVisualStyle = new DockVisualStyle ();
		}
Exemple #6
0
        public DockFrame()
        {
            GtkWorkarounds.FixContainerLeak(this);

            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;
            UpdateDockbarsVisibility();

            DefaultVisualStyle = new DockVisualStyle();
        }
Exemple #7
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 ();
		}
Exemple #8
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;
		}
Exemple #9
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;
 }
Exemple #10
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));
 }
Exemple #11
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, w, h;

            if (bar == dockBarLeft || bar == dockBarRight)
            {
                h = Allocation.Height - sTop.Height - sBot.Height;
                w = size;
                y = sTop.Height;
                if (bar == dockBarLeft)
                {
                    x = sLeft.Width;
                }
                else
                {
                    x = Allocation.Width - size - sRgt.Width;
                }
            }
            else
            {
                w = Allocation.Width - sLeft.Width - sRgt.Width;
                h = size;
                x = sLeft.Width;
                if (bar == dockBarTop)
                {
                    y = sTop.Height;
                }
                else
                {
                    y = Allocation.Height - size - sBot.Height;
                }
            }

            AddTopLevel(aframe, x, y, w, h);
            aframe.AnimateShow();

            return(aframe);
        }
Exemple #12
0
        public DockBarItem(DockBar bar, DockItem it, int size)
        {
            var actionHandler = new ActionDelegate(this);

            actionHandler.PerformPress += OnPerformPress;

            Events        = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
            this.size     = size;
            this.bar      = bar;
            this.it       = it;
            CanFocus      = true;
            VisibleWindow = false;
            UpdateTab();
            lastFrameSize            = bar.Frame.Allocation.Size;
            bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated;

            tracker                 = new MouseTracker(this);
            tracker.TrackMotion     = false;
            tracker.HoveredChanged += (sender, e) => {
                if (crossfade == null)
                {
                    return;
                }

                AnimateHover(tracker.Hovered);
                if (tracker.Hovered)
                {
                    crossfade.ShowSecondary();
                }
                else
                {
                    crossfade.ShowPrimary();
                }
            };

            Styles.Changed += UpdateStyle;

            Accessible.Name = "DockbarItem";
            Accessible.Role = Atk.Role.PushButton;
        }
Exemple #13
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;
                }
            }
        }
Exemple #14
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;
			}
		}
Exemple #15
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,w,h;
			if (bar == dockBarLeft || bar == dockBarRight) {
				h = Allocation.Height - sTop.Height - sBot.Height;
				w = size;
				y = sTop.Height;
				if (bar == dockBarLeft)
					x = sLeft.Width;
				else
					x = Allocation.Width - size - sRgt.Width;
			} else {
				w = Allocation.Width - sLeft.Width - sRgt.Width;
				h = size;
				x = sLeft.Width;
				if (bar == dockBarTop)
					y = sTop.Height;
				else
					y = Allocation.Height - size - sBot.Height;
			}

			AddTopLevel (aframe, x, y, w, h);
			aframe.AnimateShow ();

			return aframe;
		}
Exemple #16
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;
		}
Exemple #17
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);
		}
Exemple #18
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;

			tracker = new MouseTracker (this);
			tracker.TrackMotion = false;
			tracker.HoveredChanged += (sender, e) => {

				if (crossfade == null)
					return;
	
				AnimateHover (tracker.Hovered);
				if (tracker.Hovered)
					crossfade.ShowSecondary ();
				else
					crossfade.ShowPrimary ();
			};

			Styles.Changed += UpdateStyle;
		}