Dark theme icons

This commit is contained in:
k1-801 2020-08-31 09:48:43 +04:00 committed by Adam Honse
parent 9407ef7f4d
commit 66fd8ab394
27 changed files with 42 additions and 19 deletions

View file

@ -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();

View file

@ -73,6 +73,7 @@ private:
void closeEvent(QCloseEvent *event);
bool device_view_showing = false;
bool darkTheme = false;
private slots:
void on_Exit();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

After

Width:  |  Height:  |  Size: 109 B

Before After
Before After

BIN
qt/dram_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 164 B

Before After
Before After

BIN
qt/fan_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 B

After

Width:  |  Height:  |  Size: 131 B

Before After
Before After

BIN
qt/gpu_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 B

After

Width:  |  Height:  |  Size: 143 B

Before After
Before After

BIN
qt/headset_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 132 B

Before After
Before After

BIN
qt/headsetstand_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 126 B

Before After
Before After

BIN
qt/keyboard_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 111 B

Before After
Before After

BIN
qt/ledstrip_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

After

Width:  |  Height:  |  Size: 137 B

Before After
Before After

BIN
qt/motherboard_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 141 B

Before After
Before After

BIN
qt/mouse_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 151 B

Before After
Before After

BIN
qt/mousemat_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

View file

@ -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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 138 B

Before After
Before After

BIN
qt/software_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 113 B

Before After
Before After

BIN
qt/tools_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B