From cc86b16817323b1f21374ea57a0942b443b8f261 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Fri, 10 Jun 2022 14:07:20 +0200 Subject: [PATCH] :tada: Add kwin hexagon effect --- kwin/kwin4_effect_hexagon/config.ui | 97 +++++++++++++++++++ kwin/kwin4_effect_hexagon/main.xml | 25 +++++ kwin/kwin4_effect_hexagon/onAnimationBegin.js | 4 + .../kwin4_effect_hexagon/onSettingsChanged.js | 10 ++ 4 files changed, 136 insertions(+) create mode 100755 kwin/kwin4_effect_hexagon/config.ui create mode 100755 kwin/kwin4_effect_hexagon/main.xml create mode 100644 kwin/kwin4_effect_hexagon/onAnimationBegin.js create mode 100644 kwin/kwin4_effect_hexagon/onSettingsChanged.js diff --git a/kwin/kwin4_effect_hexagon/config.ui b/kwin/kwin4_effect_hexagon/config.ui new file mode 100755 index 0000000..56ad8db --- /dev/null +++ b/kwin/kwin4_effect_hexagon/config.ui @@ -0,0 +1,97 @@ + + + BMWConfigForm + + + + 0 + 0 + 562 + 365 + + + + + + + Duration: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Color: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + kcfg_Color + + + + + + + + 0 + 0 + + + + + + + + Scale: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + kcfg_Color + + + + + + + 0.100000000000000 + + + 10.000000000000000 + + + + + + + milliseconds + + + 100 + + + 9999 + + + 100 + + + + + + + + KColorCombo + QComboBox +
kcolorcombo.h
+
+
+ + +
\ No newline at end of file diff --git a/kwin/kwin4_effect_hexagon/main.xml b/kwin/kwin4_effect_hexagon/main.xml new file mode 100755 index 0000000..a59b79c --- /dev/null +++ b/kwin/kwin4_effect_hexagon/main.xml @@ -0,0 +1,25 @@ + + + + + + 1500 + + + 3 + + + 2 + + + 200, 255, 255, 0.5 + + + 20, 80, 255, 0.5 + + + true + + + \ No newline at end of file diff --git a/kwin/kwin4_effect_hexagon/onAnimationBegin.js b/kwin/kwin4_effect_hexagon/onAnimationBegin.js new file mode 100644 index 0000000..12be257 --- /dev/null +++ b/kwin/kwin4_effect_hexagon/onAnimationBegin.js @@ -0,0 +1,4 @@ +// 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()]); diff --git a/kwin/kwin4_effect_hexagon/onSettingsChanged.js b/kwin/kwin4_effect_hexagon/onSettingsChanged.js new file mode 100644 index 0000000..2def1ec --- /dev/null +++ b/kwin/kwin4_effect_hexagon/onSettingsChanged.js @@ -0,0 +1,10 @@ +// 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, 'uAdditiveBlending', + effect.readConfig('AdditiveBlending', true)); +effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0)); +effect.setUniform(this.shader, 'uLineWidth', effect.readConfig('LineWidth', 1.0)); +effect.setUniform(this.shader, 'uGlowColor', effect.readConfig('GlowColor', 'white')); +effect.setUniform(this.shader, 'uLineColor', effect.readConfig('LineColor', 'white'));