private void DrawThemeParts() { SadConsole.UI.Colors colors = Controls.GetThemeColors(); Surface.Clear(_themePartsArea); int y = _themePartsArea.Y; int themeY = 0; UpdateColors(); AdjustableColor selectedSetting = _themeParts[_themePartSelectedIndex]; for (int i = 0; i < _themeParts.Length; i++) { int row = y + i; if (i == _themePartSelectedIndex) { themeY = row; Surface.Print(3, row, ColoredString.Parse(GetThemePartString(selectedSetting.ComputedColor, selectedSetting.Name.Replace("Control ", "")))); Surface.SetGlyph(2, row, ICellSurface.ConnectedLineThin[0], colors.Lines); Surface.DrawLine(new Point(2, row + 1), (_themePartsArea.MaxExtentX, row + 1), ICellSurface.ConnectedLineThin[0], colors.Lines); Surface.DrawLine(new Point(_themePartsArea.MaxExtentX, row + 1), new Point(_themePartsArea.MaxExtentX, row + _themePartSelectedAreaSize), ICellSurface.ConnectedLineThin[0], colors.Lines); Surface.DrawLine(new Point(_themePartsArea.MaxExtentX, row + _themePartSelectedAreaSize + 1), new Point(2, row + _themePartSelectedAreaSize + 1), ICellSurface.ConnectedLineThin[0], colors.Lines); y += _themePartSelectedAreaSize + 1; } else { Surface.Print(3, row, ColoredString.Parse(GetThemePartString(_themeParts[i].ComputedColor, _themeParts[i].Name.Replace("Control ", "")))); Surface.SetGlyph(2, row, ICellSurface.ConnectedLineThin[0], colors.Lines); } } // Connect all the lines for the selected theme area Surface.ConnectLines(ICellSurface.ConnectedLineThin, _themePartsArea); // Draw the shade selection area _themePartsShadeBoxes = new TextField(new Point(_themePartsArea.MaxExtentX - 10, themeY + 3), 10, Surface); var colorPreviewText = new TextField(_themePartsShadeBoxes.Position.WithY(themeY + 2), 5, Surface); var colorPreviewBarsText = new TextField(new Point(colorPreviewText.Position.X + colorPreviewText.Width, themeY + 2), 5, Surface); var shadePreviewBarsText = new TextField(_themePartsShadeBoxes.Position.WithY(themeY + 4), 5, Surface); var shadePreviewText = new TextField(new Point(shadePreviewBarsText.Position.X + shadePreviewBarsText.Width, themeY + 4), 5, Surface); var intoColorPreviewText = new TextField(new Point(colorPreviewText.Position.X - 3, colorPreviewText.Position.Y), 3, Surface); var intoColorPreviewString = new ColoredString(3); intoColorPreviewString.SetForeground(colors.Lines); intoColorPreviewString.SetGlyph(ICellSurface.ConnectedLineThin[(int)ICellSurface.ConnectedLineIndex.Top]); var colorPreviewString = new ColoredString(5); colorPreviewString.SetForeground(selectedSetting.BaseColor); colorPreviewString[0].Glyph = 301; colorPreviewString[1].Glyph = 303; colorPreviewString[2].Glyph = 303; colorPreviewString[3].Glyph = 303; colorPreviewString[4].Glyph = 302; var colorPreviewBarsString = new ColoredString(5); colorPreviewBarsString.SetForeground(colors.Lines); colorPreviewBarsString.SetGlyph(ICellSurface.ConnectedLineThin[(int)ICellSurface.ConnectedLineIndex.Top]); colorPreviewBarsString[4].Glyph = ICellSurface.ConnectedLineThin[(int)ICellSurface.ConnectedLineIndex.TopRight]; var shadeBarsString = new ColoredString(10); shadeBarsString[0].Glyph = 299; shadeBarsString[0].Foreground = selectedSetting.BaseColor.GetBrightest(); shadeBarsString[1].Glyph = 300; shadeBarsString[1].Foreground = selectedSetting.BaseColor.GetBrightest(); shadeBarsString[2].Glyph = 299; shadeBarsString[2].Foreground = selectedSetting.BaseColor.GetBright(); shadeBarsString[3].Glyph = 300; shadeBarsString[3].Foreground = selectedSetting.BaseColor.GetBright(); shadeBarsString[4].Glyph = 299; shadeBarsString[4].Foreground = selectedSetting.BaseColor; shadeBarsString[5].Glyph = 300; shadeBarsString[5].Foreground = selectedSetting.BaseColor; shadeBarsString[6].Glyph = 299; shadeBarsString[6].Foreground = selectedSetting.BaseColor.GetDark(); shadeBarsString[7].Glyph = 300; shadeBarsString[7].Foreground = selectedSetting.BaseColor.GetDark(); shadeBarsString[8].Glyph = 299; shadeBarsString[8].Foreground = selectedSetting.BaseColor.GetDarkest(); shadeBarsString[9].Glyph = 300; shadeBarsString[9].Foreground = selectedSetting.BaseColor.GetDarkest(); var shadePreviewBarsString = new ColoredString(5); shadePreviewBarsString.SetForeground(colors.Lines); shadePreviewBarsString.SetGlyph(ICellSurface.ConnectedLineThin[(int)ICellSurface.ConnectedLineIndex.Top]); shadePreviewBarsString[0].Glyph = ICellSurface.ConnectedLineThin[(int)ICellSurface.ConnectedLineIndex.BottomLeft]; var shadePreviewString = new ColoredString(5); shadePreviewString.SetForeground(selectedSetting.ComputedColor); shadePreviewString[0].Glyph = 301; shadePreviewString[1].Glyph = 303; shadePreviewString[2].Glyph = 303; shadePreviewString[3].Glyph = 303; shadePreviewString[4].Glyph = 302; intoColorPreviewText.Print(intoColorPreviewString); colorPreviewText.Print(colorPreviewString); colorPreviewBarsText.Print(colorPreviewBarsString); shadePreviewBarsText.Print(shadePreviewBarsString); shadePreviewText.Print(shadePreviewString); // Position the controls _themePartSettingColorSet.Position = (3, themeY + 2); _themePartSettingIsPredefinedColor.Position = (3, themeY + 3); _themePartSettingIsCustomColor.Position = (3, themeY + 4); _themePartSettingColorSet.IsVisible = true; _themePartSettingIsCustomColor.IsVisible = true; _themePartSettingIsPredefinedColor.IsVisible = true; // Configure controls/shade _themePartSettingIsCustomColor.IsSelected = selectedSetting.IsCustomColor; _themePartSettingIsPredefinedColor.IsSelected = !selectedSetting.IsCustomColor; switch (selectedSetting.Brightness) { case Colors.Brightness.Brightest: shadeBarsString[0].Glyph = 301; shadeBarsString[1].Glyph = 302; break; case Colors.Brightness.Bright: shadeBarsString[2].Glyph = 301; shadeBarsString[3].Glyph = 302; break; case Colors.Brightness.Normal: shadeBarsString[4].Glyph = 301; shadeBarsString[5].Glyph = 302; break; case Colors.Brightness.Dark: shadeBarsString[6].Glyph = 301; shadeBarsString[7].Glyph = 302; break; case Colors.Brightness.Darkest: shadeBarsString[8].Glyph = 301; shadeBarsString[9].Glyph = 302; break; default: break; } _themePartsShadeBoxes.Print(shadeBarsString); Controls.IsDirty = true; }