Example #1
0
        /// <summary>
        /// Gets the forecolor of the text.
        /// </summary>
        /// <returns>The fore color</returns>
        private Color GetForeColor()
        {
            if (this.Style == TitleStyle.Custom)
            {
                return(_foreColor);
            }

            var palette         = KryptonHelper.GetCurrentPalette();
            var headingColor    = Color.Black;
            var subheadingColor = Color.Black;

            if (palette == PaletteMode.Office2007Black ||
                palette == PaletteMode.Office2007Blue ||
                palette == PaletteMode.Office2007Silver)
            {
                headingColor    = KryptonManager.GetPaletteForMode(palette).GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
                subheadingColor = KryptonManager.GetPaletteForMode(palette).GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
            }
            else if (palette == PaletteMode.ProfessionalOffice2003 ||
                     palette == PaletteMode.ProfessionalSystem)
            {
                headingColor    = SystemColors.ControlText;
                subheadingColor = SystemColors.ControlText;
            }
            else if (palette == PaletteMode.SparkleBlue ||
                     palette == PaletteMode.SparkleOrange ||
                     palette == PaletteMode.SparklePurple)
            {
                headingColor    = Color.White;
                subheadingColor = Color.White;
            }
            else if (palette == PaletteMode.Office2010Black ||
                     palette == PaletteMode.Office2010Blue ||
                     palette == PaletteMode.Office2010Silver)
            {
                headingColor    = KryptonManager.GetPaletteForMode(palette).GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
                subheadingColor = KryptonManager.GetPaletteForMode(palette).GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
            }

            if (this.Style == TitleStyle.Subheading)
            {
                return(subheadingColor);
            }
            else if (this.Style == TitleStyle.Heading)
            {
                return(headingColor);
            }

            return(_foreColor);
        }
Example #2
0
        /// <summary>
        /// Sets the state of the control based on the current theme.
        /// </summary>
        private void SetThemeState()
        {
            if (DesignMode)
            {
                return;
            }

            var palette = KryptonHelper.GetCurrentPalette();

            base.TrackProgressColor = KryptonManager.GetPaletteForMode(palette).GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Pressed);
            base.TrackBorderColor   = KryptonHelper.GetBorderColor();
            base.ButtonBorderColor  = KryptonHelper.GetBorderColor();
            SetBackgroundColour();
            Invalidate();
        }
        private void SetThemeColors()
        {
            var palette = KryptonHelper.GetCurrentPalette();

            if (palette == PaletteMode.SparkleBlue ||
                palette == PaletteMode.SparkleOrange ||
                palette == PaletteMode.SparklePurple)
            {
                _lightColor = SystemColors.ControlDark;
                _darkColor  = Color.FromArgb(24, 32, 48);
            }
            else
            {
                _lightColor = KryptonManager.GetPaletteForMode(palette).GetBackColor2(PaletteBackStyle.TabCustom3, PaletteState.Normal);
                _darkColor  = SystemColors.ControlDark;
            }
            this.Invalidate();
        }
        /// <summary>
        ///     Sets the state of the control based on the current theme.
        /// </summary>
        private void SetThemeState()
        {
            if (DesignMode)
            {
                return;
            }

            var palette = KryptonHelper.GetCurrentPalette();
            var color   = KryptonManager.GetPaletteForMode(palette)
                          .GetBackColor2(PaletteBackStyle.PanelAlternate, PaletteState.Normal);

            BackColor           = color;
            pnlSlider.BackColor = color;
            pnlVolume.BackColor = color;
            slider.BackColor    = color;
            sldVolume.BackColor = color;

            _volumeColor1 = KryptonManager.GetPaletteForMode(palette)
                            .GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Pressed);
            _volumeColor2 = KryptonManager.GetPaletteForMode(palette)
                            .GetBackColor2(PaletteBackStyle.ButtonStandalone, PaletteState.Pressed);
        }
Example #5
0
        /// <summary>
        /// Sets the background colour.
        /// </summary>
        private void SetForeColor()
        {
            if (this.Style == LabelStyle.Custom)
            {
                base.ForeColor = _foreColor;
                return;
            }

            var palette      = KryptonHelper.GetCurrentPalette();
            var textColor    = Color.Black;
            var captionColor = Color.Black;
            var headingColor = Color.Black;

            if (palette == PaletteMode.Office2007Black ||
                palette == PaletteMode.Office2007Blue ||
                palette == PaletteMode.Office2007Silver)
            {
                textColor    = Color.FromArgb(64, 64, 64);
                captionColor = KryptonManager.GetPaletteForMode(palette).GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
                //headingColor = KryptonManager.GetPaletteForMode(palette).GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
                headingColor = Color.Black;
            }
            else if (palette == PaletteMode.ProfessionalOffice2003 ||
                     palette == PaletteMode.ProfessionalSystem)
            {
                textColor    = SystemColors.ControlText;
                captionColor = SystemColors.ControlText;
                headingColor = SystemColors.ControlText;
            }
            else if (palette == PaletteMode.SparkleBlue ||
                     palette == PaletteMode.SparkleOrange ||
                     palette == PaletteMode.SparklePurple)
            {
                textColor    = Color.White;
                captionColor = Color.White;
                headingColor = Color.White;
            }
            else if (palette == PaletteMode.Office2010Black ||
                     palette == PaletteMode.Office2010Blue ||
                     palette == PaletteMode.Office2010Silver)
            {
                textColor = Color.FromArgb(64, 64, 64);
                if (palette == PaletteMode.Office2010Black)
                {
                    textColor = Color.White;
                }

                captionColor = KryptonManager.GetPaletteForMode(palette).GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal);
                headingColor = headingColor = Color.Black;
            }

            if (this.Style == LabelStyle.Text)
            {
                base.ForeColor = textColor;
            }
            else if (this.Style == LabelStyle.Caption)
            {
                base.ForeColor = captionColor;
            }
            else if (this.Style == LabelStyle.Heading)
            {
                base.ForeColor = headingColor;
            }
        }