GH-903 force Dark theme to use Fusion Qt style
Themes now include Qt styles.
This commit is contained in:
@ -1,10 +1,26 @@
|
||||
#include "SystemTheme.h"
|
||||
#include <QApplication>
|
||||
#include <QStyle>
|
||||
#include <QStyleFactory>
|
||||
#include <QDebug>
|
||||
|
||||
SystemTheme::SystemTheme()
|
||||
{
|
||||
systemPalette = QApplication::style()->standardPalette();
|
||||
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()
|
||||
@ -17,6 +33,11 @@ QString SystemTheme::name()
|
||||
return QObject::tr("System");
|
||||
}
|
||||
|
||||
QString SystemTheme::qtTheme()
|
||||
{
|
||||
return systemTheme;
|
||||
}
|
||||
|
||||
QPalette SystemTheme::colorScheme()
|
||||
{
|
||||
return systemPalette;
|
||||
|
Reference in New Issue
Block a user