public void SetDropInfo(DropInfo di, Vector2 mouseScreenPos, ContainerWindow inFrontOf)
        {
            if (m_Type != di.type || (di.type == DropInfo.Type.Pane && di.rect != m_TargetRect))
            {
                m_Type = di.type;

                switch (di.type)
                {
                case DropInfo.Type.Window:
                    m_TargetAlpha = 0.6f;
                    break;

                case DropInfo.Type.Pane:
                case DropInfo.Type.Tab:
                    m_TargetAlpha = 1.0f;
                    break;
                }
            }

            switch (di.type)
            {
            case DropInfo.Type.Window:
                m_TargetRect = new Rect(mouseScreenPos.x - m_FullWindowSize.x / 2, mouseScreenPos.y - m_FullWindowSize.y / 2,
                                        m_FullWindowSize.x, m_FullWindowSize.y);
                break;

            case DropInfo.Type.Pane:
            case DropInfo.Type.Tab:
                m_TargetRect = di.rect;
                break;
            }

            m_TabVisible = di.type == DropInfo.Type.Tab;

            m_TargetRect.x      = Mathf.Round(m_TargetRect.x);
            m_TargetRect.y      = Mathf.Round(m_TargetRect.y);
            m_TargetRect.width  = Mathf.Round(m_TargetRect.width);
            m_TargetRect.height = Mathf.Round(m_TargetRect.height);

            m_InFrontOfWindow = inFrontOf;
            m_Window.MoveInFrontOf(m_InFrontOfWindow);

            // On Windows, repainting without setting proper size first results in one garbage frame... For some reason.
            SetWindowPos(m_TargetRect);
            // Yes, repaint.
            Repaint();
        }
Beispiel #2
0
        public void SetDropInfo(DropInfo di, Vector2 mouseScreenPos, ContainerWindow inFrontOf)
        {
            if (this.m_Type != di.type || (di.type == DropInfo.Type.Pane && di.rect != this.m_TargetRect))
            {
                this.m_Type      = di.type;
                this.m_StartRect = this.GetInterpolatedRect(this.CalcFade());
                this.m_StartTime = Time.realtimeSinceStartup;
                switch (di.type)
                {
                case DropInfo.Type.Tab:
                case DropInfo.Type.Pane:
                    this.m_TargetAlpha = 1f;
                    break;

                case DropInfo.Type.Window:
                    this.m_TargetAlpha = 0.6f;
                    break;
                }
            }
            switch (di.type)
            {
            case DropInfo.Type.Tab:
            case DropInfo.Type.Pane:
                this.m_TargetRect = di.rect;
                break;

            case DropInfo.Type.Window:
                this.m_TargetRect = new Rect(mouseScreenPos.x - this.m_ThumbnailSize.x / 2f, mouseScreenPos.y - this.m_ThumbnailSize.y / 2f, this.m_ThumbnailSize.x, this.m_ThumbnailSize.y);
                break;
            }
            this.m_PaneVisible.target = (di.type == DropInfo.Type.Pane);
            this.m_TabVisible.target  = (di.type == DropInfo.Type.Tab);
            this.m_TargetRect.x       = Mathf.Round(this.m_TargetRect.x);
            this.m_TargetRect.y       = Mathf.Round(this.m_TargetRect.y);
            this.m_TargetRect.width   = Mathf.Round(this.m_TargetRect.width);
            this.m_TargetRect.height  = Mathf.Round(this.m_TargetRect.height);
            this.m_InFrontOfWindow    = inFrontOf;
            this.m_Window.MoveInFrontOf(this.m_InFrontOfWindow);
            this.SetWindowPos(this.GetInterpolatedRect(this.CalcFade()));
            base.Repaint();
        }
 public void SetDropInfo(DropInfo di, Vector2 mouseScreenPos, ContainerWindow inFrontOf)
 {
     if (this.m_Type != di.type || (di.type == DropInfo.Type.Pane && di.rect != this.m_TargetRect))
     {
         this.m_Type = di.type;
         DropInfo.Type type = di.type;
         if (type != DropInfo.Type.Window)
         {
             if (type == DropInfo.Type.Pane || type == DropInfo.Type.Tab)
             {
                 this.m_TargetAlpha = 1f;
             }
         }
         else
         {
             this.m_TargetAlpha = 0.6f;
         }
     }
     DropInfo.Type type2 = di.type;
     if (type2 != DropInfo.Type.Window)
     {
         if (type2 == DropInfo.Type.Pane || type2 == DropInfo.Type.Tab)
         {
             this.m_TargetRect = di.rect;
         }
     }
     else
     {
         this.m_TargetRect = new Rect(mouseScreenPos.x - this.m_FullWindowSize.x / 2f, mouseScreenPos.y - this.m_FullWindowSize.y / 2f, this.m_FullWindowSize.x, this.m_FullWindowSize.y);
     }
     this.m_TabVisible        = (di.type == DropInfo.Type.Tab);
     this.m_TargetRect.x      = Mathf.Round(this.m_TargetRect.x);
     this.m_TargetRect.y      = Mathf.Round(this.m_TargetRect.y);
     this.m_TargetRect.width  = Mathf.Round(this.m_TargetRect.width);
     this.m_TargetRect.height = Mathf.Round(this.m_TargetRect.height);
     this.m_InFrontOfWindow   = inFrontOf;
     this.m_Window.MoveInFrontOf(this.m_InFrontOfWindow);
     this.SetWindowPos(this.m_TargetRect);
     base.Repaint();
 }
		public void SetDropInfo(DropInfo di, Vector2 mouseScreenPos, ContainerWindow inFrontOf)
		{
			if (this.m_Type != di.type || (di.type == DropInfo.Type.Pane && di.rect != this.m_TargetRect))
			{
				this.m_Type = di.type;
				this.m_StartRect = this.GetInterpolatedRect(this.CalcFade());
				this.m_StartTime = Time.realtimeSinceStartup;
				switch (di.type)
				{
				case DropInfo.Type.Tab:
				case DropInfo.Type.Pane:
					this.m_TargetAlpha = 1f;
					break;
				case DropInfo.Type.Window:
					this.m_TargetAlpha = 0.6f;
					break;
				}
			}
			switch (di.type)
			{
			case DropInfo.Type.Tab:
			case DropInfo.Type.Pane:
				this.m_TargetRect = di.rect;
				break;
			case DropInfo.Type.Window:
				this.m_TargetRect = new Rect(mouseScreenPos.x - this.m_ThumbnailSize.x / 2f, mouseScreenPos.y - this.m_ThumbnailSize.y / 2f, this.m_ThumbnailSize.x, this.m_ThumbnailSize.y);
				break;
			}
			this.m_PaneVisible.target = (di.type == DropInfo.Type.Pane);
			this.m_TabVisible.target = (di.type == DropInfo.Type.Tab);
			this.m_TargetRect.x = Mathf.Round(this.m_TargetRect.x);
			this.m_TargetRect.y = Mathf.Round(this.m_TargetRect.y);
			this.m_TargetRect.width = Mathf.Round(this.m_TargetRect.width);
			this.m_TargetRect.height = Mathf.Round(this.m_TargetRect.height);
			this.m_InFrontOfWindow = inFrontOf;
			this.m_Window.MoveInFrontOf(this.m_InFrontOfWindow);
			this.SetWindowPos(this.GetInterpolatedRect(this.CalcFade()));
			base.Repaint();
		}
        public void SetDropInfo(DropInfo di, Vector2 mouseScreenPos, ContainerWindow inFrontOf)
        {
            if ((this.m_Type != di.type) || ((di.type == DropInfo.Type.Pane) && (di.rect != this.m_TargetRect)))
            {
                this.m_Type = di.type;
                switch (di.type)
                {
                case DropInfo.Type.Window:
                    this.m_TargetAlpha = 0.6f;
                    break;

                case DropInfo.Type.Pane:
                case DropInfo.Type.Tab:
                    this.m_TargetAlpha = 1f;
                    break;
                }
            }
            switch (di.type)
            {
            case DropInfo.Type.Window:
                this.m_TargetRect = new Rect(mouseScreenPos.x - (this.m_FullWindowSize.x / 2f), mouseScreenPos.y - (this.m_FullWindowSize.y / 2f), this.m_FullWindowSize.x, this.m_FullWindowSize.y);
                break;

            case DropInfo.Type.Pane:
            case DropInfo.Type.Tab:
                this.m_TargetRect = di.rect;
                break;
            }
            this.m_TabVisible        = di.type == DropInfo.Type.Tab;
            this.m_TargetRect.x      = Mathf.Round(this.m_TargetRect.x);
            this.m_TargetRect.y      = Mathf.Round(this.m_TargetRect.y);
            this.m_TargetRect.width  = Mathf.Round(this.m_TargetRect.width);
            this.m_TargetRect.height = Mathf.Round(this.m_TargetRect.height);
            this.m_InFrontOfWindow   = inFrontOf;
            this.m_Window.MoveInFrontOf(this.m_InFrontOfWindow);
            this.SetWindowPos(this.m_TargetRect);
            base.Repaint();
        }
        public void SetDropInfo(DropInfo di, Vector2 mouseScreenPos, ContainerWindow inFrontOf)
        {
            if ((this.m_Type != di.type) || ((di.type == DropInfo.Type.Pane) && (di.rect != this.m_TargetRect)))
            {
                this.m_Type = di.type;
                switch (di.type)
                {
                    case DropInfo.Type.Window:
                        this.m_TargetAlpha = 0.6f;
                        break;

                    case DropInfo.Type.Pane:
                    case DropInfo.Type.Tab:
                        this.m_TargetAlpha = 1f;
                        break;
                }
            }
            switch (di.type)
            {
                case DropInfo.Type.Window:
                    this.m_TargetRect = new Rect(mouseScreenPos.x - (this.m_FullWindowSize.x / 2f), mouseScreenPos.y - (this.m_FullWindowSize.y / 2f), this.m_FullWindowSize.x, this.m_FullWindowSize.y);
                    break;

                case DropInfo.Type.Pane:
                case DropInfo.Type.Tab:
                    this.m_TargetRect = di.rect;
                    break;
            }
            this.m_TabVisible = di.type == DropInfo.Type.Tab;
            this.m_TargetRect.x = Mathf.Round(this.m_TargetRect.x);
            this.m_TargetRect.y = Mathf.Round(this.m_TargetRect.y);
            this.m_TargetRect.width = Mathf.Round(this.m_TargetRect.width);
            this.m_TargetRect.height = Mathf.Round(this.m_TargetRect.height);
            this.m_InFrontOfWindow = inFrontOf;
            this.m_Window.MoveInFrontOf(this.m_InFrontOfWindow);
            this.SetWindowPos(this.m_TargetRect);
            base.Repaint();
        }