From 620663cb281f1a8f38d4cfc20b67ed9932413e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 16 Nov 2016 09:02:44 +0100 Subject: [PATCH] [effects] Introduce kcfg for SlidingPopups Summary: Uses the normal animationTime kcfg settings. Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3375 --- effects/CMakeLists.txt | 1 + effects/slidingpopups/slidingpopups.cpp | 8 ++++---- effects/slidingpopups/slidingpopups.kcfg | 17 +++++++++++++++++ effects/slidingpopups/slidingpopupsconfig.kcfgc | 5 +++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 effects/slidingpopups/slidingpopups.kcfg create mode 100644 effects/slidingpopups/slidingpopupsconfig.kcfgc diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt index 263d77a9fe..73dd8bb884 100644 --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -117,6 +117,7 @@ kconfig_add_kcfg_files(kwin4_effect_builtins_sources presentwindows/presentwindowsconfig.kcfgc resize/resizeconfig.kcfgc showfps/showfpsconfig.kcfgc + slidingpopups/slidingpopupsconfig.kcfgc thumbnailaside/thumbnailasideconfig.kcfgc trackmouse/trackmouseconfig.kcfgc windowgeometry/windowgeometryconfig.kcfgc diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 9f82b91408..174f67b65b 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -19,8 +19,8 @@ along with this program. If not, see . *********************************************************************/ #include "slidingpopups.h" +#include "slidingpopupsconfig.h" -#include #include #include @@ -57,9 +57,9 @@ SlidingPopupsEffect::~SlidingPopupsEffect() void SlidingPopupsEffect::reconfigure(ReconfigureFlags flags) { Q_UNUSED(flags) - KConfigGroup conf = effects->effectConfig(QStringLiteral("SlidingPopups")); - mFadeInTime = animationTime(conf, QStringLiteral("SlideInTime"), 150); - mFadeOutTime = animationTime(conf, QStringLiteral("SlideOutTime"), 250); + SlidingPopupsConfig::self()->read(); + mFadeInTime = animationTime(SlidingPopupsConfig::slideInTime() != 0 ? SlidingPopupsConfig::slideInTime() : 150); + mFadeOutTime = animationTime(SlidingPopupsConfig::slideOutTime() != 0 ? SlidingPopupsConfig::slideOutTime() : 250); QHash< const EffectWindow*, QTimeLine* >::iterator it = mAppearingWindows.begin(); while (it != mAppearingWindows.end()) { it.value()->setDuration(animationTime(mFadeInTime)); diff --git a/effects/slidingpopups/slidingpopups.kcfg b/effects/slidingpopups/slidingpopups.kcfg new file mode 100644 index 0000000000..414cf18a79 --- /dev/null +++ b/effects/slidingpopups/slidingpopups.kcfg @@ -0,0 +1,17 @@ + + + + + + + 0 + + + 0 + + + + diff --git a/effects/slidingpopups/slidingpopupsconfig.kcfgc b/effects/slidingpopups/slidingpopupsconfig.kcfgc new file mode 100644 index 0000000000..6a8c915f51 --- /dev/null +++ b/effects/slidingpopups/slidingpopupsconfig.kcfgc @@ -0,0 +1,5 @@ +File=slidingpopups.kcfg +ClassName=SlidingPopupsConfig +NameSpace=KWin +Singleton=true +Mutators=true