#1267 Fix Set All Devices function turns off all lights when windows number format is not in English
This commit is contained in:
parent
1568d6f612
commit
f01557a3fa
1 changed files with 9 additions and 26 deletions
|
|
@ -917,6 +917,7 @@ void Ui::OpenRGBDevicePage::UpdateDevice()
|
|||
|
||||
void Ui::OpenRGBDevicePage::SetCustomMode(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
RGBColor color = ToRGBColor(red, green, blue);
|
||||
/*-----------------------------------------------------*\
|
||||
| Set the selected mode to the custom mode and update UI|
|
||||
\*-----------------------------------------------------*/
|
||||
|
|
@ -945,37 +946,19 @@ void Ui::OpenRGBDevicePage::SetCustomMode(unsigned char red, unsigned char green
|
|||
switch(device->modes[selected_mode].color_mode)
|
||||
{
|
||||
case MODE_COLORS_PER_LED:
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Set all device LEDs to the current color |
|
||||
\*-----------------------------------------------------*/
|
||||
RGBColor color = ToRGBColor(
|
||||
ui->RedSpinBox->text().toInt(),
|
||||
ui->GreenSpinBox->text().toInt(),
|
||||
ui->BlueSpinBox->text().toInt()
|
||||
);
|
||||
|
||||
device->SetAllLEDs(color);
|
||||
}
|
||||
break;
|
||||
{
|
||||
device->SetAllLEDs(color);
|
||||
}
|
||||
break;
|
||||
|
||||
case MODE_COLORS_MODE_SPECIFIC:
|
||||
{
|
||||
for(std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Set all device LEDs to the current color |
|
||||
\*-----------------------------------------------------*/
|
||||
RGBColor color = ToRGBColor(
|
||||
ui->RedSpinBox->text().toInt(),
|
||||
ui->GreenSpinBox->text().toInt(),
|
||||
ui->BlueSpinBox->text().toInt()
|
||||
);
|
||||
|
||||
for(std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
|
||||
{
|
||||
device->modes[selected_mode].colors[i] = color;
|
||||
}
|
||||
device->modes[selected_mode].colors[i] = color;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue