public void MakeWidgetMovable(Control w, Control startCtrl = null)
        {
            if (startCtrl == null)
            {
                startCtrl = w;
            }

            bool moving = false;

            w.MouseDown += (o, a) =>
            {
                HideAppLauncher();
                moving = true;
            };

            w.MouseMove += (o, a) =>
            {
                if (moving == true)
                {
                    var mPos = Cursor.Position;
                    int mY   = mPos.Y - desktoppanel.Height;
                    int mX   = mPos.X;

                    int ctrlHeight = startCtrl.Height / 2;
                    int ctrlWidth  = startCtrl.Width / 2;

                    startCtrl.Location = new Point(
                        mX - ctrlWidth,
                        mY - ctrlHeight
                        );
                }
            };

            w.MouseUp += (o, a) =>
            {
                moving = false;
                var details = WidgetManager.LoadDetails(startCtrl.GetType());
                details.Location = startCtrl.Location;
                WidgetManager.SaveDetails(startCtrl.GetType(), details);
            };

            foreach (Control c in w.Controls)
            {
                MakeWidgetMovable(c, startCtrl);
            }
        }
        /// <summary>
        /// Setups the desktop.
        /// </summary>
        /// <returns>The desktop.</returns>
        public void SetupDesktop()
        {
            if (DesktopFunctions.ShowDefaultElements == true)
            {
                ToolStripManager.Renderer = new ShiftOSMenuRenderer();

                this.DoubleBuffered    = true;
                this.FormBorderStyle   = FormBorderStyle.None;
                this.WindowState       = FormWindowState.Maximized;
                desktoppanel.BackColor = Color.Green;

                //upgrades

                if (Shiftorium.IsInitiated == true)
                {
                    desktoppanel.Visible = Shiftorium.UpgradeInstalled("desktop");
                    lbtime.Visible       = Shiftorium.UpgradeInstalled("desktop_clock_widget");

                    ControlManager.SetupControls(pnlnotificationbox);

                    //skinning
                    lbtime.BackColor = Color.Transparent;
                    pnlnotifications.BackgroundImage       = GetImage("panelclockbg");
                    pnlnotifications.BackgroundImageLayout = GetImageLayout("panelclockbg");
                    pnlnotifications.BackColor             = LoadedSkin.DesktopPanelClockBackgroundColor;

                    panelbuttonholder.Top       = 0;
                    panelbuttonholder.Left      = LoadedSkin.PanelButtonHolderFromLeft;
                    panelbuttonholder.Height    = desktoppanel.Height;
                    panelbuttonholder.BackColor = Color.Transparent;
                    panelbuttonholder.Margin    = new Padding(0, 0, 0, 0);

                    sysmenuholder.Visible = Shiftorium.UpgradeInstalled("app_launcher");

                    //The Color Picker can give us transparent colors - which Windows Forms f*****g despises when dealing with form backgrounds.
                    //To compensate, we must recreate the desktop color and make the alpha channel '255'.
                    this.BackColor = Color.FromArgb(LoadedSkin.DesktopColor.R, LoadedSkin.DesktopColor.G, LoadedSkin.DesktopColor.B);
                    //Not doing this will cause an ArgumentException.

                    this.BackgroundImage       = SkinEngine.GetImage("desktopbackground");
                    this.BackgroundImageLayout = GetImageLayout("desktopbackground");
                    desktoppanel.BackColor     = LoadedSkin.DesktopPanelColor;

                    var pnlimg = GetImage("desktoppanel");
                    if (pnlimg != null)
                    {
                        var bmp = new Bitmap(pnlimg);
                        bmp.MakeTransparent(Color.FromArgb(1, 0, 1));
                        pnlimg = bmp;
                    }

                    desktoppanel.BackgroundImage = pnlimg;
                    if (desktoppanel.BackgroundImage != null)
                    {
                        desktoppanel.BackColor = Color.Transparent;
                    }
                    var appimg = GetImage("applauncher");
                    if (appimg != null)
                    {
                        var bmp = new Bitmap(appimg);
                        bmp.MakeTransparent(Color.FromArgb(1, 0, 1));
                        appimg = bmp;
                    }
                    menuStrip1.BackgroundImage = appimg;
                    lbtime.ForeColor           = LoadedSkin.DesktopPanelClockColor;
                    lbtime.Font = LoadedSkin.DesktopPanelClockFont;
                    if (desktoppanel.BackgroundImage == null)
                    {
                        lbtime.BackColor = LoadedSkin.DesktopPanelClockBackgroundColor;
                    }
                    else
                    {
                        lbtime.BackColor = Color.Transparent;
                    }
                    apps.Text = LoadedSkin.AppLauncherText;
                    sysmenuholder.Location = LoadedSkin.AppLauncherFromLeft;
                    sysmenuholder.Size     = LoadedSkin.AppLauncherHolderSize;
                    apps.Size           = sysmenuholder.Size;
                    menuStrip1.Renderer = new ShiftOSMenuRenderer(new AppLauncherColorTable());
                    desktoppanel.BackgroundImageLayout = GetImageLayout("desktoppanel");
                    desktoppanel.Height = LoadedSkin.DesktopPanelHeight;
                    if (LoadedSkin.DesktopPanelPosition == 1)
                    {
                        desktoppanel.Dock = DockStyle.Bottom;
                    }
                    else
                    {
                        desktoppanel.Dock = DockStyle.Top;
                    }
                }

                pnlwidgetlayer.Show();
                pnlwidgetlayer.BringToFront();

                if (Shiftorium.UpgradeInstalled("desktop_widgets"))
                {
                    Widgets.Clear();
                    pnlwidgetlayer.Controls.Clear();
                    foreach (var widget in WidgetManager.GetAllWidgetTypes())
                    {
                        UserControl w = (UserControl)Activator.CreateInstance(widget.Value, null);

                        w.Location = WidgetManager.LoadDetails(w.GetType()).Location;
                        pnlwidgetlayer.Controls.Add(w);
                        MakeWidgetMovable(w);
                        Widgets.Add(w as IDesktopWidget);
                    }
                }

                int lastHeight = 5;
                foreach (var widget in Widgets)
                {
                    if (WidgetManager.LoadDetails(widget.GetType()).IsVisible&& Shiftorium.UpgradeInstalled("desktop_widgets"))
                    {
                        widget.OnSkinLoad();

                        widget.OnUpgrade();
                        widget.Setup();
                        widget.Show();
                        if (widget.Location.X == -1 && widget.Location.Y == -1)
                        {
                            widget.Location = new Point(5, lastHeight);
                            lastHeight     += widget.Size.Height + 5;
                        }
                    }
                    else
                    {
                        widget.Hide();
                    }
                }
                pnlwidgetlayer.Show();
                pnlwidgetlayer.BringToFront();
            }
            else
            {
                desktoppanel.Hide();
            }

            LuaInterpreter.RaiseEvent("on_desktop_skin", this);

            PopulatePanelButtons();
        }