Skip to content

Commit ca40ee4

Browse files
author
Pavel Kovalenko
committed
Use NumericSlider instead of IntegerSlider in ColorPicker control.
1 parent cb0726f commit ca40ee4

File tree

2 files changed

+96
-100
lines changed

2 files changed

+96
-100
lines changed

src/editors/xrSdkControls/Controls/ColorPicker/ColorPicker.Designer.cs

Lines changed: 83 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/editors/xrSdkControls/Controls/ColorPicker/ColorPicker.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,30 @@ public bool Hexadecimal
4343
return;
4444
hexadecimal = value;
4545
chkHexadecimal.Checked = value;
46-
islRed.Hexadecimal = value;
47-
islGreen.Hexadecimal = value;
48-
islBlue.Hexadecimal = value;
49-
islAlpha.Hexadecimal = value;
46+
nslRed.Hexadecimal = value;
47+
nslGreen.Hexadecimal = value;
48+
nslBlue.Hexadecimal = value;
49+
nslAlpha.Hexadecimal = value;
5050
}
5151
}
5252

5353
private void ColorPicker_Load(object sender, EventArgs e)
5454
{
55-
islRed.ValueChanged += (obj, args) => UpdateColor();
56-
islGreen.ValueChanged += (obj, args) => UpdateColor();
57-
islBlue.ValueChanged += (obj, args) => UpdateColor();
58-
islAlpha.ValueChanged += (obj, args) => UpdateColor();
55+
nslRed.ValueChanged += (obj, args) => UpdateColor();
56+
nslGreen.ValueChanged += (obj, args) => UpdateColor();
57+
nslBlue.ValueChanged += (obj, args) => UpdateColor();
58+
nslAlpha.ValueChanged += (obj, args) => UpdateColor();
5959
chkHexadecimal.CheckedChanged += (obj, args) => Hexadecimal = chkHexadecimal.Checked;
6060
UpdateColor();
6161
}
6262

6363
private void UpdateColor()
6464
{
65-
var newColor = Color.FromArgb(islAlpha.Value, islRed.Value, islGreen.Value, islBlue.Value);
65+
var newColor = Color.FromArgb(
66+
Convert.ToInt32(nslAlpha.Value),
67+
Convert.ToInt32(nslRed.Value),
68+
Convert.ToInt32(nslGreen.Value),
69+
Convert.ToInt32(nslBlue.Value));
6670
if (pbColor.ColorSample == newColor)
6771
return;
6872
pbColor.ColorSample = newColor;

0 commit comments

Comments
 (0)