Dark theme icons
|
|
@ -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<i2c_smbus_interface *>& 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 = "<html><table><tr><td width='30'><img src='";
|
||||
SoftwareLabelString += ":/software.png";
|
||||
SoftwareLabelString += "' height='16' width='16'></td><td>Software</td></tr></table></html>";
|
||||
SoftwareLabelString += ":/software";
|
||||
if(darkTheme) SoftwareLabelString += "_dark";
|
||||
SoftwareLabelString += ".png' height='16' width='16'></td><td>Software</td></tr></table></html>";
|
||||
|
||||
QLabel *SoftwareTabLabel = new QLabel();
|
||||
SoftwareTabLabel->setText(SoftwareLabelString);
|
||||
|
|
@ -211,8 +220,9 @@ void OpenRGBDialog2::AddI2CToolsPage()
|
|||
ui->InformationTabBar->addTab(SMBusToolsPage, "");
|
||||
|
||||
QString SMBusToolsLabelString = "<html><table><tr><td width='30'><img src='";
|
||||
SMBusToolsLabelString += ":/tools.png";
|
||||
SMBusToolsLabelString += "' height='16' width='16'></td><td>SMBus Tools</td></tr></table></html>";
|
||||
SMBusToolsLabelString += ":/tools";
|
||||
if(darkTheme) SMBusToolsLabelString += "_dark";
|
||||
SMBusToolsLabelString += ".png' height='16' width='16'></td><td>SMBus Tools</td></tr></table></html>";
|
||||
|
||||
QLabel *SMBusToolsTabLabel = new QLabel();
|
||||
SMBusToolsTabLabel->setText(SMBusToolsLabelString);
|
||||
|
|
@ -314,7 +324,7 @@ void OpenRGBDialog2::UpdateDevicesList()
|
|||
| type and append device name string. |
|
||||
\*-----------------------------------------------------*/
|
||||
QString NewLabelString = "<html><table><tr><td width='30'><img src=':/";
|
||||
NewLabelString += GetIconString(controllers[dev_idx]->type);
|
||||
NewLabelString += GetIconString(controllers[dev_idx]->type, darkTheme);
|
||||
NewLabelString += "' height='16' width='16'></td><td>" + QString::fromStdString(controllers[dev_idx]->name) + "</td></tr></table></html>";
|
||||
|
||||
QLabel *NewTabLabel = new QLabel();
|
||||
|
|
@ -341,7 +351,7 @@ void OpenRGBDialog2::UpdateDevicesList()
|
|||
| type and append device name string. |
|
||||
\*-----------------------------------------------------*/
|
||||
QString NewLabelString = "<html><table><tr><td width='30'><img src=':/";
|
||||
NewLabelString += GetIconString(controllers[dev_idx]->type);
|
||||
NewLabelString += GetIconString(controllers[dev_idx]->type, darkTheme);
|
||||
NewLabelString += "' height='16' width='16'></td><td>" + QString::fromStdString(controllers[dev_idx]->name) + "</td></tr></table></html>";
|
||||
|
||||
QLabel *NewTabLabel = new QLabel();
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ private:
|
|||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
bool device_view_showing = false;
|
||||
bool darkTheme = false;
|
||||
|
||||
private slots:
|
||||
void on_Exit();
|
||||
|
|
|
|||
BIN
qt/dram.png
|
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 109 B |
BIN
qt/dram_dark.png
Normal file
|
After Width: | Height: | Size: 116 B |
BIN
qt/fan.png
|
Before Width: | Height: | Size: 675 B After Width: | Height: | Size: 164 B |
BIN
qt/fan_dark.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
qt/gpu.png
|
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 131 B |
BIN
qt/gpu_dark.png
Normal file
|
After Width: | Height: | Size: 142 B |
BIN
qt/headset.png
|
Before Width: | Height: | Size: 660 B After Width: | Height: | Size: 143 B |
BIN
qt/headset_dark.png
Normal file
|
After Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 132 B |
BIN
qt/headsetstand_dark.png
Normal file
|
After Width: | Height: | Size: 143 B |
BIN
qt/keyboard.png
|
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 126 B |
BIN
qt/keyboard_dark.png
Normal file
|
After Width: | Height: | Size: 136 B |
BIN
qt/ledstrip.png
|
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 111 B |
BIN
qt/ledstrip_dark.png
Normal file
|
After Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 137 B |
BIN
qt/motherboard_dark.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
qt/mouse.png
|
Before Width: | Height: | Size: 663 B After Width: | Height: | Size: 141 B |
BIN
qt/mouse_dark.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
qt/mousemat.png
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 151 B |
BIN
qt/mousemat_dark.png
Normal file
|
After Width: | Height: | Size: 159 B |
|
|
@ -13,5 +13,17 @@
|
|||
<file>headsetstand.png</file>
|
||||
<file>tools.png</file>
|
||||
<file>software.png</file>
|
||||
<file>dram_dark.png</file>
|
||||
<file>fan_dark.png</file>
|
||||
<file>gpu_dark.png</file>
|
||||
<file>headset_dark.png</file>
|
||||
<file>headsetstand_dark.png</file>
|
||||
<file>keyboard_dark.png</file>
|
||||
<file>ledstrip_dark.png</file>
|
||||
<file>mousemat_dark.png</file>
|
||||
<file>mouse_dark.png</file>
|
||||
<file>motherboard_dark.png</file>
|
||||
<file>software_dark.png</file>
|
||||
<file>tools_dark.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
BIN
qt/software.png
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 138 B |
BIN
qt/software_dark.png
Normal file
|
After Width: | Height: | Size: 143 B |
BIN
qt/tools.png
|
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 113 B |
BIN
qt/tools_dark.png
Normal file
|
After Width: | Height: | Size: 124 B |