Exemplo n.º 1
0
        public virtual void Apply(Control c)
        {
            c.Font = FontNormal;

            if (c is Skin.CheckBox)
            {
                Skin.CheckBox c2 = c as Skin.CheckBox;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.FlatStyle = FlatStyle.Flat;
                }
                else
                {
                    c2.FlatStyle = FlatStyle.Standard;
                }
            }

            if (c is Skin.ComboBox)
            {
                Skin.ComboBox c2 = c as Skin.ComboBox;

                c2.BackColor = BackColor;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.FlatStyle = FlatStyle.Flat;
                }
                else
                {
                    c2.FlatStyle = FlatStyle.Standard;
                }
            }

            if (c is Skin.TextBox)
            {
                Skin.TextBox c2 = c as Skin.TextBox;

                if (c2.ReadOnly)
                {
                    c2.BackColor = ReadOnlyBackColor;
                }
                else
                {
                    c2.BackColor = BackColor;
                }
                c2.ForeColor = ForeColor;


                if (GetStyle() == "flat")
                {
                    c2.BorderStyle = BorderStyle.FixedSingle;
                }
                else
                {
                    c2.BorderStyle = BorderStyle.Fixed3D;
                }
            }

            if (c is Skin.Label)
            {
            }

            if (c is Skin.RadioButton)
            {
                Skin.RadioButton c2 = c as Skin.RadioButton;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.FlatStyle = FlatStyle.Flat;
                }
                else
                {
                    c2.FlatStyle = FlatStyle.Standard;
                }
            }

            if (c is Skin.LinkLabel)
            {
                Skin.LinkLabel c2 = c as Skin.LinkLabel;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = HyperLinkForeColor;
                //c2.ActiveLinkColor = HyperLinkColor;
                //c2.LinkColor = HyperLinkColor;
                //c2.VisitedLinkColor = HyperLinkColor;
            }

            if (c is Skin.TabPage)
            {
                Skin.TabPage c2 = c as Skin.TabPage;

                c2.BackColor = Color.Transparent;
            }

            if (c is Skin.ListView)
            {
                Skin.ListView c2 = c as Skin.ListView;

                c2.BackColor = BackColor;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.BorderStyle = BorderStyle.FixedSingle;
                }
                else
                {
                    c2.BorderStyle = BorderStyle.Fixed3D;
                }
            }

            if (c is Skin.Button)
            {
                Skin.Button c2 = c as Skin.Button;

                c2.ForeColor = ForeColor;

                //c2.UpdateBackground();
            }

            if (c is System.Windows.Forms.ContextMenuStrip)
            {
                System.Windows.Forms.ContextMenuStrip c2 = c as System.Windows.Forms.ContextMenuStrip;
                foreach (System.Windows.Forms.ToolStripItem i in c2.Items)
                {
                    if (Platform.IsUnix())
                    {
                        // Fix Mono colors issue (for example Arch with dark theme)
                        if (i.ForeColor == SystemColors.ControlText)
                        {
                            i.ForeColor = Color.Black;
                        }
                        if (i.BackColor == SystemColors.Control)
                        {
                            i.BackColor = Color.White;
                        }
                    }
                }
            }

            foreach (Control sc in c.Controls)
            {
                Apply(sc);
            }

            c.Invalidate();
        }
Exemplo n.º 2
0
        public virtual void Apply(Control c)
        {
            c.Font = FontNormal;

            if (c is Skin.CheckBox)
            {
                Skin.CheckBox c2 = c as Skin.CheckBox;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.FlatStyle = FlatStyle.Flat;
                }
                else
                {
                    c2.FlatStyle = FlatStyle.Standard;
                }
            }

            if (c is Skin.ComboBox)
            {
                Skin.ComboBox c2 = c as Skin.ComboBox;

                c2.BackColor = BackColor;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.FlatStyle = FlatStyle.Flat;
                }
                else
                {
                    c2.FlatStyle = FlatStyle.Standard;
                }
            }

            if (c is Skin.TextBox)
            {
                Skin.TextBox c2 = c as Skin.TextBox;

                if (c2.ReadOnly)
                {
                    c2.BackColor = ReadOnlyBackColor;
                }
                else
                {
                    c2.BackColor = BackColor;
                }
                c2.ForeColor = ForeColor;


                if (GetStyle() == "flat")
                {
                    c2.BorderStyle = BorderStyle.FixedSingle;
                }
                else
                {
                    c2.BorderStyle = BorderStyle.Fixed3D;
                }
            }

            if (c is Skin.Label)
            {
            }

            if (c is Skin.RadioButton)
            {
                Skin.RadioButton c2 = c as Skin.RadioButton;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.FlatStyle = FlatStyle.Flat;
                }
                else
                {
                    c2.FlatStyle = FlatStyle.Standard;
                }
            }

            if (c is Skin.LinkLabel)
            {
                Skin.LinkLabel c2 = c as Skin.LinkLabel;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = HyperLinkForeColor;
                //c2.ActiveLinkColor = HyperLinkColor;
                //c2.LinkColor = HyperLinkColor;
                //c2.VisitedLinkColor = HyperLinkColor;
            }

            if (c is Skin.TabPage)
            {
                Skin.TabPage c2 = c as Skin.TabPage;

                c2.BackColor = Color.Transparent;
            }

            if (c is Skin.ListView)
            {
                Skin.ListView c2 = c as Skin.ListView;

                c2.BackColor = BackColor;
                c2.ForeColor = ForeColor;

                if (GetStyle() == "flat")
                {
                    c2.BorderStyle = BorderStyle.FixedSingle;
                }
                else
                {
                    c2.BorderStyle = BorderStyle.Fixed3D;
                }
            }

            if (c is Skin.Button)
            {
                Skin.Button c2 = c as Skin.Button;

                c2.ForeColor = ForeColor;

                //c2.UpdateBackground();
            }


            foreach (Control sc in c.Controls)
            {
                Apply(sc);
            }

            c.Invalidate();
        }
Exemplo n.º 3
0
        public virtual void Apply(Control c)
        {
            if (c is Skin.CheckBox)
            {
                Skin.CheckBox c2 = c as Skin.CheckBox;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = ForeColor;
            }

            if (c is Skin.ComboBox)
            {
                Skin.ComboBox c2 = c as Skin.ComboBox;

                c2.BackColor = BackColor;
                c2.ForeColor = ForeColor;
                c2.FlatStyle = FlatStyle.Standard;
            }

            if (c is Skin.TextBox)
            {
                Skin.TextBox c2 = c as Skin.TextBox;

                c2.BackColor   = BackColor;
                c2.ForeColor   = ForeColor;
                c2.BorderStyle = BorderStyle.Fixed3D;
            }

            if (c is Skin.Label)
            {
                // TOCLEAN

                // Skin.Label c2 = c as Skin.Label;

                //c2.BackColor = Color.Transparent;
                //c2.ForeColor = ForeColor;
            }

            if (c is Skin.RadioButton)
            {
                Skin.RadioButton c2 = c as Skin.RadioButton;

                c2.BackColor = Color.Transparent;
                c2.ForeColor = ForeColor;
            }

            if (c is Skin.LinkLabel)
            {
                Skin.LinkLabel c2 = c as Skin.LinkLabel;

                c2.BackColor        = Color.Transparent;
                c2.ForeColor        = HyperLinkColor;
                c2.ActiveLinkColor  = HyperLinkColor;
                c2.LinkColor        = HyperLinkColor;
                c2.VisitedLinkColor = HyperLinkColor;
            }

            if (c is Skin.TabPage)
            {
                Skin.TabPage c2 = c as Skin.TabPage;

                c2.BackColor = Color.Transparent;
            }

            if (c is Skin.ListView)
            {
                Skin.ListView c2 = c as Skin.ListView;

                c2.BackColor = BackColor;
                c2.ForeColor = ForeColor;
            }

            if (c is Skin.Button)
            {
                Skin.Button c2 = c as Skin.Button;

                c2.ForeColor = ForeColor;

                //c2.UpdateBackground();
            }


            foreach (Control sc in c.Controls)
            {
                Apply(sc);
            }

            c.Invalidate();
        }