[effects] Introduce kcfg for FallApart effect
Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3374
This commit is contained in:
parent
feac312ee0
commit
10f641d5d9
4 changed files with 24 additions and 3 deletions
|
@ -106,6 +106,7 @@ kconfig_add_kcfg_files(kwin4_effect_builtins_sources
|
|||
coverswitch/coverswitchconfig.kcfgc
|
||||
desktopgrid/desktopgridconfig.kcfgc
|
||||
diminactive/diminactiveconfig.kcfgc
|
||||
fallapart/fallapartconfig.kcfgc
|
||||
flipswitch/flipswitchconfig.kcfgc
|
||||
glide/glideconfig.kcfgc
|
||||
lookingglass/lookingglassconfig.kcfgc
|
||||
|
|
|
@ -19,9 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*********************************************************************/
|
||||
|
||||
#include "fallapart.h"
|
||||
// KConfigSkeleton
|
||||
#include "fallapartconfig.h"
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <KConfigGroup>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
@ -40,8 +41,8 @@ FallApartEffect::FallApartEffect()
|
|||
|
||||
void FallApartEffect::reconfigure(ReconfigureFlags)
|
||||
{
|
||||
KConfigGroup conf = effects->effectConfig(QStringLiteral("FallApart"));
|
||||
blockSize = qBound(1, conf.readEntry("BlockSize", 40), 100000);
|
||||
FallApartConfig::self()->read();
|
||||
blockSize = FallApartConfig::blockSize();
|
||||
}
|
||||
|
||||
void FallApartEffect::prePaintScreen(ScreenPrePaintData& data, int time)
|
||||
|
|
14
effects/fallapart/fallapart.kcfg
Normal file
14
effects/fallapart/fallapart.kcfg
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?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-FallApart">
|
||||
<entry name="BlockSize" type="Int">
|
||||
<default>40</default>
|
||||
<min>1</min>
|
||||
<max>100000</max>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
5
effects/fallapart/fallapartconfig.kcfgc
Normal file
5
effects/fallapart/fallapartconfig.kcfgc
Normal file
|
@ -0,0 +1,5 @@
|
|||
File=fallapart.kcfg
|
||||
ClassName=FallApartConfig
|
||||
NameSpace=KWin
|
||||
Singleton=true
|
||||
Mutators=true
|
Loading…
Reference in a new issue