Add Lights Off option to tray icon menu

This commit is contained in:
Adam Honse
2020-01-06 15:30:45 -06:00
parent dbf3dd86b4
commit f8212ca59e
2 changed files with 11 additions and 1 deletions

View File

@@ -22,7 +22,11 @@ OpenRGBDialog2::OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vec
QAction* actionShowHide = new QAction("Show/Hide", this);
connect(actionShowHide, SIGNAL(triggered()), this, SLOT(on_ShowHide()));
trayIconMenu->addAction(actionShowHide);
QAction* actionLightsOff = new QAction("Lights Off", this);
connect(actionLightsOff, SIGNAL(triggered()), this, SLOT(on_LightsOff()));
trayIconMenu->addAction(actionLightsOff);
QAction* actionExit = new QAction( "Exit", this );
connect( actionExit, SIGNAL( triggered() ), this, SLOT( on_Exit() ));
trayIconMenu->addAction(actionExit);
@@ -179,6 +183,11 @@ void OpenRGBDialog2::on_Exit()
close();
}
void OpenRGBDialog2::on_LightsOff()
{
on_SetAllDevices(0, 0, 0);
}
void OpenRGBDialog2::on_SetAllDevices(unsigned char red, unsigned char green, unsigned char blue)
{
for(int device = 0; device < ui->DevicesTabBar->count(); device++)

View File

@@ -38,6 +38,7 @@ private:
private slots:
void on_Exit();
void on_LightsOff();
void on_SetAllDevices(unsigned char red, unsigned char green, unsigned char blue);
void on_ShowHide();
};