예제 #1
0
파일: DockFrame.cs 프로젝트: ywscr/Pinta
        internal void AutoHide(DockItem item, AutoHideBox widget, bool animate)
        {
            if (animate)
            {
                widget.Hidden += delegate {
                    if (!widget.Disposed)
                    {
                        AutoHide(item, widget, false);
                    }
                };
                widget.AnimateHide();
            }
            else
            {
                // The widget may already be removed from the parent
                // so 'parent' can be null
                Gtk.Container parent = (Gtk.Container)item.Widget.Parent;
                if (parent != null)
                {
                    //removing the widget from its parent causes it to unrealize without unmapping
                    //so make sure it's unmapped
                    if (item.Widget.IsMapped)
                    {
                        item.Widget.Unmap();
                    }
                    parent.Remove(item.Widget);
                }
                parent = (Gtk.Container)item.TitleTab.Parent;
                if (parent != null)
                {
                    //removing the widget from its parent causes it to unrealize without unmapping
                    //so make sure it's unmapped
                    if (item.TitleTab.IsMapped)
                    {
                        item.TitleTab.Unmap();
                    }
                    parent.Remove(item.TitleTab);
                }
                if (widget.ContainerWindow != null)
                {
                    widget.ContainerWindow.Destroy();
                }
                else
                {
                    RemoveTopLevel(widget);
                }

                widget.Disposed = true;
                widget.Destroy();
            }
        }
예제 #2
0
 void AutoShow()
 {
     UnscheduleAutoHide();
     if (autoShowFrame == null && !bar.Frame.OverlayWidgetVisible)
     {
         if (hiddenFrame != null)
         {
             bar.Frame.AutoHide(it, hiddenFrame, false);
         }
         autoShowFrame = bar.Frame.AutoShow(it, bar, size);
         autoShowFrame.EnterNotifyEvent += OnFrameEnter;
         autoShowFrame.LeaveNotifyEvent += OnFrameLeave;
         autoShowFrame.KeyPressEvent    += OnFrameKeyPress;
         QueueDraw();
     }
 }
예제 #3
0
파일: DockFrame.cs 프로젝트: ywscr/Pinta
        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);
        }
예제 #4
0
 void AutoHide(bool animate)
 {
     UnscheduleAutoShow();
     if (autoShowFrame != null)
     {
         size                  = autoShowFrame.PadSize;
         hiddenFrame           = autoShowFrame;
         autoShowFrame.Hidden += delegate {
             hiddenFrame = null;
         };
         bar.Frame.AutoHide(it, autoShowFrame, animate);
         autoShowFrame.EnterNotifyEvent -= OnFrameEnter;
         autoShowFrame.LeaveNotifyEvent -= OnFrameLeave;
         autoShowFrame.KeyPressEvent    -= OnFrameKeyPress;
         autoShowFrame = null;
         QueueDraw();
     }
 }
예제 #5
0
파일: DockFrame.cs 프로젝트: ywscr/Pinta
        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;
                }
            }
        }
예제 #6
0
파일: DockBarItem.cs 프로젝트: msiyer/Pinta
		void AutoHide (bool animate)
		{
			UnscheduleAutoShow ();
			if (autoShowFrame != null) {
				size = autoShowFrame.PadSize;
				hiddenFrame = autoShowFrame;
				autoShowFrame.Hidden += delegate {
					hiddenFrame = null;
				};
				bar.Frame.AutoHide (it, autoShowFrame, animate);
				autoShowFrame.EnterNotifyEvent -= OnFrameEnter;
				autoShowFrame.LeaveNotifyEvent -= OnFrameLeave;
				autoShowFrame.KeyPressEvent -= OnFrameKeyPress;
				autoShowFrame = null;
				QueueDraw ();
			}
		}
예제 #7
0
파일: DockBarItem.cs 프로젝트: msiyer/Pinta
		void AutoShow ()
		{
			UnscheduleAutoHide ();
			if (autoShowFrame == null && !bar.Frame.OverlayWidgetVisible) {
				if (hiddenFrame != null)
					bar.Frame.AutoHide (it, hiddenFrame, false);
				autoShowFrame = bar.Frame.AutoShow (it, bar, size);
				autoShowFrame.EnterNotifyEvent += OnFrameEnter;
				autoShowFrame.LeaveNotifyEvent += OnFrameLeave;
				autoShowFrame.KeyPressEvent += OnFrameKeyPress;
				QueueDraw ();
			}
		}
예제 #8
0
파일: DockFrame.cs 프로젝트: msiyer/Pinta
		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;
			}
		}
예제 #9
0
파일: DockFrame.cs 프로젝트: msiyer/Pinta
		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;
		}
예제 #10
0
파일: DockFrame.cs 프로젝트: msiyer/Pinta
		internal void AutoHide (DockItem item, AutoHideBox widget, bool animate)
		{
			if (animate) {
				widget.Hidden += delegate {
					if (!widget.Disposed)
						AutoHide (item, widget, false);
				};
				widget.AnimateHide ();
			}
			else {
				// The widget may already be removed from the parent
				// so 'parent' can be null
				Gtk.Container parent = (Gtk.Container) item.Widget.Parent;
				if (parent != null) {
					//removing the widget from its parent causes it to unrealize without unmapping
					//so make sure it's unmapped
					if (item.Widget.IsMapped) {
						item.Widget.Unmap ();
					}
					parent.Remove (item.Widget);
				}
				parent = (Gtk.Container) item.TitleTab.Parent;
				if (parent != null) {
					//removing the widget from its parent causes it to unrealize without unmapping
					//so make sure it's unmapped
					if (item.TitleTab.IsMapped) {
						item.TitleTab.Unmap ();
					}
					parent.Remove (item.TitleTab);
				}
				if (widget.ContainerWindow != null) {
					widget.ContainerWindow.Destroy ();
				} else
					RemoveTopLevel (widget);

				widget.Disposed = true;
				widget.Destroy ();
			}
		}