From ee3569ed2de7de76c823b71c9407f1e992e00e44 Mon Sep 17 00:00:00 2001 From: JKlingen Date: Sun, 15 Dec 2013 17:10:34 +0100 Subject: [PATCH] Feature #663: dark background for textbox input when editing bright-colored text --- Greenshot/Drawing/TextContainer.cs | 14 ++++++++++++++ .../releases/additional_files/readme.txt.template | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/Greenshot/Drawing/TextContainer.cs b/Greenshot/Drawing/TextContainer.cs index 2d8946079..5a0f71c6a 100644 --- a/Greenshot/Drawing/TextContainer.cs +++ b/Greenshot/Drawing/TextContainer.cs @@ -162,6 +162,7 @@ namespace Greenshot.Drawing { private void CreateTextBox() { textBox = new TextBox(); + textBox.ImeMode = ImeMode.On; textBox.Multiline = true; textBox.AcceptsTab = true; @@ -176,9 +177,22 @@ namespace Greenshot.Drawing { private void ShowTextBox() { parent.KeysLocked = true; parent.Controls.Add(textBox); + EnsureTextBoxContrast(); textBox.Show(); textBox.Focus(); } + + /// + /// Makes textbox background dark if text color is very bright + /// + private void EnsureTextBoxContrast() { + Color lc = this.GetFieldValueAsColor(FieldType.LINE_COLOR); + if (lc.R > 203 && lc.G > 203 && lc.B > 203) { + textBox.BackColor = Color.FromArgb(51, 51, 51); + } else { + textBox.BackColor = Color.White; + } + } private void HideTextBox() { parent.Focus(); diff --git a/Greenshot/releases/additional_files/readme.txt.template b/Greenshot/releases/additional_files/readme.txt.template index f1b91bc85..17912e682 100644 --- a/Greenshot/releases/additional_files/readme.txt.template +++ b/Greenshot/releases/additional_files/readme.txt.template @@ -4,6 +4,11 @@ CHANGE LOG: @GITDETAILVERSION@ Bugfix Release +Features: +* Feature #663: dark background for textbox input when editing bright-colored text + +1.1.7 build 17 Bugfix Release + Changes: * We moved our repository to BitBucket (GIT), this forced us to change the build script and the version