diff --git a/qt/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2.cpp index 974c06674..7ec22a493 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 a6a05dc15..38ecdf00b 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 9fdeb2fd6..1353b020f 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 000000000..6cc6b6dd4 Binary files /dev/null and b/qt/dram_dark.png differ diff --git a/qt/fan.png b/qt/fan.png index 678b4e6a1..20ecbb0c6 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 000000000..d1ddcbec3 Binary files /dev/null and b/qt/fan_dark.png differ diff --git a/qt/gpu.png b/qt/gpu.png index 46c499b66..a386ae383 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 000000000..0a690e001 Binary files /dev/null and b/qt/gpu_dark.png differ diff --git a/qt/headset.png b/qt/headset.png index ee2044feb..84e1261b3 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 000000000..08f1cfe08 Binary files /dev/null and b/qt/headset_dark.png differ diff --git a/qt/headsetstand.png b/qt/headsetstand.png index eff6c3d12..0b15d6148 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 000000000..9bf9d3e76 Binary files /dev/null and b/qt/headsetstand_dark.png differ diff --git a/qt/keyboard.png b/qt/keyboard.png index 913f019d8..58466d04d 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 000000000..e400d29dd Binary files /dev/null and b/qt/keyboard_dark.png differ diff --git a/qt/ledstrip.png b/qt/ledstrip.png index 943cb3e76..3d3335dae 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 000000000..acfcfc21b Binary files /dev/null and b/qt/ledstrip_dark.png differ diff --git a/qt/motherboard.png b/qt/motherboard.png index e95b114b8..aded29d46 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 000000000..5fdc93250 Binary files /dev/null and b/qt/motherboard_dark.png differ diff --git a/qt/mouse.png b/qt/mouse.png index 7727a588c..5b53631a1 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 000000000..0cb32b38b Binary files /dev/null and b/qt/mouse_dark.png differ diff --git a/qt/mousemat.png b/qt/mousemat.png index fc6cc1cfc..0e482aac2 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 000000000..f1a7b8a93 Binary files /dev/null and b/qt/mousemat_dark.png differ diff --git a/qt/resources.qrc b/qt/resources.qrc index 955c16ae4..c3e0e4870 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 54c99262c..b055e2a73 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 000000000..dd11cdf4a Binary files /dev/null and b/qt/software_dark.png differ diff --git a/qt/tools.png b/qt/tools.png index 9e14ed055..4f303a027 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 000000000..b2813d4d1 Binary files /dev/null and b/qt/tools_dark.png differ