From 9c0108e5dc43b9ae9b8f561f4bc3c40499b247d5 Mon Sep 17 00:00:00 2001 From: creazyboyone <1020401390@qq.com> Date: Fri, 15 May 2020 00:11:04 +0800 Subject: [PATCH] modify color rgb->argb --- DSTEd/Core/Configuration.cs | 2 +- DSTEd/Core/Contents/Editors/Code.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DSTEd/Core/Configuration.cs b/DSTEd/Core/Configuration.cs index 8c89552..e308c4d 100644 --- a/DSTEd/Core/Configuration.cs +++ b/DSTEd/Core/Configuration.cs @@ -84,7 +84,7 @@ public Color GetColor(string name, Color defaults) { if (!s.Equals("")) { string[] c = s.Split(','); - return Color.FromRgb(byte.Parse(c[0]), byte.Parse(c[1]), byte.Parse(c[2])); + return Color.FromArgb(byte.Parse(c[0]), byte.Parse(c[1]), byte.Parse(c[2]), byte.Parse(c[3])); } else { return defaults; diff --git a/DSTEd/Core/Contents/Editors/Code.cs b/DSTEd/Core/Contents/Editors/Code.cs index ec733d6..0e6c0de 100644 --- a/DSTEd/Core/Contents/Editors/Code.cs +++ b/DSTEd/Core/Contents/Editors/Code.cs @@ -30,8 +30,8 @@ public Code(Document document) { this.ShowLineNumbers = config.GetBool("Editor_ShowLineNumbers", true); this.FontFamily = new FontFamily(config.Get("Editor_FontFamily", "Consolas")); this.FontSize = config.GetDouble("Editor_FontSize", 14); - this.Background = new SolidColorBrush(config.GetColor("Editor_Background", Color.FromRgb(37, 37, 38))); - this.Foreground = new SolidColorBrush(config.GetColor("Editor_Foreground", Color.FromRgb(248, 248, 242))); + this.Background = new SolidColorBrush(config.GetColor("Editor_Background", Color.FromArgb(255, 34, 34, 35))); + this.Foreground = new SolidColorBrush(config.GetColor("Editor_Foreground", Color.FromArgb(255, 248, 248, 242))); TextEditorOptions options = new TextEditorOptions(); options.AllowScrollBelowDocument = true; @@ -46,6 +46,8 @@ public Code(Document document) { this.TextArea.TextEntered += OnEntered; completion = new CompletionWindow(this.TextArea); OnInit(); + + this.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.CSharp.CSharpIndentationStrategy(); new XmlFoldingStrategy().UpdateFoldings(FoldingManager.Install(this.TextArea), this.Document); } static Code()//run once,to initialize basic completions