diff --git a/qt/OpenRGBDevicePage.cpp b/qt/OpenRGBDevicePage.cpp index 62e3e4c7..c53b353a 100644 --- a/qt/OpenRGBDevicePage.cpp +++ b/qt/OpenRGBDevicePage.cpp @@ -341,7 +341,7 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index) | Update color picker with color of selected mode | \*-----------------------------------------------------*/ RGBColor color = device->modes[selected_mode].colors[index]; - + current_color.setRgb(RGBGetRValue(color), RGBGetGValue(color), RGBGetBValue(color)); updateColorUi(); @@ -486,7 +486,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi() ui->SpeedSlider->setMaximum(device->modes[selected_mode].speed_max); current_speed = device->modes[selected_mode].speed; } - + ui->SpeedSlider->setValue(current_speed); ui->SpeedSlider->setEnabled(true); ui->SpeedSlider->blockSignals(false); @@ -533,7 +533,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi() ui->DirectionBox->blockSignals(true); ui->DirectionBox->clear(); - + if(supports_dir_lr) { ui->DirectionBox->addItem(tr("Left")); @@ -599,14 +599,18 @@ void Ui::OpenRGBDevicePage::UpdateModeUi() { ui->DirectionBox->setEnabled(false); } - + ui->DirectionBox->blockSignals(false); if(supports_per_led) { ui->PerLEDCheck->setEnabled(true); ui->PerLEDCheck->setChecked(per_led); - ui->DeviceViewBox->setPerLED(true); + + if(DeviceViewShowing) + { + ui->DeviceViewBoxFrame->show(); + } } else { @@ -614,7 +618,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi() ui->PerLEDCheck->setAutoExclusive(false); ui->PerLEDCheck->setChecked(false); ui->PerLEDCheck->setAutoExclusive(true); - ui->DeviceViewBox->setPerLED(false); + ui->DeviceViewBoxFrame->hide(); } if(supports_mode_specific) @@ -995,7 +999,7 @@ void Ui::OpenRGBDevicePage::on_SatSpinBox_valueChanged(int sat) int hue = current_color.hue(); int val = current_color.value(); current_color.setHsv(hue, sat, val); - + colorChanged(); } @@ -1010,7 +1014,7 @@ void Ui::OpenRGBDevicePage::on_ValSpinBox_valueChanged(int val) int hue = current_color.hue(); int sat = current_color.saturation(); current_color.setHsv(hue, sat, val); - + colorChanged(); } @@ -1127,11 +1131,22 @@ void Ui::OpenRGBDevicePage::on_ResizeButton_clicked() void Ui::OpenRGBDevicePage::ShowDeviceView() { - ui->DeviceViewBoxFrame->show(); + /*-----------------------------------------------------*\ + | Read selected mode | + \*-----------------------------------------------------*/ + unsigned int selected_mode = (unsigned int)ui->ModeBox->currentIndex(); + + DeviceViewShowing = true; + + if(device->modes[selected_mode].flags & MODE_FLAG_HAS_PER_LED_COLOR) + { + ui->DeviceViewBoxFrame->show(); + } } void Ui::OpenRGBDevicePage::HideDeviceView() { + DeviceViewShowing = false; ui->DeviceViewBoxFrame->hide(); } @@ -1211,7 +1226,7 @@ void Ui::OpenRGBDevicePage::colorChanged() switch(device->modes[selected_mode].color_mode) { - case MODE_COLORS_PER_LED: + case MODE_COLORS_PER_LED: { ui->DeviceViewBox->setSelectionColor(rgb_color); break; diff --git a/qt/OpenRGBDevicePage.h b/qt/OpenRGBDevicePage.h index ae67caaa..879a0d49 100644 --- a/qt/OpenRGBDevicePage.h +++ b/qt/OpenRGBDevicePage.h @@ -66,6 +66,7 @@ private: bool InvertedSpeed = false; bool InvertedBrightness = false; bool MultipleSelected = false; + bool DeviceViewShowing = false; QColor current_color; void updateColorUi();