[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
This commit is contained in:
parent
10f641d5d9
commit
620663cb28
4 changed files with 27 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
17
effects/slidingpopups/slidingpopups.kcfg
Normal file
17
effects/slidingpopups/slidingpopups.kcfg
Normal file
|
@ -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>
|
||||
|
5
effects/slidingpopups/slidingpopupsconfig.kcfgc
Normal file
5
effects/slidingpopups/slidingpopupsconfig.kcfgc
Normal file
|
@ -0,0 +1,5 @@
|
|||
File=slidingpopups.kcfg
|
||||
ClassName=SlidingPopupsConfig
|
||||
NameSpace=KWin
|
||||
Singleton=true
|
||||
Mutators=true
|
Loading…
Reference in a new issue