Adding greyscale OpenRGB lightbulb as the tray icon to resolve #2453
* Created OpenRGBGreyscale.png from original SVG * Added to resources.qrc
This commit is contained in:
parent
952d0fe505
commit
e2a4ef45cf
7 changed files with 175 additions and 106 deletions
|
|
@ -331,7 +331,27 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op
|
|||
|
||||
connect(trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(on_ReShow(QSystemTrayIcon::ActivationReason)));
|
||||
|
||||
trayIcon->setIcon(logo);
|
||||
/*-------------------------------------------------*\
|
||||
| If Greyscale Tray Icon flag is not set in config |
|
||||
| then set the default value to false |
|
||||
\*-------------------------------------------------*/
|
||||
if(!ui_settings.contains("greyscale_tray_icon"))
|
||||
{
|
||||
ui_settings["greyscale_tray_icon"] = false;
|
||||
|
||||
settings_manager->SetSettings(ui_string, ui_settings);
|
||||
settings_manager->SaveSettings();
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| If greyscale tray icon exists in settings, apply it |
|
||||
| or else set the icon to the default window logo |
|
||||
\*-----------------------------------------------------*/
|
||||
if(ui_settings.contains("greyscale_tray_icon"))
|
||||
{
|
||||
SetTrayIcon(ui_settings["greyscale_tray_icon"].get<bool>());
|
||||
}
|
||||
|
||||
trayIcon->setToolTip("OpenRGB");
|
||||
trayIcon->setContextMenu(trayIconMenu);
|
||||
trayIcon->show();
|
||||
|
|
@ -620,6 +640,11 @@ void OpenRGBDialog2::AddSettingsPage()
|
|||
TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, "General Settings");
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Connect signals to slots |
|
||||
\*-----------------------------------------------------*/
|
||||
connect(SettingsPage, SIGNAL(TrayIconChanged(bool)), this, SLOT(SetTrayIcon(bool)));
|
||||
}
|
||||
|
||||
void OpenRGBDialog2::AddE131SettingsPage()
|
||||
|
|
@ -1668,6 +1693,18 @@ void Ui::OpenRGBDialog2::SetDetectionViewState(bool detection_showing)
|
|||
}
|
||||
}
|
||||
|
||||
void OpenRGBDialog2::SetTrayIcon(bool tray_icon)
|
||||
{
|
||||
if(tray_icon)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(":OpenRGBGreyscale.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
trayIcon->setIcon(QIcon(":OpenRGB.png"));
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBDialog2::SaveProfile()
|
||||
{
|
||||
ProfileManager* profile_manager = ResourceManager::get()->GetProfileManager();
|
||||
|
|
|
|||
|
|
@ -62,6 +62,9 @@ public:
|
|||
|
||||
bool DontShowAgain;
|
||||
|
||||
public slots:
|
||||
void SetTrayIcon(bool tray_icon);
|
||||
|
||||
private:
|
||||
/*-------------------------------------*\
|
||||
| Page pointers |
|
||||
|
|
|
|||
BIN
qt/OpenRGBGreyscale.png
Normal file
BIN
qt/OpenRGBGreyscale.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
|
|
@ -37,6 +37,11 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) :
|
|||
\*---------------------------------------------------------*/
|
||||
json ui_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("UserInterface");
|
||||
|
||||
if(ui_settings.contains("greyscale_tray_icon"))
|
||||
{
|
||||
ui->CheckboxTrayIconGreyscale->setChecked(ui_settings["greyscale_tray_icon"]);
|
||||
}
|
||||
|
||||
if(ui_settings.contains("minimize_on_close"))
|
||||
{
|
||||
ui->CheckboxMinimizeOnClose->setChecked(ui_settings["minimize_on_close"]);
|
||||
|
|
@ -166,6 +171,18 @@ void OpenRGBSettingsPage::on_ComboBoxTheme_currentTextChanged(const QString them
|
|||
}
|
||||
}
|
||||
|
||||
void OpenRGBSettingsPage::on_CheckboxTrayIconGreyscale_clicked()
|
||||
{
|
||||
json ui_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("UserInterface");
|
||||
bool tray_icon = ui->CheckboxTrayIconGreyscale->isChecked();
|
||||
|
||||
ui_settings["greyscale_tray_icon"] = tray_icon;
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("UserInterface", ui_settings);
|
||||
SaveSettings();
|
||||
|
||||
emit TrayIconChanged(tray_icon);
|
||||
}
|
||||
|
||||
void OpenRGBSettingsPage::on_CheckboxMinimizeOnClose_clicked()
|
||||
{
|
||||
json ui_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("UserInterface");
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ public:
|
|||
explicit OpenRGBSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBSettingsPage();
|
||||
|
||||
signals:
|
||||
void TrayIconChanged(bool tray_icon);
|
||||
|
||||
private:
|
||||
Ui::OpenRGBSettingsPageUi *ui;
|
||||
void SaveSettings();
|
||||
|
|
@ -34,6 +37,7 @@ private:
|
|||
private slots:
|
||||
void on_ComboBoxTheme_currentTextChanged(const QString);
|
||||
void on_CheckboxMinimizeOnClose_clicked();
|
||||
void on_CheckboxTrayIconGreyscale_clicked();
|
||||
void on_CheckboxLoadGeometry_clicked();
|
||||
void on_CheckboxSaveGeometry_clicked();
|
||||
void on_CheckboxAutoStart_clicked();
|
||||
|
|
|
|||
|
|
@ -24,12 +24,19 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>418</width>
|
||||
<height>464</height>
|
||||
<width>427</width>
|
||||
<height>638</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="19" column="1">
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxMinimizeOnClose">
|
||||
<property name="text">
|
||||
<string>Minimize On Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="1">
|
||||
<widget class="QLineEdit" name="TextServerPort">
|
||||
<property name="inputMask">
|
||||
<string>90000</string>
|
||||
|
|
@ -42,111 +49,38 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartClient">
|
||||
<property name="text">
|
||||
<string>Start Client</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="DriversSettingsLabel">
|
||||
<property name="text">
|
||||
<string>Drivers Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="0">
|
||||
<widget class="QLabel" name="AutoStartStatusLabel">
|
||||
<property name="text">
|
||||
<string>Start at Login Status</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="1">
|
||||
<widget class="QLineEdit" name="TextClientHost"/>
|
||||
</item>
|
||||
<item row="19" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartSetServerPort">
|
||||
<property name="text">
|
||||
<string>Set Server Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="1">
|
||||
<widget class="QLineEdit" name="TextCustomArgs"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="UserInterfaceSettingsLabel">
|
||||
<property name="text">
|
||||
<string>User Interface Settings:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxMinimizeOnClose">
|
||||
<property name="text">
|
||||
<string>Minimize On Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxSaveGeometry">
|
||||
<property name="text">
|
||||
<string>Save Geometry On Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStart">
|
||||
<property name="text">
|
||||
<string>Start At Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartProfile">
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartServer">
|
||||
<property name="text">
|
||||
<string>Start Server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="AutoStartLabel">
|
||||
<item row="21" column="1">
|
||||
<widget class="QLineEdit" name="TextClientHost"/>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxLogConsole">
|
||||
<property name="text">
|
||||
<string>Start At Login Settings:</string>
|
||||
<string>Enable Log Console (restart required)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0">
|
||||
<item row="22" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartCustom">
|
||||
<property name="text">
|
||||
<string>Custom Arguments</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="LogManagerSettingsLabel">
|
||||
<item row="7" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxSaveGeometry">
|
||||
<property name="text">
|
||||
<string>Log Manager Settings:</string>
|
||||
<string>Save Geometry On Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartMinimized">
|
||||
<property name="text">
|
||||
<string>Start Minimized</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="0">
|
||||
<item row="25" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
|
@ -162,20 +96,31 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="ComboBoxTheme"/>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxRunZoneChecks">
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxLoadGeometry">
|
||||
<property name="text">
|
||||
<string>Run zone checks on rescan</string>
|
||||
<string>Load Window Geometry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartClient">
|
||||
<property name="text">
|
||||
<string>Start Client</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="AutoStartLabel">
|
||||
<property name="text">
|
||||
<string>Start At Login Settings:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxLogConsole">
|
||||
<widget class="QLabel" name="LogManagerSettingsLabel">
|
||||
<property name="text">
|
||||
<string>Enable Log Console (restart required)</string>
|
||||
<string>Log Manager Settings:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -186,23 +131,85 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxLoadGeometry">
|
||||
<item row="23" column="1">
|
||||
<widget class="QComboBox" name="ComboBoxAutoStartProfile"/>
|
||||
</item>
|
||||
<item row="24" column="0">
|
||||
<widget class="QLabel" name="AutoStartStatusLabel">
|
||||
<property name="text">
|
||||
<string>Load Window Geometry</string>
|
||||
<string>Start at Login Status</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartSetServerPort">
|
||||
<property name="text">
|
||||
<string>Set Server Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartProfile">
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="DriversSettingsLabel">
|
||||
<property name="text">
|
||||
<string>Drivers Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxRunZoneChecks">
|
||||
<property name="text">
|
||||
<string>Run zone checks on rescan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="1">
|
||||
<widget class="QComboBox" name="ComboBoxAutoStartProfile"/>
|
||||
<widget class="QLineEdit" name="TextCustomArgs"/>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="UserInterfaceSettingsLabel">
|
||||
<property name="text">
|
||||
<string>User Interface Settings:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStart">
|
||||
<property name="text">
|
||||
<string>Start At Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAutoStartMinimized">
|
||||
<property name="text">
|
||||
<string>Start Minimized</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="ComboBoxTheme"/>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxAMDSMBusReduceCPU">
|
||||
<property name="text">
|
||||
<string>AMD SMBus: Reduce CPU Usage (restart required)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="CheckboxTrayIconGreyscale">
|
||||
<property name="text">
|
||||
<string>Greyscale Tray Icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
|||
|
|
@ -49,5 +49,6 @@
|
|||
<file>storage_dark.png</file>
|
||||
<file>case.png</file>
|
||||
<file>case_dark.png</file>
|
||||
<file>OpenRGBGreyscale.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue