diff --git a/Editor/AGS.Editor/GUI/LogPanel.Designer.cs b/Editor/AGS.Editor/GUI/LogPanel.Designer.cs index 1fb6286f0ce..8f7bde7622a 100644 --- a/Editor/AGS.Editor/GUI/LogPanel.Designer.cs +++ b/Editor/AGS.Editor/GUI/LogPanel.Designer.cs @@ -100,7 +100,7 @@ private void InitializeComponent() // // toolStrip // - this.toolStrip.ImageScalingSize = new System.Drawing.Size(20, 20); + this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.btnRun, this.btnPause, @@ -113,6 +113,7 @@ private void InitializeComponent() this.btnProperties}); this.toolStrip.Location = new System.Drawing.Point(0, 0); this.toolStrip.Name = "toolStrip"; + this.toolStrip.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); this.toolStrip.Size = new System.Drawing.Size(1059, 27); this.toolStrip.TabIndex = 1; // @@ -212,6 +213,7 @@ private void InitializeComponent() this.Margin = new System.Windows.Forms.Padding(4); this.Name = "LogPanel"; this.Text = "Log Panel"; + this.Load += new System.EventHandler(this.LogPanel_Load); this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); diff --git a/Editor/AGS.Editor/GUI/LogPanel.cs b/Editor/AGS.Editor/GUI/LogPanel.cs index 1e31cd9e7c4..bd5a389ca49 100644 --- a/Editor/AGS.Editor/GUI/LogPanel.cs +++ b/Editor/AGS.Editor/GUI/LogPanel.cs @@ -302,5 +302,29 @@ private void logTextBox_VScroll(object sender, EventArgs e) _glue = IsScrollAtBottom(); } } + + private void LoadColorTheme(ColorTheme t) + { + + t.SetColor("log-panel/background", c => BackColor = c); + t.SetColor("log-panel/splitter", c => splitContainer.BackColor = c); + t.SetColor("log-panel/background", c => logTextBox.BackColor = c); + t.SetColor("log-panel/foreground", c => logTextBox.ForeColor = c); + t.PropertyGridHelper(propertyGrid, "log-panel/grid"); + if (t.Has("tool-bar")) + { + t.SetColor("tool-bar/background", c => toolStrip.BackColor = c); + toolStrip.Renderer = t.GetToolStripRenderer("tool-bar"); + } + } + + private void LogPanel_Load(object sender, EventArgs e) + { + if (!DesignMode) + { + Hacks.SetRichTextBoxMargins(logTextBox, 12, 12); + Factory.GUIController.ColorThemes.Apply(LoadColorTheme); + } + } } } diff --git a/Editor/AGS.Editor/Hacks.cs b/Editor/AGS.Editor/Hacks.cs index 8daefb726ab..29abbcb11a4 100644 --- a/Editor/AGS.Editor/Hacks.cs +++ b/Editor/AGS.Editor/Hacks.cs @@ -18,6 +18,9 @@ public static class Hacks private const int EM_REPLACESEL = 0x00C2; private const int EM_GETSCROLLPOS = WM_USER + 221; private const int EM_SETSCROLLPOS = WM_USER + 222; + private const int EM_SETMARGINS = 0xD3; + private const int EC_LEFTMARGIN = 0x1; + private const int EC_RIGHTMARGIN = 0x2; // TreeView messages private const int TV_FIRST = 0x1100; private const int TVM_GETEDITCONTROL = (TV_FIRST + 15); @@ -89,6 +92,14 @@ public static void ReplaceSelectedText(this RichTextBox rtb, int at, int length, Marshal.FreeHGlobal(strPtr); } + /// + /// Sets RichTextBox's margins + /// + public static void SetRichTextBoxMargins(this RichTextBox rtb, int left, int right) + { + SendMessage(rtb.Handle, EM_SETMARGINS, (EC_LEFTMARGIN | EC_RIGHTMARGIN), (IntPtr)(right * 0x10000 + left)); + } + // Hack to get around the fact that the BeforeLabelEdit event provides no way to // let you change the text they're about to edit public static void SetTreeViewEditText(TreeView tree, string myText)