diff --git a/qt/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2.cpp index 974c0667..7ec22a49 100644 --- a/qt/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2.cpp @@ -11,48 +11,55 @@ using namespace Ui; -static QString GetIconString(device_type type) +static QString GetIconString(device_type type, bool dark) { /*-----------------------------------------------------*\ | Return the icon filename string for the given device | | type value | \*-----------------------------------------------------*/ + QString filename; switch(type) { case DEVICE_TYPE_MOTHERBOARD: - return("motherboard.png"); + filename = "motherboard"; break; case DEVICE_TYPE_DRAM: - return("dram.png"); + filename = "dram"; break; case DEVICE_TYPE_GPU: - return("gpu.png"); + filename = "gpu"; break; case DEVICE_TYPE_COOLER: - return("fan.png"); + filename = "fan"; break; case DEVICE_TYPE_LEDSTRIP: - return("ledstrip.png"); + filename = "ledstrip"; break; case DEVICE_TYPE_KEYBOARD: - return("keyboard.png"); + filename = "keyboard"; break; case DEVICE_TYPE_MOUSE: - return("mouse.png"); + filename = "mouse"; break; case DEVICE_TYPE_MOUSEMAT: - return("mousemat.png"); + filename = "mousemat"; break; case DEVICE_TYPE_HEADSET: - return("headset.png"); + filename = "headset"; break; case DEVICE_TYPE_HEADSET_STAND: - return("headsetstand.png"); + filename = "headsetstand"; break; - case DEVICE_TYPE_UNKNOWN: - return("unknown.png"); + default: + filename = "unknown"; break; } + if(dark) + { + filename += "_dark"; + } + filename += ".png"; + return filename; } static void UpdateInfoCallback(void * this_ptr) @@ -152,6 +159,7 @@ OpenRGBDialog2::OpenRGBDialog2(std::vector& bus, std::vec trayIcon->setToolTip("OpenRGB"); trayIcon->setContextMenu(trayIconMenu); trayIcon->show(); + darkTheme = palette().window().color().value() < 127; // Adjust /*-----------------------------------------------------*\ | Update the profile list | @@ -185,8 +193,9 @@ void OpenRGBDialog2::AddSoftwareInfoPage() ui->InformationTabBar->addTab(SoftInfoPage, ""); QString SoftwareLabelString = "
Software
"; + SoftwareLabelString += ":/software"; + if(darkTheme) SoftwareLabelString += "_dark"; + SoftwareLabelString += ".png' height='16' width='16'>Software"; QLabel *SoftwareTabLabel = new QLabel(); SoftwareTabLabel->setText(SoftwareLabelString); @@ -211,8 +220,9 @@ void OpenRGBDialog2::AddI2CToolsPage() ui->InformationTabBar->addTab(SMBusToolsPage, ""); QString SMBusToolsLabelString = "
SMBus Tools
"; + SMBusToolsLabelString += ":/tools"; + if(darkTheme) SMBusToolsLabelString += "_dark"; + SMBusToolsLabelString += ".png' height='16' width='16'>SMBus Tools"; QLabel *SMBusToolsTabLabel = new QLabel(); SMBusToolsTabLabel->setText(SMBusToolsLabelString); @@ -314,7 +324,7 @@ void OpenRGBDialog2::UpdateDevicesList() | type and append device name string. | \*-----------------------------------------------------*/ QString NewLabelString = "
" + QString::fromStdString(controllers[dev_idx]->name) + "
"; QLabel *NewTabLabel = new QLabel(); @@ -341,7 +351,7 @@ void OpenRGBDialog2::UpdateDevicesList() | type and append device name string. | \*-----------------------------------------------------*/ QString NewLabelString = "
" + QString::fromStdString(controllers[dev_idx]->name) + "
"; QLabel *NewTabLabel = new QLabel(); diff --git a/qt/OpenRGBDialog2.h b/qt/OpenRGBDialog2.h index a6a05dc1..38ecdf00 100644 --- a/qt/OpenRGBDialog2.h +++ b/qt/OpenRGBDialog2.h @@ -73,6 +73,7 @@ private: void closeEvent(QCloseEvent *event); bool device_view_showing = false; + bool darkTheme = false; private slots: void on_Exit(); diff --git a/qt/dram.png b/qt/dram.png index 9fdeb2fd..1353b020 100644 Binary files a/qt/dram.png and b/qt/dram.png differ diff --git a/qt/dram_dark.png b/qt/dram_dark.png new file mode 100644 index 00000000..6cc6b6dd Binary files /dev/null and b/qt/dram_dark.png differ diff --git a/qt/fan.png b/qt/fan.png index 678b4e6a..20ecbb0c 100644 Binary files a/qt/fan.png and b/qt/fan.png differ diff --git a/qt/fan_dark.png b/qt/fan_dark.png new file mode 100644 index 00000000..d1ddcbec Binary files /dev/null and b/qt/fan_dark.png differ diff --git a/qt/gpu.png b/qt/gpu.png index 46c499b6..a386ae38 100644 Binary files a/qt/gpu.png and b/qt/gpu.png differ diff --git a/qt/gpu_dark.png b/qt/gpu_dark.png new file mode 100644 index 00000000..0a690e00 Binary files /dev/null and b/qt/gpu_dark.png differ diff --git a/qt/headset.png b/qt/headset.png index ee2044fe..84e1261b 100644 Binary files a/qt/headset.png and b/qt/headset.png differ diff --git a/qt/headset_dark.png b/qt/headset_dark.png new file mode 100644 index 00000000..08f1cfe0 Binary files /dev/null and b/qt/headset_dark.png differ diff --git a/qt/headsetstand.png b/qt/headsetstand.png index eff6c3d1..0b15d614 100644 Binary files a/qt/headsetstand.png and b/qt/headsetstand.png differ diff --git a/qt/headsetstand_dark.png b/qt/headsetstand_dark.png new file mode 100644 index 00000000..9bf9d3e7 Binary files /dev/null and b/qt/headsetstand_dark.png differ diff --git a/qt/keyboard.png b/qt/keyboard.png index 913f019d..58466d04 100644 Binary files a/qt/keyboard.png and b/qt/keyboard.png differ diff --git a/qt/keyboard_dark.png b/qt/keyboard_dark.png new file mode 100644 index 00000000..e400d29d Binary files /dev/null and b/qt/keyboard_dark.png differ diff --git a/qt/ledstrip.png b/qt/ledstrip.png index 943cb3e7..3d3335da 100644 Binary files a/qt/ledstrip.png and b/qt/ledstrip.png differ diff --git a/qt/ledstrip_dark.png b/qt/ledstrip_dark.png new file mode 100644 index 00000000..acfcfc21 Binary files /dev/null and b/qt/ledstrip_dark.png differ diff --git a/qt/motherboard.png b/qt/motherboard.png index e95b114b..aded29d4 100644 Binary files a/qt/motherboard.png and b/qt/motherboard.png differ diff --git a/qt/motherboard_dark.png b/qt/motherboard_dark.png new file mode 100644 index 00000000..5fdc9325 Binary files /dev/null and b/qt/motherboard_dark.png differ diff --git a/qt/mouse.png b/qt/mouse.png index 7727a588..5b53631a 100644 Binary files a/qt/mouse.png and b/qt/mouse.png differ diff --git a/qt/mouse_dark.png b/qt/mouse_dark.png new file mode 100644 index 00000000..0cb32b38 Binary files /dev/null and b/qt/mouse_dark.png differ diff --git a/qt/mousemat.png b/qt/mousemat.png index fc6cc1cf..0e482aac 100644 Binary files a/qt/mousemat.png and b/qt/mousemat.png differ diff --git a/qt/mousemat_dark.png b/qt/mousemat_dark.png new file mode 100644 index 00000000..f1a7b8a9 Binary files /dev/null and b/qt/mousemat_dark.png differ diff --git a/qt/resources.qrc b/qt/resources.qrc index 955c16ae..c3e0e487 100644 --- a/qt/resources.qrc +++ b/qt/resources.qrc @@ -13,5 +13,17 @@ headsetstand.png tools.png software.png + dram_dark.png + fan_dark.png + gpu_dark.png + headset_dark.png + headsetstand_dark.png + keyboard_dark.png + ledstrip_dark.png + mousemat_dark.png + mouse_dark.png + motherboard_dark.png + software_dark.png + tools_dark.png diff --git a/qt/software.png b/qt/software.png index 54c99262..b055e2a7 100644 Binary files a/qt/software.png and b/qt/software.png differ diff --git a/qt/software_dark.png b/qt/software_dark.png new file mode 100644 index 00000000..dd11cdf4 Binary files /dev/null and b/qt/software_dark.png differ diff --git a/qt/tools.png b/qt/tools.png index 9e14ed05..4f303a02 100644 Binary files a/qt/tools.png and b/qt/tools.png differ diff --git a/qt/tools_dark.png b/qt/tools_dark.png new file mode 100644 index 00000000..b2813d4d Binary files /dev/null and b/qt/tools_dark.png differ