Add button to toggle graphical LED view and default to hidden
This commit is contained in:
parent
ba24efe544
commit
a2ed9571cf
7 changed files with 249 additions and 196 deletions
|
|
@ -390,6 +390,14 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
|
|||
QPainter painter(this);
|
||||
QFont font = painter.font();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| If Device View is hidden, don't paint |
|
||||
\*-----------------------------------------------------*/
|
||||
if(isHidden())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| If controller has resized, reinitialize local data |
|
||||
\*-----------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ OpenRGBDevicePage::OpenRGBDevicePage(RGBController *dev, QWidget *parent) :
|
|||
QPalette pal;
|
||||
|
||||
ui->DeviceViewBox->setController(device);
|
||||
ui->DeviceViewBox->hide();
|
||||
|
||||
device->RegisterUpdateCallback(UpdateCallback, this);
|
||||
|
||||
|
|
@ -1114,3 +1115,13 @@ void Ui::OpenRGBDevicePage::on_ResizeButton_clicked()
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Ui::OpenRGBDevicePage::ShowDeviceView()
|
||||
{
|
||||
ui->DeviceViewBox->show();
|
||||
}
|
||||
|
||||
void Ui::OpenRGBDevicePage::HideDeviceView()
|
||||
{
|
||||
ui->DeviceViewBox->hide();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ public:
|
|||
void UpdateDevice();
|
||||
void UpdateMode();
|
||||
void UpdateModeUi();
|
||||
void ShowDeviceView();
|
||||
void HideDeviceView();
|
||||
|
||||
private slots:
|
||||
void UpdateInterface();
|
||||
|
|
|
|||
|
|
@ -14,138 +14,30 @@
|
|||
<string>Frame</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="10" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="DirectionBox"/>
|
||||
</item>
|
||||
<item row="7" column="6" colspan="2">
|
||||
<widget class="QSpinBox" name="BlueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="10">
|
||||
<widget class="QPushButton" name="ButtonMagenta">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="8">
|
||||
<widget class="QLabel" name="SatLabel">
|
||||
<property name="text">
|
||||
<string>S:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="4">
|
||||
<widget class="QSlider" name="SpeedSlider">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="ValSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5" rowspan="3" colspan="6">
|
||||
<widget class="ColorWheel" name="ColorWheelBox" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<widget class="QLabel" name="GreenLabel">
|
||||
<property name="text">
|
||||
<string>G:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="ColorLabel">
|
||||
<property name="text">
|
||||
<string>Colors:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="HueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>359</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="6" colspan="2">
|
||||
<widget class="QSpinBox" name="GreenSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QRadioButton" name="PerLEDCheck">
|
||||
<property name="text">
|
||||
<string>Per-LED</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="8">
|
||||
<widget class="QLabel" name="HueLabel">
|
||||
<property name="text">
|
||||
<string>H:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="1" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="ZoneBox"/>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="ModeBox"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="ModeLabel">
|
||||
<property name="text">
|
||||
<string>Mode:</string>
|
||||
<item row="6" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="SatSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="6">
|
||||
<widget class="QPushButton" name="ButtonYellow">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="DirectionLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Dir:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="7">
|
||||
<widget class="QPushButton" name="ButtonGreen">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="ZoneLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QLabel" name="RedLabel">
|
||||
<property name="text">
|
||||
<string>R:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="8">
|
||||
<widget class="QLabel" name="ValLabel">
|
||||
<property name="text">
|
||||
<string>V:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="SpeedLabel">
|
||||
<property name="text">
|
||||
<string>Speed:</string>
|
||||
<string>Zone:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -156,24 +48,48 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
<widget class="QLabel" name="BlueLabel">
|
||||
<property name="text">
|
||||
<string>B:</string>
|
||||
<item row="10" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="DirectionBox"/>
|
||||
</item>
|
||||
<item row="7" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="ValSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="5">
|
||||
<widget class="QPushButton" name="ButtonRed">
|
||||
<item row="10" column="9">
|
||||
<widget class="QPushButton" name="ButtonBlue">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="SatSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="ResizeButton">
|
||||
<property name="text">
|
||||
<string>Resize</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="LEDLabel">
|
||||
<property name="text">
|
||||
<string>LED:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="4">
|
||||
<widget class="QSlider" name="SpeedSlider">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="SpeedLabel">
|
||||
<property name="text">
|
||||
<string>Speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -188,49 +104,81 @@
|
|||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="9">
|
||||
<widget class="QPushButton" name="ButtonBlue">
|
||||
<item row="10" column="6">
|
||||
<widget class="QPushButton" name="ButtonYellow">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="8">
|
||||
<widget class="QLabel" name="HueLabel">
|
||||
<property name="text">
|
||||
<string>H:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="ModeLabel">
|
||||
<property name="text">
|
||||
<string>Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QRadioButton" name="PerLEDCheck">
|
||||
<property name="text">
|
||||
<string>Per-LED</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="7">
|
||||
<widget class="QPushButton" name="ButtonGreen">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="ColorLabel">
|
||||
<property name="text">
|
||||
<string>Colors:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="6" colspan="2">
|
||||
<widget class="QSpinBox" name="GreenSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="5">
|
||||
<widget class="QPushButton" name="ButtonRed">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="9" colspan="2">
|
||||
<widget class="QSpinBox" name="HueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>359</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="LEDBox"/>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="ZoneBox"/>
|
||||
</item>
|
||||
<item row="6" column="2" colspan="2">
|
||||
<widget class="QRadioButton" name="ModeSpecificCheck">
|
||||
<property name="text">
|
||||
<string>Mode-Specific</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="LEDLabel">
|
||||
<property name="text">
|
||||
<string>LED:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QRadioButton" name="RandomCheck">
|
||||
<property name="text">
|
||||
<string>Random</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="DirectionLabel">
|
||||
<property name="text">
|
||||
<string>Dir:</string>
|
||||
<item row="7" column="6" colspan="2">
|
||||
<widget class="QSpinBox" name="BlueSpinBox">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -241,17 +189,31 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="ResizeButton">
|
||||
<item row="7" column="8">
|
||||
<widget class="QLabel" name="ValLabel">
|
||||
<property name="text">
|
||||
<string>Resize</string>
|
||||
<string>V:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="ZoneLabel">
|
||||
<item row="5" column="5">
|
||||
<widget class="QLabel" name="RedLabel">
|
||||
<property name="text">
|
||||
<string>Zone:</string>
|
||||
<string>R:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QRadioButton" name="RandomCheck">
|
||||
<property name="text">
|
||||
<string>Random</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="8">
|
||||
<widget class="QLabel" name="SatLabel">
|
||||
<property name="text">
|
||||
<string>S:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -262,6 +224,44 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
<widget class="QLabel" name="BlueLabel">
|
||||
<property name="text">
|
||||
<string>B:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2" colspan="2">
|
||||
<widget class="QRadioButton" name="ModeSpecificCheck">
|
||||
<property name="text">
|
||||
<string>Mode-Specific</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="10">
|
||||
<widget class="QPushButton" name="ButtonMagenta">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<widget class="QLabel" name="GreenLabel">
|
||||
<property name="text">
|
||||
<string>G:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5" rowspan="3" colspan="6">
|
||||
<widget class="ColorWheel" name="ColorWheelBox" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ OpenRGBDialog2::OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vec
|
|||
SMBusToolsPage = NULL;
|
||||
SoftInfoPage = NULL;
|
||||
|
||||
ui->ButtonToggleDeviceView->setVisible(false);
|
||||
ui->ButtonLoadProfile->setVisible(false);
|
||||
ui->ButtonSaveProfile->setVisible(false);
|
||||
ui->ButtonDeleteProfile->setVisible(false);
|
||||
|
|
@ -452,6 +453,7 @@ void OpenRGBDialog2::on_ClientListUpdated()
|
|||
ui->DetectionProgressBar->setVisible(false);
|
||||
ui->DetectionProgressLabel->setVisible(false);
|
||||
|
||||
ui->ButtonToggleDeviceView->setVisible(true);
|
||||
ui->ButtonLoadProfile->setVisible(true);
|
||||
ui->ButtonSaveProfile->setVisible(true);
|
||||
ui->ButtonDeleteProfile->setVisible(true);
|
||||
|
|
@ -586,3 +588,23 @@ void Ui::OpenRGBDialog2::on_ButtonDeleteProfile_clicked()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Ui::OpenRGBDialog2::on_ButtonToggleDeviceView_clicked()
|
||||
{
|
||||
if(device_view_showing)
|
||||
{
|
||||
for(int device = 0; device < ui->DevicesTabBar->count(); device++)
|
||||
{
|
||||
qobject_cast<OpenRGBDevicePage *>(ui->DevicesTabBar->widget(device))->HideDeviceView();
|
||||
}
|
||||
device_view_showing = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int device = 0; device < ui->DevicesTabBar->count(); device++)
|
||||
{
|
||||
qobject_cast<OpenRGBDevicePage *>(ui->DevicesTabBar->widget(device))->ShowDeviceView();
|
||||
}
|
||||
device_view_showing = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ private:
|
|||
void UpdateProfileList();
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
bool device_view_showing = false;
|
||||
|
||||
private slots:
|
||||
void on_Exit();
|
||||
void on_LightsOff();
|
||||
|
|
@ -90,6 +92,7 @@ private slots:
|
|||
void on_ButtonSaveProfile_clicked();
|
||||
void on_ButtonLoadProfile_clicked();
|
||||
void on_ButtonDeleteProfile_clicked();
|
||||
void on_ButtonToggleDeviceView_clicked();
|
||||
};
|
||||
|
||||
#endif // OPENRGBDIALOG2_H
|
||||
|
|
|
|||
|
|
@ -15,7 +15,28 @@
|
|||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0" colspan="4">
|
||||
<item row="3" column="2" colspan="3">
|
||||
<widget class="QProgressBar" name="DetectionProgressBar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QPushButton" name="ButtonDeleteProfile">
|
||||
<property name="text">
|
||||
<string>Delete Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="ButtonLoadProfile">
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="5">
|
||||
<widget class="QTabWidget" name="MainTabBar">
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
|
|
@ -62,30 +83,6 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="ButtonDeleteProfile">
|
||||
<property name="text">
|
||||
<string>Delete Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QComboBox" name="ProfileBox"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="ButtonLoadProfile">
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="ButtonSaveProfile">
|
||||
<property name="text">
|
||||
<string>Save Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="DetectionProgressLabel">
|
||||
<property name="text">
|
||||
|
|
@ -96,10 +93,20 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QProgressBar" name="DetectionProgressBar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
<item row="5" column="4">
|
||||
<widget class="QComboBox" name="ProfileBox"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="ButtonToggleDeviceView">
|
||||
<property name="text">
|
||||
<string>Toggle LED View</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="ButtonSaveProfile">
|
||||
<property name="text">
|
||||
<string>Save Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue