public void Init()
        {
            SetDefaultHeight();

            var taskbarLocation = this.MainForm.TaskbarLocation;

            bool leftToRight = taskbarLocation == Native.ABEdge.Top ||
                               taskbarLocation == Native.ABEdge.Bottom;

            Width = leftToRight ? (IsBig ? BigWidth : SmallWidth) : (this.Parent.Width);

            bool isVisualTheme = Native.IsThemeActive() != 0;

            if (!isVisualTheme && !leftToRight)
            {
                Width       -= 5;
                this.Padding = new Padding(0, 0, 0, 0);
            }
            else
            {
                this.Padding = new Padding(1, 0, 2, 0);
            }
            if (_decorator != null)
            {
                _decorator.Dispose();
            }
            _decorator = null;

            int iconSize = this.IsBig ? ButtonConstants.BigIconSize : ButtonConstants.SmallIconSize;

            this.Image = _app.Icon.ResizeBitmap(iconSize, iconSize);
        }
Пример #2
0
 protected override void OnSizeChanged(EventArgs e)
 {
     base.OnSizeChanged(e);
     if (_decorator != null)
     {
         _decorator.Dispose();
     }
     _decorator = null;
 }
        public void Init()
        {
            var taskbarLocation = this.MainForm.TaskbarLocation;
            bool isLeftToRight = taskbarLocation == Native.ABEdge.Top || taskbarLocation == Native.ABEdge.Bottom;

            if (isLeftToRight)
            {
                SetDefaultHeight();
                Height = Height - 9;
                Width = ButtonConstants.NotifIconWidth;
            }
            else
            {
                Width = ButtonConstants.NotifIconWidth;
                Height = ButtonConstants.NotifIconHeight;
            }

            this.Padding = System.Windows.Forms.Padding.Empty;

            if (_decorator != null) _decorator.Dispose();
            _decorator = null;
        }