Пример #1
0
        protected override void OnLayout(LayoutEventArgs e)
        {
            base.OnLayout(e);

            setSize();

            SizeF scaleFactor = ScaleUtils.GetScaleFactor(this);

            if (collapsed)
            {
                int scaledImgSize = ScaleUtils.Scale(scaleFactor, 16);
                arrowImgRect = new Rectangle((this.Width - scaledImgSize) / 2, (this.Height - scaledImgSize) / 2 + 1, scaledImgSize, scaledImgSize);
            }
            else
            {
                int scaledImgSize = ScaleUtils.Scale(scaleFactor, 20);
                arrowImgRect = new Rectangle(this.Width - scaledImgSize - 8, (int)Math.Round((this.Height - scaledImgSize) / 2d), scaledImgSize, scaledImgSize);

                infoImgRect = new Rectangle(ScaleUtils.Scale(scaleFactor, 9), (int)Math.Round((this.Height - scaledImgSize) / 2d), scaledImgSize, scaledImgSize);

                arrowMouseRect = arrowImgRect;
                arrowMouseRect.Inflate(4, 4);
                arrowMouseRect.Width++;                 // to take into account the size of the arrow in the image


                infoMouseRect = infoImgRect;
                infoMouseRect.Inflate(4, 4);
                //infoMouseRect.Width++; // to take into account the size of the arrow in the image

                textRect = new Rectangle(infoImgRect.Right + 4, 0, arrowMouseRect.Left - infoImgRect.Right, this.Height);
            }
        }
Пример #2
0
 private void setSize()
 {
     this.Height = ScaleUtils.Scale(this, Collapsed ? COLLAPSED_HEIGHT : EXPANDED_HEIGHT);
 }