aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <[email protected]>2016-11-16 09:02:44 +0100
committerMartin Gräßlin <[email protected]>2016-11-16 13:05:02 +0100
commit620663cb281f1a8f38d4cfc20b67ed9932413e6b (patch)
treed3d60c1b0a5280a67f4d146e343aab00f7f9926a
parent10f641d5d969136c5adcf73eda36795661ce7247 (diff)
[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
-rw-r--r--effects/CMakeLists.txt1
-rw-r--r--effects/slidingpopups/slidingpopups.cpp8
-rw-r--r--effects/slidingpopups/slidingpopups.kcfg17
-rw-r--r--effects/slidingpopups/slidingpopupsconfig.kcfgc5
4 files changed, 27 insertions, 4 deletions
diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt
index 263d77a..73dd8bb 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 9f82b91..174f67b 100644
--- a/effects/slidingpopups/slidingpopups.cpp
+++ b/effects/slidingpopups/slidingpopups.cpp
@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "slidingpopups.h"
+#include "slidingpopupsconfig.h"
-#include <KConfigGroup>
#include <QTimeLine>
#include <QApplication>
@@ -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 0000000..414cf18
--- /dev/null
+++ b/effects/slidingpopups/slidingpopups.kcfg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="kwinrc"/>
+ <group name="Effect-SlidingPopups">
+ <entry name="SlideInTime" type="Int">
+ <default>0</default>
+ </entry>
+ <entry name="SlideOutTime" type="Int">
+ <default>0</default>
+ </entry>
+ </group>
+</kcfg>
+
diff --git a/effects/slidingpopups/slidingpopupsconfig.kcfgc b/effects/slidingpopups/slidingpopupsconfig.kcfgc
new file mode 100644
index 0000000..6a8c915
--- /dev/null
+++ b/effects/slidingpopups/slidingpopupsconfig.kcfgc
@@ -0,0 +1,5 @@
+File=slidingpopups.kcfg
+ClassName=SlidingPopupsConfig
+NameSpace=KWin
+Singleton=true
+Mutators=true