Fix color palette buttons to work with and without Windows dark theme enabled
This commit is contained in:
parent
f2396b453f
commit
195730e721
2 changed files with 69 additions and 55 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#include "OpenRGBDialog2.h"
|
||||
#include "OpenRGBDevicePage.h"
|
||||
#include "OpenRGBZoneResizeDialog.h"
|
||||
#include "ResourceManager.h"
|
||||
|
|
@ -39,6 +40,36 @@ OpenRGBDevicePage::OpenRGBDevicePage(RGBController *dev, QWidget *parent) :
|
|||
/*-----------------------------------------------------*\
|
||||
| Set up the color palette buttons |
|
||||
\*-----------------------------------------------------*/
|
||||
#ifdef _WIN32
|
||||
if(((OpenRGBDialog2 *)parent)->IsDarkTheme())
|
||||
{
|
||||
ui->ButtonRed->setStyleSheet("QPushButton {background-color: rgb(255,0,0); color: rgb(255,0,0);}");
|
||||
ui->ButtonRed->setFlat(true);
|
||||
ui->ButtonRed->update();
|
||||
|
||||
ui->ButtonYellow->setStyleSheet("QPushButton {background-color: rgb(255,255,0); color: rgb(255,255,0);}");
|
||||
ui->ButtonYellow->setFlat(true);
|
||||
ui->ButtonYellow->update();
|
||||
|
||||
ui->ButtonGreen->setStyleSheet("QPushButton {background-color: rgb(0,255,0); color: rgb(0,255,0);}");
|
||||
ui->ButtonGreen->setFlat(true);
|
||||
ui->ButtonGreen->update();
|
||||
|
||||
ui->ButtonCyan->setStyleSheet("QPushButton {background-color: rgb(0,255,255); color: rgb(0,255,255);}");
|
||||
ui->ButtonCyan->setFlat(true);
|
||||
ui->ButtonCyan->update();
|
||||
|
||||
ui->ButtonBlue->setStyleSheet("QPushButton {background-color: rgb(0,0,255); color: rgb(0,0,255);}");
|
||||
ui->ButtonBlue->setFlat(true);
|
||||
ui->ButtonBlue->update();
|
||||
|
||||
ui->ButtonMagenta->setStyleSheet("QPushButton {background-color: rgb(255,0,255); color: rgb(255,0,255);}");
|
||||
ui->ButtonMagenta->setFlat(true);
|
||||
ui->ButtonMagenta->update();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
QPalette pal;
|
||||
|
||||
pal = ui->ButtonRed->palette();
|
||||
|
|
@ -82,6 +113,7 @@ OpenRGBDevicePage::OpenRGBDevicePage(RGBController *dev, QWidget *parent) :
|
|||
ui->ButtonMagenta->setPalette(pal);
|
||||
ui->ButtonMagenta->setFlat(true);
|
||||
ui->ButtonMagenta->update();
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Fill in the mode selection box |
|
||||
|
|
|
|||
|
|
@ -16,9 +16,6 @@
|
|||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="12" column="8">
|
||||
<widget class="QPushButton" name="ButtonCyan">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #00ffff</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
@ -46,9 +43,6 @@
|
|||
</item>
|
||||
<item row="12" column="9">
|
||||
<widget class="QPushButton" name="ButtonBlue">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #0000ff</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
@ -70,9 +64,6 @@
|
|||
</item>
|
||||
<item row="12" column="6">
|
||||
<widget class="QPushButton" name="ButtonYellow">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffff00</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
@ -131,9 +122,6 @@
|
|||
</item>
|
||||
<item row="12" column="5">
|
||||
<widget class="QPushButton" name="ButtonRed">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ff0000</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
@ -176,9 +164,6 @@
|
|||
</item>
|
||||
<item row="12" column="10">
|
||||
<widget class="QPushButton" name="ButtonMagenta">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ff00ff</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
@ -235,9 +220,6 @@
|
|||
</item>
|
||||
<item row="12" column="7">
|
||||
<widget class="QPushButton" name="ButtonGreen">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #00ff00</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue