From cfb47116928fc82a4d504c087afeb4a35b580649 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 18 Nov 2014 22:32:55 +0100 Subject: [PATCH] Fix for BUG-1698: the focus lost event on the editor element "font family" caused the key handling for the element (l -> line etc) to be active again, this change suppresses this. --- Greenshot/Drawing/TextContainer.cs | 31 ++++++++++--------- .../additional_files/readme.txt.template | 1 + 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Greenshot/Drawing/TextContainer.cs b/Greenshot/Drawing/TextContainer.cs index b17e14665..46a9dd4ef 100644 --- a/Greenshot/Drawing/TextContainer.cs +++ b/Greenshot/Drawing/TextContainer.cs @@ -154,8 +154,11 @@ namespace Greenshot.Drawing { if (e.PropertyName.Equals("Selected")) { if (!Selected && _textBox.Visible) { HideTextBox(); - } else if (Selected && Status==EditStatus.DRAWING) { + } else if (Selected && Status == EditStatus.DRAWING) { ShowTextBox(); + } else if (Selected && Status == EditStatus.IDLE && _textBox.Visible) { + // Fix (workaround) for BUG-1698 + _parent.KeysLocked = true; } } if (_textBox.Visible) { @@ -184,7 +187,7 @@ namespace Greenshot.Drawing { private void CreateTextBox() { _textBox = new TextBox(); - + _textBox.ImeMode = ImeMode.On; _textBox.Multiline = true; _textBox.AcceptsTab = true; @@ -199,22 +202,22 @@ namespace Greenshot.Drawing { private void ShowTextBox() { _parent.KeysLocked = true; _parent.Controls.Add(_textBox); - EnsureTextBoxContrast(); + EnsureTextBoxContrast(); _textBox.Show(); _textBox.Focus(); } - /// - /// Makes textbox background dark if text color is very bright - /// - private void EnsureTextBoxContrast() { - Color lc = 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; - } - } + /// + /// Makes textbox background dark if text color is very bright + /// + private void EnsureTextBoxContrast() { + Color lc = 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 a8acebcb7..7d4c3d23e 100644 --- a/Greenshot/releases/additional_files/readme.txt.template +++ b/Greenshot/releases/additional_files/readme.txt.template @@ -15,6 +15,7 @@ Changes: Bugs Resolved: * BUG-1686: Shadow (drop shadow or torn edge) grows if a filter (highlight etc) is used and an element is moved around +* BUG-1698: Cannot enter textbox/Speechbubble lowercase text after changing font family * BUG-1700: IE capture only works once