Skip to content

Commit

Permalink
Version bumped to v1.1.1. Exex color is now properly shown in picker …
Browse files Browse the repository at this point in the history
…when the 'invert' checkbox is set
  • Loading branch information
adriangl committed Apr 4, 2015
1 parent 1a1c7ff commit 69ab19f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions DissDlcToolkit/Forms/MainFormExexUserControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,33 +163,34 @@ private void selectColorAndUpdate(Label label, TextBox textBox, bool invertColor
{
if (labelBoxesEnabled)
{
Color backColor = openColorDialog(label.BackColor, invertColor);
Color backColor = openColorDialog(label.BackColor);
updateColorData(backColor, label, textBox, invertColor, applyAlpha);
}
}

private void updateColorData(Color backColor, Label colorLabel, TextBox colorTextBox,
Boolean invert, Boolean applyAlpha)
{
Color colorToApply = invert ? MiscUtils.invertColor(backColor) : backColor;
Color colorToApply = backColor;
if (!applyAlpha)
{
colorToApply = Color.FromArgb(0xFF, colorToApply.R, colorToApply.G, colorToApply.B);
}

colorLabel.BackColor = colorToApply;
colorTextBox.Text = applyAlpha ? MiscUtils.argbToString(backColor) : MiscUtils.rgbToString(backColor);
Color colorToShowInTextBox = invert ? MiscUtils.invertColor(backColor) : backColor;
colorTextBox.Text = applyAlpha ? MiscUtils.argbToString(colorToShowInTextBox) : MiscUtils.rgbToString(colorToShowInTextBox);
}

private Color openColorDialog(Color currentColor, Boolean invertColor)
private Color openColorDialog(Color currentColor)
{
ArgbColorDialog dialog = new ArgbColorDialog();
// Sets the initial color select to the current text color.
dialog.Color = invertColor ? MiscUtils.invertColor(currentColor) : currentColor;
dialog.Color = currentColor;
dialog.ShowDialog();

// Update the text box color
return dialog.Color;

}

private void populateFields(ExexTable table)
Expand Down
4 changes: 2 additions & 2 deletions DissDlcToolkit/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Puede especificar todos los valores o establecer como predeterminados los números de compilación y de revisión
// mediante el carácter '*', como se muestra a continuación:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: AssemblyVersion("1.1.1")]
[assembly: AssemblyFileVersion("1.1.1")]

0 comments on commit 69ab19f

Please sign in to comment.