#include <qtAdskStyleProxy.h>
#include <QtWidgets/QStyleFactory>
#include <QtWidgets/QStyleOption>
#include <QtWidgets/qdrawutil.h>
#include <QtGui/QPalette>
#include <maya/MGlobal.h>
#include <maya/MQtUtil.h>
QStyle *qtAdskStyleProxyPlugin::create(const QString &key)
{
if (key.toLower() == "qtadskstyleproxy")
return new qtAdskStyleProxy();
return nullptr;
}
qtAdskStyleProxy::qtAdskStyleProxy()
: QProxyStyle(QStyleFactory::create(QLatin1String("adskdarkflatui")))
{
}
QPalette qtAdskStyleProxy::standardPalette() const
{
QPalette pal = QProxyStyle::standardPalette();
pal.setBrush(QPalette::Disabled, QPalette::Window, QColor(45,45,45));
pal.setBrush(QPalette::Active, QPalette::Window, QColor(45,45,45));
pal.setBrush(QPalette::Inactive, QPalette::Window, QColor(45,45,45));
pal.setBrush(QPalette::Active, QPalette::WindowText, QColor(133,133,133));
pal.setBrush(QPalette::Inactive, QPalette::WindowText, QColor(133,133,133));
pal.setBrush(QPalette::Active, QPalette::ButtonText, QColor(133,133,133));
pal.setBrush(QPalette::Inactive, QPalette::ButtonText, QColor(133,133,133));
pal.setBrush(QPalette::Active, QPalette::Text, QColor(133,133,133));
pal.setBrush(QPalette::Inactive, QPalette::Text, QColor(133,133,133));
return pal;
}
void qtAdskStyleProxy::drawControl(ControlElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget) const
{
return QProxyStyle::drawControl(element, option, painter, widget);
}
int qtAdskStyleProxy::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
{
int ret = -1;
switch (metric)
{
case PM_MenuTearoffHeight:
break;
default:
break;
}
return (ret != -1) ? ret : QProxyStyle::pixelMetric(metric, option, widget);
}