🎉 Add initial KWin version of the portal effect

This commit is contained in:
Simon Schneegans
2022-12-22 20:33:27 +01:00
parent dbbb79b5af
commit 87281c89df
5 changed files with 126 additions and 0 deletions
+1
View File
@@ -138,6 +138,7 @@ generate "incinerate" "Incinerate [Burn-My-Windows]" "A less snappy but defini
generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and randomly hide the pixels"
generate "pixel-wheel" "Pixel Wheel [Burn-My-Windows]" "Pixelate the window and hide the pixels in a wheel-like fashion"
generate "pixel-wipe" "Pixel Wipe [Burn-My-Windows]" "Pixelate the window and hide the pixels radially, starting from the pointer position"
generate "portal" "Portal [Burn-My-Windows]" "Transfer your windows to other locations in space and time"
generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV"
generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies"
+77
View File
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
SPDX-License-Identifier: GPL-3.0-or-later
-->
<ui version="4.0">
<class>BMWConfigForm</class>
<widget class="QWidget" name="BMWConfigForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>562</width>
<height>365</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Duration:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Color:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_Color</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KColorButton" name="kcfg_Color">
<property name="alphaChannelEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="kcfg_Duration">
<property name="suffix">
<string> milliseconds</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
</customwidgets>
<resources />
<connections />
</ui>
+29
View File
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
SPDX-License-Identifier: GPL-3.0-or-later
-->
<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="" />
<group name="">
<entry name="Duration" type="UInt">
<default>1500</default>
</entry>
<entry name="Color" type="Color">
<default>#79E918</default>
</entry>
<entry name="Details" type="Double">
<default>15.0</default>
</entry>
<entry name="RotationSpeed" type="Double">
<default>0.3</default>
</entry>
<entry name="Whirl" type="Double">
<default>1.0</default>
</entry>
</group>
</kcfg>
+7
View File
@@ -0,0 +1,7 @@
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: GPL-3.0-or-later
// This part is automatically included in the effect's source during the build process.
// The code below is called whenever a window is closed or opened.
effect.setUniform(this.shader, 'uSeed', [Math.random(), Math.random()]);
+12
View File
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: GPL-3.0-or-later
// This part is automatically included in the effect's source during the build process.
// The code below is called whenever the user changes something in the configuration of
// the effect.
effect.setUniform(this.shader, 'uDuration', this.duration * 0.001);
effect.setUniform(this.shader, 'uColor', this.readRGBConfig('Color'));
effect.setUniform(this.shader, 'uDetails', this.readConfig('Details', 1.0));
effect.setUniform(this.shader, 'uRotationSpeed', this.readConfig('RotationSpeed', 1.0));
effect.setUniform(this.shader, 'uWhirl', this.readConfig('Whirl', 1.0));