mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Feature #663: dark background for textbox input when editing bright-colored text
This commit is contained in:
parent
d69e65f7d7
commit
ee3569ed2d
2 changed files with 19 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes textbox background dark if text color is very bright
|
||||
/// </summary>
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue