mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-29 09:15:49 +00:00
bc753859b5
Files you can customize are created in themes/custom/
60 lines
959 B
C++
60 lines
959 B
C++
#include "SystemTheme.h"
|
|
#include <QApplication>
|
|
#include <QStyle>
|
|
#include <QStyleFactory>
|
|
#include <QDebug>
|
|
|
|
SystemTheme::SystemTheme()
|
|
{
|
|
const auto & style = QApplication::style();
|
|
systemPalette = style->standardPalette();
|
|
QString lowerThemeName = style->objectName();
|
|
qWarning() << systemTheme;
|
|
QStringList styles = QStyleFactory::keys();
|
|
for(auto &st: styles)
|
|
{
|
|
if(st.toLower() == lowerThemeName)
|
|
{
|
|
systemTheme = st;
|
|
return;
|
|
}
|
|
}
|
|
// fall back to fusion if we can't find the current theme.
|
|
systemTheme = "Fusion";
|
|
}
|
|
|
|
QString SystemTheme::id()
|
|
{
|
|
return "system";
|
|
}
|
|
|
|
QString SystemTheme::name()
|
|
{
|
|
return QObject::tr("System");
|
|
}
|
|
|
|
QString SystemTheme::qtTheme()
|
|
{
|
|
return systemTheme;
|
|
}
|
|
|
|
QPalette SystemTheme::colorScheme()
|
|
{
|
|
return systemPalette;
|
|
}
|
|
|
|
QString SystemTheme::appStyleSheet()
|
|
{
|
|
return QString();
|
|
}
|
|
|
|
double SystemTheme::fadeAmount()
|
|
{
|
|
return 0.5;
|
|
}
|
|
|
|
QColor SystemTheme::fadeColor()
|
|
{
|
|
return QColor(128,128,128);
|
|
}
|