private void ApplyAppearanceSettings() { if (customizable == false)//Apply the setting as long as it is not customizable { //this.BackColor = Color.Transparent; if (backIcon == true)//Icon on any background of a form. { this.IconColor = UIAppearance.TextColor; } else //Main form title bar icon { if (UIAppearance.Theme == UITheme.Dark && UIAppearance.Style == UIStyle.Supernova)//if the theme is dark and supernova skin, the icon color will be the same lightened color of the normal paragraph text { this.IconColor = ColorEditor.Lighten(UIAppearance.TextColor, 65); } else if (UIAppearance.Theme == UITheme.Light && UIAppearance.Style == UIStyle.Supernova)//if the theme is light and supernova skin, the icon color will be the same lightened color as the normal paragraph text { this.IconColor = ColorEditor.Darken(UIAppearance.TextColor, 25); } else//if the style is another, the icon color will be white { this.IconColor = Color.WhiteSmoke; } } } }
private void Form_Activated(object sender, EventArgs e) {//When the form enters activated mode (regains focus - form is redisplayed), //Set the title bar back to normal color. this.BorderColor = UIAppearance.FormBorderColor;//Set border color if (UIAppearance.Style != UIStyle.Supernova) { pnlTitleBar.BackColor = UIAppearance.PrimaryStyleColor; //Set title bar backcolor pnlSideMenuHeader.BackColor = ColorEditor.Darken(UIAppearance.PrimaryStyleColor, 6); //Set Side menu header backcolor pnlTitleBar.Update(); //Force draw the title bar to avoid flickering when the background color is changed. } }
private void Form_Deactivated(object sender, EventArgs e) {//When the form goes into deactivated mode (loses focus) change the color of the title bar. if (deactivateFormEvent == true) { this.BorderColor = Colors.DefaultFormBorderColor; //Set border color if (UIAppearance.Style != UIStyle.Supernova) //If the style is not supernova, change the title bar color { pnlTitleBar.BackColor = UIAppearance.DeactiveFormColor; //Set title bar backcolor pnlSideMenuHeader.BackColor = ColorEditor.Darken(UIAppearance.DeactiveFormColor, 6); //Set Side menu header backcolor pnlTitleBar.Update(); //Force draw the title bar to avoid flickering when the background color is changed. } } }
private void ColorTitleBar() { if (UIAppearance.Theme == UITheme.Light && UIAppearance.Style == UIStyle.Supernova)//If the theme is light and the style is supernova, darken the text color. { this.ForeColor = ColorEditor.Darken(UIAppearance.TextColor, 25); } else if (UIAppearance.Theme == UITheme.Dark && UIAppearance.Style == UIStyle.Supernova) //If the theme is dark and the style is supernova, lighten the text color. { this.ForeColor = ColorEditor.Lighten(UIAppearance.TextColor, 65); } else //If the style is any other set white as the text color { this.ForeColor = Color.WhiteSmoke; } }
private void rbLightTheme_CheckedChanged(object sender, EventArgs e) { if (rbLightTheme.Checked) { panelBackground.BackColor = Colors.LightBackground; } else { panelBackground.BackColor = Colors.DarkBackground; } if (cbStyles.SelectedIndex == (int)UIStyle.Supernova) { panelTitleBar.BackColor = ColorEditor.Darken(panelBackground.BackColor, 9); } }
private void LoadAppearanceSettings() {//Display the current appearance settings on the form. //Theme if (UIAppearance.Theme == UITheme.Dark) { rbDarkTheme.Checked = true; } else { rbLightTheme.Checked = true; } //Style cbStyles.DataSource = Enum.GetValues(typeof(UIStyle)); cbStyles.SelectedIndex = (int)UIAppearance.Style; //Form Border Size tbmFormBorderSize.Value = UIAppearance.FormBorderSize; //Is Color Form Border tbColorFormBorder.Checked = UIAppearance.FormBorderColor == Colors.DefaultFormBorderColor ? false : true; //Child Form Marker tbChildFormMarker.Checked = UIAppearance.ChildFormMarker; //Form Icon in Activated Menu Item tbIconMenuItem.Checked = UIAppearance.FormIconActiveMenuItem; //MDI Desktop Panel tbMultiChildForms.Checked = UIAppearance.MultiChildForms; //Preview panelBorde.Padding = new Padding(UIAppearance.FormBorderSize); panelBorde.BackColor = UIAppearance.FormBorderColor; panelBackground.BackColor = UIAppearance.BackgroundColor; if (UIAppearance.Style == UIStyle.Supernova) { panelTitleBar.BackColor = ColorEditor.Darken(UIAppearance.BackgroundColor, 9); } else { panelTitleBar.BackColor = UIAppearance.PrimaryStyleColor; } }
private void ApplyAppearanceSettings() { //Apply settings pnlDesktop.BackColor = UIAppearance.BackgroundColor; //Set background color pnlDesktopHeader.BackColor = UIAppearance.BackgroundColor; //set desktop header backcolor this.BorderColor = UIAppearance.FormBorderColor; //Set border color this.BorderSize = UIAppearance.FormBorderSize; //Set form Border Width if (UIAppearance.Style == UIStyle.Supernova) //if the style is supernova { pnlTitleBar.BackColor = ColorEditor.Darken(UIAppearance.BackgroundColor, 7); //Set title bar backcolor pnlSideMenuHeader.BackColor = Colors.SideMenuColor; //Set Side menu header backcolor pnlMarker.BackColor = Color.CornflowerBlue; //Set marker colo } else //any style that is not supernova { pnlTitleBar.BackColor = UIAppearance.PrimaryStyleColor; //Set title bar backcolor pnlSideMenuHeader.BackColor = ColorEditor.Darken(UIAppearance.PrimaryStyleColor, 6); //Set Side menu header backcolor pnlMarker.BackColor = UIAppearance.StyleColor; //Set marker color } }
private void FormOptions_VisibleChanged(object sender, EventArgs e) { //When the form options dropdown is shown or hidden if (dmFormOptions.Visible == true) //If menu is displayed { //keep button highlighted and set icon to options list btnFormIcon.BackColor = ColorEditor.Darken(btnFormIcon.BackColor, 15); btnFormIcon.FlatAppearance.MouseOverBackColor = btnFormIcon.BackColor; btnFormIcon.IconChar = IconChar.ListUl;//Options list Icon } else // If menu is hidden {//Return the default color and icon if (UIAppearance.Style == UIStyle.Supernova) { btnFormIcon.BackColor = Colors.DarkItemBackground; } else { btnFormIcon.BackColor = UIAppearance.PrimaryStyleColor; } btnFormIcon.IconChar = FormIcon; } }
private Color menuItemBorder; //Sets the border color of the menu item //Constructor public DropdownMenuColors(bool menuButtonOwner) { if (UIAppearance.Theme == UITheme.Dark || menuButtonOwner == true)//If the theme is dark or the dropdown menu is displayed from the menu button, set the following colors { dropdownMenuBackground = Colors.DarkItemBackground; dropdownMenuBorder = ColorEditor.Darken(Colors.DarkItemBackground, 10); menuItemBorder = Colors.DarkActiveBackground; menuItemSelected = Colors.DarkActiveBackground; leftColumnGradientBegin = ColorEditor.Darken(Colors.DarkItemBackground, 4); leftColumnGradientMiddle = ColorEditor.Darken(Colors.DarkItemBackground, 4); leftColumnGradientEnd = ColorEditor.Darken(Colors.DarkItemBackground, 4); } else //If the theme is light, set the following colors { dropdownMenuBackground = Colors.LightItemBackground; dropdownMenuBorder = ColorEditor.Darken(UIAppearance.BackgroundColor, 10); menuItemBorder = Colors.LightActiveBackground; menuItemSelected = Colors.LightActiveBackground; leftColumnGradientBegin = ColorEditor.Darken(Colors.LightItemBackground, 4); leftColumnGradientMiddle = ColorEditor.Darken(Colors.LightItemBackground, 4); leftColumnGradientEnd = ColorEditor.Darken(Colors.LightItemBackground, 4); } }
private void ApplyAppearanceSettings() { switch (style) { case LabelStyle.Normal: //If the style is normal set the color and size of the text set in the theme textColor = UIAppearance.TextColor; this.ForeColor = textColor; this.Font = new Font(this.Font.Name, UIAppearance.TextSize, this.Font.Style, this.Font.Unit); break; case LabelStyle.Description: //If the style is description if (UIAppearance.Theme == Settings.UITheme.Dark) //If the theme is dark style lighten the text color { textColor = ColorEditor.Darken(UIAppearance.TextColor, 10); } else //If the theme is light style darken the text color { textColor = ColorEditor.Lighten(UIAppearance.TextColor, 15); } this.ForeColor = textColor; this.Font = new Font(this.Font.Name, 8F, this.Font.Style, this.Font.Unit); break; case LabelStyle.Subtitle: //If the style is subtitle set the color set in the theme and a size of 12.5F if (UIAppearance.Theme == Settings.UITheme.Dark) //If the theme is dark style lighten the text color { textColor = ColorEditor.Lighten(UIAppearance.TextColor, 45); } else //If the theme is light style darken the text color { textColor = ColorEditor.Darken(UIAppearance.TextColor, 20); } this.ForeColor = textColor; this.Font = new Font(this.Font.Name, 12F, this.Font.Style, this.Font.Unit); break; case LabelStyle.Title: //If the style is title set the style color as text color or a size of 16F. textColor = UIAppearance.StyleColor; this.ForeColor = textColor; this.Font = new Font(this.Font.Name, 14F, this.Font.Style, this.Font.Unit); break; case LabelStyle.Title2: if (UIAppearance.Theme == Settings.UITheme.Dark) //If the theme is dark style lighten the text color { textColor = ColorEditor.Lighten(UIAppearance.TextColor, 50); } else //If the theme is light style darken the text color { textColor = ColorEditor.Darken(UIAppearance.TextColor, 25); } this.ForeColor = textColor; this.Font = new Font(this.Font.Name, 14F, this.Font.Style, this.Font.Unit); break; case LabelStyle.BarCaption: //If the style is a caption of the title bar of the main form. this.Font = new Font("Montserrat", 12.5F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); ColorTitleBar(); break; case LabelStyle.BarText: //If the style is a text of the title bar of the main form. this.Font = new Font("Microsoft Sans Serif", 9.5F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); ColorTitleBar(); break; case LabelStyle.Custom: //Custom size and font, however text color is set by theme textColor = UIAppearance.TextColor; this.ForeColor = textColor; break; } }
//Load Apperance Settings public static void LoadApperanceSettings() { UIAppearance.Theme = (UITheme)UIAppearanceSettings.Default.Theme; //Set theme UIAppearance.Style = (UIStyle)UIAppearanceSettings.Default.Style; //Set style UIAppearance.FormBorderSize = UIAppearanceSettings.Default.FormBorderSize; //Set form border size UIAppearance.ChildFormMarker = UIAppearanceSettings.Default.ChildFormMarker; //Set whether to show the marker of the current child form UIAppearance.FormIconActiveMenuItem = UIAppearanceSettings.Default.FormIconActiveMenuItem; //Set whether the active menu item icon is equal to the icon of its associated form. UIAppearance.MultiChildForms = UIAppearanceSettings.Default.MultiChildForms; //Set whether to open multiple child forms in the application //Set theme colors if (UIAppearance.Theme == UITheme.Light) //Light theme { UIAppearance.BackgroundColor = Colors.LightBackground; UIAppearance.ItemBackgroundColor = Colors.LightItemBackground; UIAppearance.ActiveBackgroundColor = Colors.LightActiveBackground; UIAppearance.PrimaryTextColor = ColorEditor.Darken(Colors.LightTextColor, 15); UIAppearance.TextColor = Colors.LightTextColor; } else //Dark theme { UIAppearance.BackgroundColor = Colors.DarkBackground; UIAppearance.ItemBackgroundColor = Colors.DarkItemBackground; UIAppearance.ActiveBackgroundColor = Colors.DarkActiveBackground; UIAppearance.PrimaryTextColor = ColorEditor.Lighten(Colors.DarkTextColor, 25); UIAppearance.TextColor = Colors.DarkTextColor; } //Set style color switch (UIAppearance.Style) { case UIStyle.Axolotl: UIAppearance.PrimaryStyleColor = Colors.Axolotl; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Axolotl, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Axolotl, 15); } break; case UIStyle.FireOpal: UIAppearance.PrimaryStyleColor = Colors.FireOpal; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.FireOpal, 12); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.FireOpal, 15); } break; case UIStyle.Forest: UIAppearance.PrimaryStyleColor = Colors.Forest; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Forest, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Forest, 15); } break; case UIStyle.Lisianthus: UIAppearance.PrimaryStyleColor = Colors.Lisianthus; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Lisianthus, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Lisianthus, 15); } break; case UIStyle.Neptune: UIAppearance.PrimaryStyleColor = Colors.Neptune; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Neptune, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Neptune, 15); } break; case UIStyle.Petunia: UIAppearance.PrimaryStyleColor = Colors.Petunia; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Petunia, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Petunia, 15); } break; case UIStyle.Ruby: UIAppearance.PrimaryStyleColor = Colors.Ruby; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Ruby, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Ruby, 15); } break; case UIStyle.Sky: UIAppearance.PrimaryStyleColor = Colors.Sky; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Sky, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Sky, 15); } break; case UIStyle.Spinel: UIAppearance.PrimaryStyleColor = Colors.Spinel; if (UIAppearance.Theme == UITheme.Dark) { UIAppearance.StyleColor = ColorEditor.Darken(Colors.Spinel, 10); } else { UIAppearance.StyleColor = ColorEditor.Lighten(Colors.Spinel, 15); } break; case UIStyle.Supernova: UIAppearance.StyleColor = Colors.Lisianthus; UIAppearance.PrimaryStyleColor = Colors.FantasyColorScheme1; break; } //Set the border color of the form if (UIAppearanceSettings.Default.ColorFormBorder == true) { UIAppearance.FormBorderColor = UIAppearance.PrimaryStyleColor; } else { UIAppearance.FormBorderColor = Colors.DefaultFormBorderColor; } }
private void cbStyles_OnSelectedIndexChanged(object sender, EventArgs e) { UIStyle style = (UIStyle)cbStyles.SelectedIndex; switch (style) { case UIStyle.Axolotl: panelTitleBar.BackColor = Colors.Axolotl; break; case UIStyle.FireOpal: panelTitleBar.BackColor = Colors.FireOpal; break; case UIStyle.Forest: panelTitleBar.BackColor = Colors.Forest; break; case UIStyle.Lisianthus: panelTitleBar.BackColor = Colors.Lisianthus; break; case UIStyle.Neptune: panelTitleBar.BackColor = Colors.Neptune; break; case UIStyle.Petunia: panelTitleBar.BackColor = Colors.Petunia; break; case UIStyle.Ruby: panelTitleBar.BackColor = Colors.Ruby; break; case UIStyle.Sky: panelTitleBar.BackColor = Colors.Sky; break; case UIStyle.Spinel: panelTitleBar.BackColor = Colors.Spinel; break; case UIStyle.Supernova: panelTitleBar.BackColor = ColorEditor.Darken(panelBackground.BackColor, 9); break; } if (tbColorFormBorder.Checked) { if (cbStyles.SelectedIndex == (int)UIStyle.Supernova) { panelBorde.BackColor = Colors.FantasyColorScheme1; } else { panelBorde.BackColor = panelTitleBar.BackColor; } } else { panelBorde.BackColor = Colors.DefaultFormBorderColor; } }