| 1619 | } |
| 1620 | |
| 1621 | void Ui::OpenRGBDevicePage::colorChanged() |
| 1622 | { |
| 1623 | updateColorUi(); |
| 1624 | |
| 1625 | if(autoUpdateEnabled()) |
| 1626 | { |
| 1627 | unsigned int selected_mode = (unsigned int)ui->ModeBox->currentIndex(); |
| 1628 | |
| 1629 | /*-----------------------------------------------------------------*\ |
| 1630 | | OpenRGB's RGBColor is stored differently than Qt's qrgb type, | |
| 1631 | | so casting between them doesn't work | |
| 1632 | \*-----------------------------------------------------------------*/ |
| 1633 | RGBColor rgb_color = ToRGBColor(current_color.red(), current_color.green(), current_color.blue()); |
| 1634 | |
| 1635 | switch(device->modes[selected_mode].color_mode) |
| 1636 | { |
| 1637 | case MODE_COLORS_PER_LED: |
| 1638 | { |
| 1639 | ui->DeviceViewBox->setSelectionColor(rgb_color); |
| 1640 | break; |
| 1641 | } |
| 1642 | |
| 1643 | case MODE_COLORS_MODE_SPECIFIC: |
| 1644 | { |
| 1645 | unsigned int index = ui->LEDBox->currentIndex(); |
| 1646 | |
| 1647 | device->modes[selected_mode].colors[index] = rgb_color; |
| 1648 | device->UpdateMode(); |
| 1649 | break; |
| 1650 | } |
| 1651 | } |
| 1652 | } |
| 1653 | } |
| 1654 | |
| 1655 | void Ui::OpenRGBDevicePage::updateColorUi() |
| 1656 | { |
nothing calls this directly
no test coverage detected