aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-08-02 21:00:16 +0000
committerWeblate <noreply@weblate.org>2017-08-02 21:00:16 +0000
commit3d511a0f8285088eba24cb22b15cda039d27f6a0 (patch)
tree2eccf8b44a5e9862e6733880c37d57a9af74b41a /src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin
parentTranslated using Weblate (Spanish) (diff)
parentFix up the screensaver animation crashes *again*. (diff)
downloadlumina-3d511a0f8285088eba24cb22b15cda039d27f6a0.tar.gz
lumina-3d511a0f8285088eba24cb22b15cda039d27f6a0.tar.bz2
lumina-3d511a0f8285088eba24cb22b15cda039d27f6a0.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin')
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengine-qtplugin.pro4
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp79
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/main.cpp7
3 files changed, 33 insertions, 57 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengine-qtplugin.pro b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengine-qtplugin.pro
index 064c7642..a186cd49 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengine-qtplugin.pro
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengine-qtplugin.pro
@@ -19,10 +19,6 @@ SOURCES += \
lthemeengineplatformtheme.cpp \
../lthemeengine/lthemeengine.cpp
-!equals (DISABLE_WIDGETS,1) {
- QT += widgets
-}
-
OTHER_FILES += lthemeengine.json
INCLUDEPATH += ../
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp
index dcede34c..9d6c9bea 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp
@@ -82,8 +82,7 @@ const QPalette *lthemeenginePlatformTheme::palette(QPlatformTheme::Palette type)
}
const QFont *lthemeenginePlatformTheme::font(QPlatformTheme::Font type) const{
- if(type == QPlatformTheme::FixedFont)
- return &m_fixedFont;
+ if(type == QPlatformTheme::FixedFont){ return &m_fixedFont; }
return &m_generalFont;
}
@@ -105,16 +104,15 @@ QVariant lthemeenginePlatformTheme::themeHint(QPlatformTheme::ThemeHint hint) co
}
void lthemeenginePlatformTheme::applySettings(){
- if(!QGuiApplication::desktopSettingsAware())
- return;
+ if(!QGuiApplication::desktopSettingsAware()){ return; }
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
- if(!m_update){
- //do not override application palette
- if(QCoreApplication::testAttribute(Qt::AA_SetPalette)){
- m_usePalette = false;
- qCDebug(llthemeengine) << "palette support is disabled";
- }
- }
+ if(!m_update){
+ //do not override application palette
+ if(QCoreApplication::testAttribute(Qt::AA_SetPalette)){
+ m_usePalette = false;
+ qCDebug(llthemeengine) << "palette support is disabled";
+ }
+ }
#endif
#ifdef QT_WIDGETS_LIB
if(hasWidgets()){
@@ -127,36 +125,29 @@ void lthemeenginePlatformTheme::applySettings(){
#else
qApp->setWheelScrollLines(m_wheelScrollLines);
#endif
- if(m_update && qApp->style()->objectName() == "lthemeengine-style") //ignore application style
- qApp->setStyle("lthemeengine-style"); //recreate style object
- if(m_update && m_usePalette){
- if(m_customPalette)
- qApp->setPalette(*m_customPalette);
- else
- qApp->setPalette(qApp->style()->standardPalette());
- }
+ if(m_update && qApp->style()->objectName() == "lthemeengine-style") /* ignore application style */ { qApp->setStyle("lthemeengine-style"); } //recreate style object
+ if(m_update && m_usePalette){
+ if(m_customPalette){ qApp->setPalette(*m_customPalette); }
+ else{ qApp->setPalette(qApp->style()->standardPalette()); }
+ }
//do not override application style
- if(m_prevStyleSheet == qApp->styleSheet())
- qApp->setStyleSheet(m_userStyleSheet);
- else
- qCDebug(llthemeengine) << "custom style sheet is disabled";
- m_prevStyleSheet = m_userStyleSheet;
+ if(m_prevStyleSheet == qApp->styleSheet()){ qApp->setStyleSheet(m_userStyleSheet); }
+ else{ qCDebug(llthemeengine) << "custom style sheet is disabled";}
+ m_prevStyleSheet = m_userStyleSheet;
}
#endif
QGuiApplication::setFont(m_generalFont); //apply font
QIcon::setThemeName(m_iconTheme); //apply icons
- if(m_customPalette && m_usePalette)
- QGuiApplication::setPalette(*m_customPalette); //apply palette
+ if(m_customPalette && m_usePalette){ QGuiApplication::setPalette(*m_customPalette); } //apply palette
#ifdef QT_WIDGETS_LIB
- if(hasWidgets()){
- foreach (QWidget *w, qApp->allWidgets()){
+ if(hasWidgets()){
+ foreach (QWidget *w, qApp->allWidgets()){
QEvent e(QEvent::ThemeChange);
QApplication::sendEvent(w, &e);
}
}
#endif
- if(!m_update)
- m_update = true;
+ if(!m_update){ m_update = true; }
}
#ifdef QT_WIDGETS_LIB
@@ -210,20 +201,13 @@ void lthemeenginePlatformTheme::readSettings(){
if(settings.childKeys().contains("gui_effects")){
QStringList effectList = settings.value("gui_effects").toStringList();
m_uiEffects = 0;
- if(effectList.contains("General"))
- m_uiEffects |= QPlatformTheme::GeneralUiEffect;
- if(effectList.contains("AnimateMenu"))
- m_uiEffects |= QPlatformTheme::AnimateMenuUiEffect;
- if(effectList.contains("FadeMenu"))
- m_uiEffects |= QPlatformTheme::FadeMenuUiEffect;
- if(effectList.contains("AnimateCombo"))
- m_uiEffects |= QPlatformTheme::AnimateComboUiEffect;
- if(effectList.contains("AnimateTooltip"))
- m_uiEffects |= QPlatformTheme::AnimateTooltipUiEffect;
- if(effectList.contains("FadeTooltip"))
- m_uiEffects |= QPlatformTheme::FadeTooltipUiEffect;
- if(effectList.contains("AnimateToolBox"))
- m_uiEffects |= QPlatformTheme::AnimateToolBoxUiEffect;
+ if(effectList.contains("General")){ m_uiEffects |= QPlatformTheme::GeneralUiEffect; }
+ if(effectList.contains("AnimateMenu")){ m_uiEffects |= QPlatformTheme::AnimateMenuUiEffect; }
+ if(effectList.contains("FadeMenu")){ m_uiEffects |= QPlatformTheme::FadeMenuUiEffect; }
+ if(effectList.contains("AnimateCombo")){ m_uiEffects |= QPlatformTheme::AnimateComboUiEffect; }
+ if(effectList.contains("AnimateTooltip")){ m_uiEffects |= QPlatformTheme::AnimateTooltipUiEffect; }
+ if(effectList.contains("FadeTooltip")){ m_uiEffects |= QPlatformTheme::FadeTooltipUiEffect; }
+ if(effectList.contains("AnimateToolBox")){ m_uiEffects |= QPlatformTheme::AnimateToolBoxUiEffect; }
}
//load style sheets
#ifdef QT_WIDGETS_LIB
@@ -242,8 +226,7 @@ bool lthemeenginePlatformTheme::hasWidgets(){
QString lthemeenginePlatformTheme::loadStyleSheets(const QStringList &paths){
QString content;
foreach (QString path, paths){
- if(!QFile::exists(path))
- continue;
+ if(!QFile::exists(path)){ continue; }
QFile file(path);
file.open(QIODevice::ReadOnly);
content.append(file.readAll());
@@ -270,8 +253,6 @@ QPalette lthemeenginePlatformTheme::loadColorScheme(const QString &filePath){
customPalette.setColor(QPalette::Disabled, role, QColor(disabledColors.at(i)));
}
}
- else{
- customPalette = *QPlatformTheme::palette(SystemPalette); //load fallback palette
- }
+ else{ customPalette = *QPlatformTheme::palette(SystemPalette); } //load fallback palette
return customPalette;
}
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/main.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/main.cpp
index 12e4a581..28898890 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/main.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/main.cpp
@@ -11,10 +11,9 @@ public:
};
QPlatformTheme *lthemeenginePlatformThemePlugin::create(const QString &key, const QStringList &params){
- Q_UNUSED(params);
- if (key.toLower() == "lthemeengine")
- return new lthemeenginePlatformTheme();
- return NULL;
+ Q_UNUSED(params);
+ if (key.toLower() == "lthemeengine") { return new lthemeenginePlatformTheme(); }
+ return NULL;
}
QT_END_NAMESPACE
bgstack15