Restrict segment editing to all linear zones only if device is an LED Strip type

This commit is contained in:
Adam Honse 2023-03-29 21:43:37 -05:00
parent c3c7c1fcbf
commit 0adfa7ea87

View file

@ -307,9 +307,24 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int index)
}
/*-------------------------------------*\
| Enable resizing if zone is LINEAR |
| Enable editing if: |
| Zone has variable size |
| OR |
| Zone is LINEAR and device type is |
| LEDSTRIP |
\*-------------------------------------*/
bool zone_is_editable = (device->zones[selected_zone].type == ZONE_TYPE_LINEAR);
bool zone_is_editable = false;
if(device->zones[selected_zone].leds_min != device->zones[selected_zone].leds_max)
{
zone_is_editable = true;
}
if((device->zones[selected_zone].type == ZONE_TYPE_LINEAR) && (device->type == DEVICE_TYPE_LEDSTRIP))
{
zone_is_editable = true;
}
ui->EditZoneButton->setEnabled(zone_is_editable);
if(!ui->ZoneBox->signalsBlocked())