Initial commit for Plugins
Commits squashed, code style and naming changes by Adam Honse <calcprogrammer1@gmail.com>
This commit is contained in:
parent
5f5d50ffd8
commit
93231c3225
14 changed files with 344 additions and 24 deletions
|
|
@ -112,6 +112,8 @@ HEADERS +=
|
||||||
NetworkClient.h \
|
NetworkClient.h \
|
||||||
NetworkProtocol.h \
|
NetworkProtocol.h \
|
||||||
NetworkServer.h \
|
NetworkServer.h \
|
||||||
|
OpenRGBPluginInterface.h \
|
||||||
|
PluginManager.h \
|
||||||
ProfileManager.h \
|
ProfileManager.h \
|
||||||
ResourceManager.h \
|
ResourceManager.h \
|
||||||
SettingsManager.h \
|
SettingsManager.h \
|
||||||
|
|
@ -284,7 +286,6 @@ HEADERS +=
|
||||||
RGBController/RGBController_Dummy.h \
|
RGBController/RGBController_Dummy.h \
|
||||||
RGBController/RGBController_Network.h \
|
RGBController/RGBController_Network.h \
|
||||||
|
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
dependencies/dmiinfo.cpp \
|
dependencies/dmiinfo.cpp \
|
||||||
dependencies/ColorWheel/ColorWheel.cpp \
|
dependencies/ColorWheel/ColorWheel.cpp \
|
||||||
|
|
@ -293,6 +294,7 @@ SOURCES +=
|
||||||
cli.cpp \
|
cli.cpp \
|
||||||
NetworkClient.cpp \
|
NetworkClient.cpp \
|
||||||
NetworkServer.cpp \
|
NetworkServer.cpp \
|
||||||
|
PluginManager.cpp \
|
||||||
ProfileManager.cpp \
|
ProfileManager.cpp \
|
||||||
ResourceManager.cpp \
|
ResourceManager.cpp \
|
||||||
SettingsManager.cpp \
|
SettingsManager.cpp \
|
||||||
|
|
|
||||||
43
OpenRGBPluginInterface.h
Normal file
43
OpenRGBPluginInterface.h
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*-----------------------------------------*\
|
||||||
|
| OpenRGBPluginInterface.h |
|
||||||
|
| |
|
||||||
|
| OpenRGB Plugin Interface Class |
|
||||||
|
| |
|
||||||
|
| herosilas12 (CoffeeIsLife) 12/11/2020 |
|
||||||
|
| Adam Honse (CalcProgrammer1) 1/5/2021 |
|
||||||
|
\*-----------------------------------------*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ResourceManager.h"
|
||||||
|
|
||||||
|
#include <QtPlugin>
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
|
#define OpenRGBPluginInterface_IID "com.OpenRGBPluginInterface"
|
||||||
|
|
||||||
|
struct OpenRGBPluginInfo
|
||||||
|
{
|
||||||
|
std::string PluginName;
|
||||||
|
std::string PluginDescription;
|
||||||
|
std::string PluginLocation;
|
||||||
|
|
||||||
|
bool HasCustom;
|
||||||
|
QLabel *PluginLabel;
|
||||||
|
|
||||||
|
std::string SettingName;
|
||||||
|
};
|
||||||
|
|
||||||
|
class OpenRGBPluginInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~OpenRGBPluginInterface() {}
|
||||||
|
|
||||||
|
virtual OpenRGBPluginInfo Initialize(bool dark_theme, ResourceManager* resource_manager_ptr) = 0;
|
||||||
|
|
||||||
|
virtual QWidget *CreateGUI(QWidget* parent) = 0;
|
||||||
|
|
||||||
|
OpenRGBPluginInfo info;
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_INTERFACE(OpenRGBPluginInterface, OpenRGBPluginInterface_IID)
|
||||||
45
PluginManager.cpp
Normal file
45
PluginManager.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
#include "PluginManager.h"
|
||||||
|
|
||||||
|
void PluginManager::ScanAndLoadPlugins()
|
||||||
|
{
|
||||||
|
std::string OpenRGBConfigDir = ResourceManager::get()->GetConfigurationDirectory();
|
||||||
|
|
||||||
|
std::string PluginPath = OpenRGBConfigDir + "/Plugins";
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------------------*\
|
||||||
|
| I used https://github.com/krf/cmake-qtqml-plugin-example to figure out how to do this |
|
||||||
|
| So BIG credit to krf |
|
||||||
|
\*--------------------------------------------------------------------------------------*/
|
||||||
|
OpenRGBPluginInterface *OpenRGBPlugin = nullptr;
|
||||||
|
|
||||||
|
const QDir pluginsDir = QString().fromStdString(ResourceManager::get()->GetConfigurationDirectory()) + "plugins/";
|
||||||
|
|
||||||
|
std::vector<std::string> FileList;
|
||||||
|
|
||||||
|
for(int i = 0; i < QDir(pluginsDir).entryList(QDir::Files).size(); i++)
|
||||||
|
{
|
||||||
|
/*--------------------------------------*\
|
||||||
|
| Add all of the Plugin Files to a list |
|
||||||
|
\*--------------------------------------*/
|
||||||
|
FileList.push_back(QDir(pluginsDir).entryList(QDir::Files)[i].toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
for(const std::string &fileName : FileList)
|
||||||
|
{
|
||||||
|
const std::string filePath = pluginsDir.absoluteFilePath(QString().fromStdString(fileName)).toStdString();
|
||||||
|
|
||||||
|
QPluginLoader loader(pluginsDir.absoluteFilePath(QString().fromStdString(fileName)));
|
||||||
|
|
||||||
|
if (QObject *instance = loader.instance())
|
||||||
|
{
|
||||||
|
if ((OpenRGBPlugin = qobject_cast<OpenRGBPluginInterface*>(instance)))
|
||||||
|
{
|
||||||
|
PluginManager::ActivePlugins.push_back(OpenRGBPlugin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << loader.errorString().toStdString() << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
PluginManager.h
Normal file
20
PluginManager.h
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "OpenRGBPluginInterface.h"
|
||||||
|
#include "ResourceManager.h"
|
||||||
|
|
||||||
|
#include <QPluginLoader>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QtPlugin>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
class PluginManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::vector<OpenRGBPluginInterface*> ActivePlugins;
|
||||||
|
|
||||||
|
void ScanAndLoadPlugins();
|
||||||
|
};
|
||||||
|
|
@ -2,7 +2,33 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class ProfileManager
|
class ProfileManagerInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool SaveProfile(std::string profile_name) = 0;
|
||||||
|
virtual bool LoadProfile(std::string profile_name) = 0;
|
||||||
|
virtual bool LoadSizeFromProfile(std::string profile_name) = 0;
|
||||||
|
virtual void DeleteProfile(std::string profile_name) = 0;
|
||||||
|
|
||||||
|
std::vector<std::string> profile_list;
|
||||||
|
|
||||||
|
virtual bool LoadDeviceFromListWithOptions
|
||||||
|
(
|
||||||
|
std::vector<RGBController*>& temp_controllers,
|
||||||
|
std::vector<bool>& temp_controller_used,
|
||||||
|
RGBController* load_controller,
|
||||||
|
bool load_size,
|
||||||
|
bool load_settings
|
||||||
|
) = 0;
|
||||||
|
|
||||||
|
virtual std::vector<RGBController*> LoadProfileToList (std::string profile_name) = 0;
|
||||||
|
|
||||||
|
virtual void SetConfigurationDirectory(std::string directory) = 0;
|
||||||
|
protected:
|
||||||
|
virtual ~ProfileManagerInterface() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
class ProfileManager: public ProfileManagerInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProfileManager(std::string config_dir);
|
ProfileManager(std::string config_dir);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <hidapi/hidapi.h>
|
#include <hidapi/hidapi.h>
|
||||||
|
|
||||||
std::unique_ptr<ResourceManager> ResourceManager::instance;
|
ResourceManager* ResourceManager::instance;
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
|
|
@ -26,10 +26,10 @@ ResourceManager *ResourceManager::get()
|
||||||
{
|
{
|
||||||
if(!instance)
|
if(!instance)
|
||||||
{
|
{
|
||||||
instance = std::make_unique<ResourceManager>();
|
instance = new ResourceManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance.get();
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceManager::ResourceManager()
|
ResourceManager::ResourceManager()
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,34 @@ typedef void (*DeviceListChangeCallback)(void *);
|
||||||
typedef void (*DetectionProgressCallback)(void *);
|
typedef void (*DetectionProgressCallback)(void *);
|
||||||
typedef void (*I2CBusListChangeCallback)(void *);
|
typedef void (*I2CBusListChangeCallback)(void *);
|
||||||
|
|
||||||
class ResourceManager
|
class ResourceManagerInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual std::vector<i2c_smbus_interface*> & GetI2CBusses() = 0;
|
||||||
|
|
||||||
|
virtual void RegisterRGBController(RGBController *rgb_controller) = 0;
|
||||||
|
|
||||||
|
virtual void RegisterDeviceListChangeCallback(DeviceListChangeCallback new_callback, void * new_callback_arg) = 0;
|
||||||
|
virtual void RegisterDetectionProgressCallback(DetectionProgressCallback new_callback, void * new_callback_arg) = 0;
|
||||||
|
virtual void RegisterI2CBusListChangeCallback(I2CBusListChangeCallback new_callback, void * new_callback_arg) = 0;
|
||||||
|
|
||||||
|
virtual std::vector<RGBController*> & GetRGBControllers() = 0;
|
||||||
|
|
||||||
|
virtual std::string GetConfigurationDirectory() = 0;
|
||||||
|
|
||||||
|
virtual std::vector<NetworkClient*>& GetClients() = 0;
|
||||||
|
virtual NetworkServer* GetServer() = 0;
|
||||||
|
|
||||||
|
virtual ProfileManager* GetProfileManager() = 0;
|
||||||
|
virtual SettingsManager* GetSettingsManager() = 0;
|
||||||
|
|
||||||
|
virtual void DeviceListChanged() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~ResourceManagerInterface() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
class ResourceManager: public ResourceManagerInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static ResourceManager *get();
|
static ResourceManager *get();
|
||||||
|
|
@ -110,7 +137,10 @@ public:
|
||||||
private:
|
private:
|
||||||
void DetectDevicesThreadFunction();
|
void DetectDevicesThreadFunction();
|
||||||
|
|
||||||
static std::unique_ptr<ResourceManager> instance;
|
/*-------------------------------------------------------------------------------------*\
|
||||||
|
| Static pointer to shared instance of ResourceManager |
|
||||||
|
\*-------------------------------------------------------------------------------------*/
|
||||||
|
static ResourceManager* instance;
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------------------*\
|
/*-------------------------------------------------------------------------------------*\
|
||||||
| Detection enabled flag |
|
| Detection enabled flag |
|
||||||
|
|
|
||||||
|
|
@ -15,19 +15,31 @@
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
class SettingsManager
|
class SettingsManagerInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual json GetSettings(std::string settings_key) = 0;
|
||||||
|
virtual void SetSettings(std::string settings_key, json new_settings) = 0;
|
||||||
|
|
||||||
|
virtual void LoadSettings(std::string filename) = 0;
|
||||||
|
virtual void SaveSettings() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~SettingsManagerInterface() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
class SettingsManager: public SettingsManagerInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SettingsManager();
|
SettingsManager();
|
||||||
~SettingsManager();
|
~SettingsManager();
|
||||||
|
|
||||||
json GetSettings(std::string settings_key);
|
json GetSettings(std::string settings_key) override;
|
||||||
void SetSettings(std::string settings_key, json new_settings);
|
void SetSettings(std::string settings_key, json new_settings) override;
|
||||||
|
|
||||||
void LoadSettings(std::string filename);
|
void LoadSettings(std::string filename) override;
|
||||||
void SaveSettings();
|
void SaveSettings() override;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
json settings_data;
|
json settings_data;
|
||||||
json settings_prototype;
|
json settings_prototype;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include "OpenRGBDialog2.h"
|
#include "OpenRGBDialog2.h"
|
||||||
|
#include "PluginManager.h"
|
||||||
#include "OpenRGBDevicePage.h"
|
#include "OpenRGBDevicePage.h"
|
||||||
#include "OpenRGBDeviceInfoPage.h"
|
#include "OpenRGBDeviceInfoPage.h"
|
||||||
#include "OpenRGBServerInfoPage.h"
|
#include "OpenRGBServerInfoPage.h"
|
||||||
|
|
@ -88,7 +89,7 @@ static void UpdateDetectionProgressCallback(void * this_ptr)
|
||||||
|
|
||||||
bool OpenRGBDialog2::IsDarkTheme()
|
bool OpenRGBDialog2::IsDarkTheme()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
/*-------------------------------------------------*\
|
/*-------------------------------------------------*\
|
||||||
| Windows dark theme settings |
|
| Windows dark theme settings |
|
||||||
\*-------------------------------------------------*/
|
\*-------------------------------------------------*/
|
||||||
|
|
@ -131,12 +132,12 @@ bool OpenRGBDialog2::IsDarkTheme()
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(QPalette().window().color().value() < 127)
|
if(QPalette().window().color().value() < 127)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -287,6 +288,24 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op
|
||||||
{
|
{
|
||||||
AddI2CToolsPage();
|
AddI2CToolsPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| Add the various plugins tabs |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
PluginManager* plugin_manager = new PluginManager;
|
||||||
|
|
||||||
|
plugin_manager->ScanAndLoadPlugins();
|
||||||
|
|
||||||
|
if(plugin_manager->ActivePlugins.size() > 0)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < int(plugin_manager->ActivePlugins.size()); i++)
|
||||||
|
{
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| Start by getting location and then placing the widget where it needs to go |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
OpenRGBDialog2::AddPluginTab(plugin_manager, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenRGBDialog2::~OpenRGBDialog2()
|
OpenRGBDialog2::~OpenRGBDialog2()
|
||||||
|
|
@ -358,6 +377,98 @@ void OpenRGBDialog2::AddSupportedDevicesPage()
|
||||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SupportedTabLabel);
|
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SupportedTabLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenRGBDialog2::AddPluginTab(PluginManager* plugin_manager, int plugin_index)
|
||||||
|
{
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| Initialize the plugin |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
plugin_manager->ActivePlugins[plugin_index]->info = plugin_manager->ActivePlugins[plugin_index]->Initialize(OpenRGBDialog2::IsDarkTheme(), ResourceManager::get());
|
||||||
|
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| Create Label for the Tab |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
QLabel* PluginTabLabel = new QLabel;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| If the plugin has custom information, use it, |
|
||||||
|
| otherwise generate it |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
if(plugin_manager->ActivePlugins[plugin_index]->info.HasCustom)
|
||||||
|
{
|
||||||
|
PluginTabLabel = plugin_manager->ActivePlugins[plugin_index]->info.PluginLabel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QLabel *TabLabelText = plugin_manager->ActivePlugins[plugin_index]->info.PluginLabel;
|
||||||
|
|
||||||
|
QString NewTabLabelText = TabLabelText->text();
|
||||||
|
QString PluginLabelString = "<html><table><tr><td width='30'><img src='";
|
||||||
|
PluginLabelString += ":/plugin";
|
||||||
|
if (IsDarkTheme()) PluginLabelString += "_dark";
|
||||||
|
PluginLabelString+= ".png' height='16' width='16'></td><td>" + NewTabLabelText + "</td></tr></table></html>";
|
||||||
|
PluginTabLabel->setText(PluginLabelString);
|
||||||
|
|
||||||
|
PluginTabLabel->setIndent(20);
|
||||||
|
if(IsDarkTheme())
|
||||||
|
{
|
||||||
|
PluginTabLabel->setGeometry(0, 25, 200, 50);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PluginTabLabel->setGeometry(0, 0, 200, 25);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| Determine plugin location |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
std::string Location = plugin_manager->ActivePlugins[plugin_index]->info.PluginLocation;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| InformationTab - Place plugin in the Information tab |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
if(Location == "InformationTab")
|
||||||
|
{
|
||||||
|
QWidget* NewPluginTab = new QWidget;
|
||||||
|
|
||||||
|
NewPluginTab = plugin_manager->ActivePlugins[plugin_index]->CreateGUI(NewPluginTab);
|
||||||
|
ui->InformationTabBar->addTab(NewPluginTab," ");
|
||||||
|
|
||||||
|
ui->InformationTabBar->tabBar()->setTabButton((ui->InformationTabBar->count() - 1),QTabBar::LeftSide , PluginTabLabel);
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| DevicesTab - Place plugin in the Devices tab |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
else if(Location == "DevicesTab")
|
||||||
|
{
|
||||||
|
QWidget* NewPluginTab = new QWidget;
|
||||||
|
|
||||||
|
NewPluginTab = plugin_manager->ActivePlugins[plugin_index]->CreateGUI(NewPluginTab);
|
||||||
|
ui->DevicesTabBar->addTab(NewPluginTab," ");
|
||||||
|
|
||||||
|
ui->DevicesTabBar->tabBar()->setTabButton((ui->DevicesTabBar->count() - 1),QTabBar::LeftSide , PluginTabLabel);
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| TopTabBar - Place plugin as its own top level tab |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
else if(Location == "TopTabBar")
|
||||||
|
{
|
||||||
|
QWidget* NewPluginTab = new QWidget;
|
||||||
|
|
||||||
|
NewPluginTab = plugin_manager->ActivePlugins[plugin_index]->CreateGUI(NewPluginTab);
|
||||||
|
|
||||||
|
ui->MainTabBar->addTab(NewPluginTab,QString().fromStdString(plugin_manager->ActivePlugins[plugin_index]->info.PluginName));
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| Display an error message if the plugin does not |
|
||||||
|
| specify a valid location |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << (plugin_manager->ActivePlugins[plugin_index]->info.PluginName + " Is broken\nNo valid location specified");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void OpenRGBDialog2::AddI2CToolsPage()
|
void OpenRGBDialog2::AddI2CToolsPage()
|
||||||
{
|
{
|
||||||
ShowI2CTools = true;
|
ShowI2CTools = true;
|
||||||
|
|
@ -934,6 +1045,7 @@ void Ui::OpenRGBDialog2::SetDetectionViewState(bool detection_showing)
|
||||||
ui->ProfileBox->setVisible(true);
|
ui->ProfileBox->setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ui::OpenRGBDialog2::on_ButtonRescan_clicked()
|
void Ui::OpenRGBDialog2::on_ButtonRescan_clicked()
|
||||||
{
|
{
|
||||||
SetDetectionViewState(true);
|
SetDetectionViewState(true);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include "OpenRGBSoftwareInfoPage.h"
|
#include "OpenRGBSoftwareInfoPage.h"
|
||||||
#include "OpenRGBSystemInfoPage.h"
|
#include "OpenRGBSystemInfoPage.h"
|
||||||
#include "OpenRGBSupportedDevicesPage.h"
|
#include "OpenRGBSupportedDevicesPage.h"
|
||||||
|
#include "PluginManager.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "i2c_smbus.h"
|
#include "i2c_smbus.h"
|
||||||
|
|
@ -66,6 +67,7 @@ private:
|
||||||
|
|
||||||
void AddSoftwareInfoPage();
|
void AddSoftwareInfoPage();
|
||||||
void AddSupportedDevicesPage();
|
void AddSupportedDevicesPage();
|
||||||
|
void AddPluginTab(PluginManager* plugin_manager,int plugin_index);
|
||||||
|
|
||||||
void ClearDevicesList();
|
void ClearDevicesList();
|
||||||
void UpdateDevicesList();
|
void UpdateDevicesList();
|
||||||
|
|
|
||||||
BIN
qt/plugin.png
Normal file
BIN
qt/plugin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 191 B |
BIN
qt/plugin_dark.png
Normal file
BIN
qt/plugin_dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 183 B |
|
|
@ -32,5 +32,7 @@
|
||||||
<file>windows_dark.qss</file>
|
<file>windows_dark.qss</file>
|
||||||
<file>arrow-down.png</file>
|
<file>arrow-down.png</file>
|
||||||
<file>arrow-up.png</file>
|
<file>arrow-up.png</file>
|
||||||
|
<file>plugin.png</file>
|
||||||
|
<file>plugin_dark.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,18 @@ QTabWidget QWidget QTabBar::tab
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
border: 10px;
|
||||||
|
border: 1px solid #5c5c5c;
|
||||||
border-right: 1px solid #2e2e2e;
|
border-right: 1px solid #2e2e2e;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
margin-bottom: 0px;
|
}
|
||||||
border: 1px solid #2e2e2e;
|
|
||||||
|
QTabWidget QWidget QTabBar::tab:!selected
|
||||||
|
{
|
||||||
|
background-color: #5c5c5c;
|
||||||
|
border-right: 1px solid #2e2e2e;
|
||||||
|
border-left: 1px solid #2e2e2e;
|
||||||
|
border-top: 1px solid #2e2e2e;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabWidget QWidget QTabBar::tab:selected
|
QTabWidget QWidget QTabBar::tab:selected
|
||||||
|
|
@ -71,6 +79,12 @@ QTabWidget QWidget QTabBar::tab:selected
|
||||||
border-right: 1px solid #454545;
|
border-right: 1px solid #454545;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTabWidget QWidget QTabBar::tab:last:!selected
|
||||||
|
{
|
||||||
|
background-color: #5c5c5c;
|
||||||
|
border: 1px solid #2e2e2e;
|
||||||
|
}
|
||||||
|
|
||||||
QTabWidget QWidget QTabBar::tab:hover
|
QTabWidget QWidget QTabBar::tab:hover
|
||||||
{
|
{
|
||||||
background-color: #757575;
|
background-color: #757575;
|
||||||
|
|
@ -78,6 +92,13 @@ QTabWidget QWidget QTabBar::tab:hover
|
||||||
border-right: 1px solid #2e2e2e;
|
border-right: 1px solid #2e2e2e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTabWidget QWidget QTabBar::tab:last:hover
|
||||||
|
{
|
||||||
|
background-color: #757575;
|
||||||
|
border: 1px solid #5c5c5c;
|
||||||
|
border-right: 1px solid #2e2e2e;
|
||||||
|
}
|
||||||
|
|
||||||
QTabWidget QWidget QTabWidget::pane /* The contents of the tab (colors, modes, leds, etc.) */
|
QTabWidget QWidget QTabWidget::pane /* The contents of the tab (colors, modes, leds, etc.) */
|
||||||
{
|
{
|
||||||
background-color: #454545;
|
background-color: #454545;
|
||||||
|
|
@ -259,10 +280,15 @@ QDialog
|
||||||
background-color: #5c5c5c
|
background-color: #5c5c5c
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* QTableWidgets */
|
||||||
the default color is fine
|
|
||||||
QSlider::handle
|
QTableWidget
|
||||||
{
|
{
|
||||||
background: ;
|
background-color: #454545;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTableWidget QTableCornerButton::section
|
||||||
|
{
|
||||||
|
background-color: #444444;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue