Subtitle Editor - add a color picker for editing the subtitle color, fixes #1554
This commit is contained in:
parent
38d24901cf
commit
1bf8f80510
|
@ -85,6 +85,7 @@
|
||||||
this.SubGrid.Name = "SubGrid";
|
this.SubGrid.Name = "SubGrid";
|
||||||
this.SubGrid.Size = new System.Drawing.Size(548, 198);
|
this.SubGrid.Size = new System.Drawing.Size(548, 198);
|
||||||
this.SubGrid.TabIndex = 2;
|
this.SubGrid.TabIndex = 2;
|
||||||
|
this.SubGrid.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.SubGrid_CellContentClick);
|
||||||
this.SubGrid.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.SubGrid_DefaultValuesNeeded);
|
this.SubGrid.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.SubGrid_DefaultValuesNeeded);
|
||||||
this.SubGrid.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SubGrid_MouseDoubleClick);
|
this.SubGrid.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SubGrid_MouseDoubleClick);
|
||||||
//
|
//
|
||||||
|
|
|
@ -5,6 +5,7 @@ using System.Windows.Forms;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Client.Common;
|
||||||
|
using BizHawk.Common.NumberExtensions;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
|
@ -256,5 +257,27 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_selectedMovie.Subtitles.AddColorTag = AddColorTag.Checked;
|
_selectedMovie.Subtitles.AddColorTag = AddColorTag.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SubGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||||
|
{
|
||||||
|
if (!_readOnly && e.ColumnIndex == 4)
|
||||||
|
{
|
||||||
|
var color = Color.White;
|
||||||
|
var val = SubGrid[e.ColumnIndex, e.RowIndex].Value;
|
||||||
|
if (val != null)
|
||||||
|
{
|
||||||
|
var hex = int.Parse(val.ToString(), NumberStyles.HexNumber);
|
||||||
|
color = Color.FromArgb(hex);
|
||||||
|
}
|
||||||
|
|
||||||
|
using var picker = new ColorDialog { AllowFullOpen = true, AnyColor = true, Color = color };
|
||||||
|
if (picker.ShowDialog().IsOk())
|
||||||
|
{
|
||||||
|
SubGrid[e.ColumnIndex, e.RowIndex].Value = picker.Color.ToArgb().ToHexString(8);
|
||||||
|
SubGrid[e.ColumnIndex, e.RowIndex].Style.BackColor = picker.Color;
|
||||||
|
SubGrid.RefreshEdit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue