From 876920586bdfc2643d4e547847605d91ac740ffc Mon Sep 17 00:00:00 2001 From: Marcus Gursch Date: Mon, 27 May 2024 14:59:50 +0200 Subject: [PATCH] refine and port to plasma 6 --- .../contents/code/main.js | 13 +- kinetic_fadingpopups/metadata.json | 142 +++++++++++++++ kinetic_maximize/contents/code/main.js | 125 +++++++++++++ kinetic_maximize/metadata.json | 139 ++++++++++++++ .../contents/code/main.js | 17 +- kinetic_scale/metadata.json | 104 +++++++++++ kinetic_squash/contents/code/main.js | 160 ++++++++++++++++ kinetic_squash/metadata.json | 138 ++++++++++++++ .../metadata.desktop | 15 -- .../metadata.json | 18 -- .../contents/code/maximize.js | 100 ---------- .../metadata.desktop | 17 -- kwin4_effect_maximize_kinetic/metadata.json | 21 --- .../contents/code/main.js | 171 ------------------ .../metadata.desktop | 19 -- kwin4_effect_minimize_kinetic/metadata.json | 22 --- .../metadata.desktop | 19 -- kwin4_effect_open_close_kinetic/metadata.json | 21 --- 18 files changed, 831 insertions(+), 430 deletions(-) rename {kwin4_effect_fadingpopups_kinetic => kinetic_fadingpopups}/contents/code/main.js (93%) create mode 100644 kinetic_fadingpopups/metadata.json create mode 100644 kinetic_maximize/contents/code/main.js create mode 100644 kinetic_maximize/metadata.json rename {kwin4_effect_open_close_kinetic => kinetic_scale}/contents/code/main.js (89%) create mode 100644 kinetic_scale/metadata.json create mode 100644 kinetic_squash/contents/code/main.js create mode 100644 kinetic_squash/metadata.json delete mode 100644 kwin4_effect_fadingpopups_kinetic/metadata.desktop delete mode 100644 kwin4_effect_fadingpopups_kinetic/metadata.json delete mode 100644 kwin4_effect_maximize_kinetic/contents/code/maximize.js delete mode 100644 kwin4_effect_maximize_kinetic/metadata.desktop delete mode 100644 kwin4_effect_maximize_kinetic/metadata.json delete mode 100644 kwin4_effect_minimize_kinetic/contents/code/main.js delete mode 100644 kwin4_effect_minimize_kinetic/metadata.desktop delete mode 100644 kwin4_effect_minimize_kinetic/metadata.json delete mode 100644 kwin4_effect_open_close_kinetic/metadata.desktop delete mode 100644 kwin4_effect_open_close_kinetic/metadata.json diff --git a/kwin4_effect_fadingpopups_kinetic/contents/code/main.js b/kinetic_fadingpopups/contents/code/main.js similarity index 93% rename from kwin4_effect_fadingpopups_kinetic/contents/code/main.js rename to kinetic_fadingpopups/contents/code/main.js index 420bcf0..498e03d 100644 --- a/kwin4_effect_fadingpopups_kinetic/contents/code/main.js +++ b/kinetic_fadingpopups/contents/code/main.js @@ -58,7 +58,8 @@ function isPopupWindow(window) { // was doing that. if (window.dock || window.splash || window.toolbar || window.notification || window.onScreenDisplay - || window.criticalNotification) { + || window.criticalNotification + || window.appletPopup) { return true; } @@ -67,8 +68,8 @@ function isPopupWindow(window) { var fadingPopupsEffect = { loadConfig: function () { - fadingPopupsEffect.fadeInDuration = animationTime(50); - fadingPopupsEffect.fadeOutDuration = animationTime(67); + fadingPopupsEffect.fadeInDuration = animationTime(200); + fadingPopupsEffect.fadeOutDuration = animationTime(200); }, slotWindowAdded: function (window) { if (effects.hasActiveFullScreenEffect) { @@ -85,10 +86,10 @@ var fadingPopupsEffect = { } window.fadeInAnimation = animate({ window: window, - curve: QEasingCurve.Linear, + curve: QEasingCurve.OutCubic, duration: fadingPopupsEffect.fadeInDuration, type: Effect.Opacity, - from: 0.25, + from: 0.2, to: 1.0 }); }, @@ -107,7 +108,7 @@ var fadingPopupsEffect = { } window.fadeOutAnimation = animate({ window: window, - curve: QEasingCurve.Linear, + curve: QEasingCurve.OutCubic, duration: fadingPopupsEffect.fadeOutDuration, type: Effect.Opacity, from: 0.80, diff --git a/kinetic_fadingpopups/metadata.json b/kinetic_fadingpopups/metadata.json new file mode 100644 index 0000000..4be41be --- /dev/null +++ b/kinetic_fadingpopups/metadata.json @@ -0,0 +1,142 @@ +{ + "KPackageStructure": "KWin/Effect", + "KPlugin": { + "Authors": [ + { + "Email": "vlad.zahorodnii@kde.org", + "Name": "Vlad Zahorodnii", + "Name[ar]": "فلاد زاهورودني", + "Name[az]": "Vlad Zahorodnii", + "Name[be]": "Vlad Zahorodnii", + "Name[bg]": "Vlad Zahorodnii", + "Name[ca@valencia]": "Vlad Zahorodnii", + "Name[ca]": "Vlad Zahorodnii", + "Name[cs]": "Vlad Zahorodnii", + "Name[de]": "Vlad Zahorodnii", + "Name[en_GB]": "Vlad Zahorodnii", + "Name[eo]": "Vlad Zahorodnii", + "Name[es]": "Vlad Zahorodnii", + "Name[et]": "Vlad Zahorodnii", + "Name[eu]": "Vlad Zahorodnii", + "Name[fi]": "Vlad Zahorodnii", + "Name[fr]": "Vlad Zahorodnii", + "Name[gl]": "Vlad Zahorodnii.", + "Name[he]": "ולאד זהורודני", + "Name[hu]": "Vlad Zahorodnii", + "Name[ia]": "Vlad Zahorodnii", + "Name[id]": "Vlad Zahorodnii", + "Name[is]": "Vlad Zahorodnii", + "Name[it]": "Vlad Zahorodnii", + "Name[ja]": "Vlad Zahorodnii", + "Name[ka]": "Vlad Zahorodnii", + "Name[ko]": "Vlad Zahorodnii", + "Name[lt]": "Vlad Zahorodnii", + "Name[nl]": "Vlad Zahorodnii", + "Name[nn]": "Vlad Zahorodnii", + "Name[pl]": "Vlad Zahorodnii", + "Name[pt]": "Vlad Zahorodnii", + "Name[pt_BR]": "Vlad Zahorodnii", + "Name[ro]": "Vlad Zahorodnii", + "Name[ru]": "Влад Загородний", + "Name[sk]": "Vlad Zahorodnii", + "Name[sl]": "Vlad Zahorodnii", + "Name[sv]": "Vlad Zahorodnii", + "Name[ta]": "விலாட் ஜாஹொரிடுனி", + "Name[tr]": "Vlad Zahorodnii", + "Name[uk]": "Влад Загородній", + "Name[vi]": "Vlad Zahorodnii", + "Name[x-test]": "xxVlad Zahorodniixx", + "Name[zh_CN]": "Vlad Zahorodnii", + "Name[zh_TW]": "Vlad Zahorodnii" + } + ], + "Category": "Appearance", + "Description": "Make popups smoothly fade in and out when they are shown or hidden", + "Description[ar]": "اجعل النوافذ المنبثقة تظهر وتتلاشى بنعومة عند إظهاراها وإخفائها", + "Description[be]": "Плаўнае згасанне або з'яўленне выплыўных акон", + "Description[bg]": "Постепенно избледняване при показване и скриване на изскачащите прозорци", + "Description[ca@valencia]": "Fa que els missatges emergents s'encengen o s'apaguen de manera gradual quan es mostren o s'oculten", + "Description[ca]": "Fa que els missatges emergents s'encenguin o s'apaguin de manera gradual quan es mostren o s'oculten", + "Description[cs]": "Nechá vyskakovací okna plynule zmizet/objevit se, pokud jsou zobrazeny resp. skryty", + "Description[de]": "Blendet Aufklappfenster beim Öffnen/Schließen langsam ein bzw. aus", + "Description[en_GB]": "Make popups smoothly fade in and out when they are shown or hidden", + "Description[eo]": "Fari ŝprucfenestrojn glate mal- kaj fordissolvi kiam ili estas montritaj aŭ kaŝitaj", + "Description[es]": "Hacer que las ventanas emergentes se desvanezcan y reaparezcan suavemente al mostrarlas y al ocultarlas", + "Description[et]": "Paneb hüpikaknad sujuvalt hääbuma või tugevnema, kui need peidetakse või nähtavale tuuakse", + "Description[eu]": "Gainerakorrak emeki koloregabetu/koloretu haiek erakustean edo ezkutatzean", + "Description[fi]": "Häivyttää ponnahdusikkunat pehmeästi näytölle tai näytöltä", + "Description[fr]": "Faire un fondu enchaîné avant ou arrière des infobulles lorsqu'elles sont affichées ou masquées", + "Description[gl]": "Esvae e fai opacas as xanelas emerxentes con suavidade ao mostralas ou agochadas.", + "Description[he]": "לגרום לחלוניות צצות להתעמעם פנימה או החוצה בצורה חלקה כשהם מופיעים או מוסתרים", + "Description[hu]": "A felugrók folyamatosan áttűnő módon lesznek elrejtve és megjelenítve", + "Description[ia]": "Face que fenestras pote dulcemente pallidir intra e foras quando illos es monstrate o celate", + "Description[is]": "Láta sprettiglugga birtast og hverfa mjúklega þegar þeir eru opnaðir eða faldir", + "Description[it]": "Fai dissolvere e comparire gradualmente le finestre a comparsa quando vengono mostrate o nascoste", + "Description[ja]": "ポップアップが表示/非表示時にフェードします", + "Description[ka]": "მხტუნარების რბილი მინავლება და გამოჩენა, როცა ისინი იმალება ან გამოჩნდებიან", + "Description[ko]": "팝업이 보여지거나 감춰질 때 부드러운 페이드 인/아웃을 사용합니다", + "Description[lt]": "Padaryti, kad iškylantieji langai glotniai laipsniškai atsirastų ir išnyktų, kai yra rodomi ar slepiami", + "Description[nl]": "Laat pop-ups vloeiend opkomen/vervagen als ze worden weergegeven of verborgen", + "Description[nn]": "Ton sprettoppvindauge gradvis inn og ut når dei vert viste eller gøymde", + "Description[pl]": "Okna wysuwne gładko wyłaniają się przy otwieraniu i zanikają przy zamykaniu", + "Description[pt]": "Faz com que as janelas modais apareçam e desapareçam suavemente quando são apresentadas ou escondidas", + "Description[ro]": "Face indiciile să se (de)coloreze când sunt arătate sau ascunse", + "Description[ru]": "Всплывающие окна при закрытии будут становиться всё более прозрачными, а потом совсем исчезать", + "Description[sk]": "Plynulé objavovanie a miznutie vyskakovacích okien pri ich zobrazení alebo skrytí", + "Description[sl]": "Modalna okna naj se gladko odtemnijo oz. zatemnijo, kadar se prikažejo ali skrijejo", + "Description[ta]": "தெரித்தெழும் சாளரங்கள் காட்டப்படும்போது படிப்படியாக ஒளிகூடி மறைக்கப்படும்போது மங்கி செல்லும்", + "Description[tr]": "Açılır pencereler gösterilirken veya gizlenirken pürüzsüzce geçiş yapmalarını sağlar", + "Description[uk]": "Поступова поява або зникнення контекстних вікон вікон при відкритті чи закритті", + "Description[vi]": "Làm ô bật lên hiện dần và mờ dần một cách êm dịu khi chúng hiện ra và biến mất", + "Description[x-test]": "xxMake popups smoothly fade in and out when they are shown or hiddenxx", + "Description[zh_CN]": "气泡信息显示/隐藏时呈现渐入渐出过渡动画", + "Description[zh_TW]": "讓彈出視窗在顯示或隱藏的時候平滑地淡入或淡出", + "EnabledByDefault": false, + "Icon": "preferences-system-windows-effect-fadingpopups", + "Id": "kinetic_fadingpopups", + "License": "GPL", + "Name": "Fading Popups (Kinetic)", + "Name[ar]": "تتلاشى النوافذ المنبثقة (Kinetic)", + "Name[be]": "Згасанне выплыўных акон (Kinetic)", + "Name[bg]": "Избледняващи изскачащи прозорци (Kinetic)", + "Name[ca@valencia]": "Missatges emergents esvaïts (Kinetic)", + "Name[ca]": "Missatges emergents esvaïts (Kinetic)", + "Name[cs]": "Mizející vyskakovací okna (Kinetic)", + "Name[de]": "Überblendete Aufklappfenster (Kinetic)", + "Name[en_GB]": "Fading Popups (Kinetic)", + "Name[eo]": "Fading Popups (Kinetic)", + "Name[es]": "Desvanecer ventanas emergentes (Kinetic)", + "Name[et]": "Hääbuvad hüpikdialoogid (Kinetic)", + "Name[eu]": "Itzaleztatzen diren gainerakorrak (Kinetic)", + "Name[fi]": "Ponnahdusikkunoiden häivytys (Kinetic)", + "Name[fr]": "Atténuation des infobulles (Kinetic)", + "Name[gl]": "Xanelas emerxentes que esvaen (Kinetic)", + "Name[he]": "חלונית צצות דועכות (Kinetic)", + "Name[hu]": "Áttűnő felugrók (Kinetic)", + "Name[ia]": "Popups dissolvente (Kinetic)", + "Name[is]": "Dofnandi sprettigluggar (Kinetic)", + "Name[it]": "Finestre a comparsa che si dissolvono (Kinetic)", + "Name[ja]": "フェードするポップアップ (Kinetic)", + "Name[ka]": "მინავლებადი მხტუნარები (Kinetic)", + "Name[ko]": "페이드 팝업 (Kinetic)", + "Name[lt]": "Laipsniškai išnykstantys ir atsirandantys iškylantieji langai (Kinetic)", + "Name[nl]": "Vervagende pop-ups (Kinetic)", + "Name[nn]": "Inn- og uttoning av sprettoppvindauge (Kinetic)", + "Name[pl]": "Zanikanie okien wysuwnych (Kinetic)", + "Name[pt]": "Janelas a Desvanecer (Kinetic)", + "Name[pt_BR]": "Desvanecer mensagens (Kinetic)", + "Name[ro]": "Indicii estompate (Kinetic)", + "Name[ru]": "Растворяющиеся всплывающие окна (Kinetic)", + "Name[sk]": "Miznúce vyskakovacie okná (Kinetic)", + "Name[sl]": "Prelivni pojavni gradniki (Kinetic)", + "Name[ta]": "தெரித்தெழும் சாளரங்கள் மங்கும் (Kinetic)", + "Name[tr]": "Solan Açılır Pencereler (Kinetic)", + "Name[uk]": "Інтерактивні контекстні панелі (Kinetic)", + "Name[vi]": "Ô bật lên ngả màu (Kinetic)", + "Name[x-test]": "xxFading Popupsxx (Kinetic)", + "Name[zh_CN]": "气泡显隐渐变动画 (Kinetic)", + "Name[zh_TW]": "淡化彈出視窗 (Kinetic)" + }, + "X-KDE-Ordering": 60, + "X-Plasma-API": "javascript" +} diff --git a/kinetic_maximize/contents/code/main.js b/kinetic_maximize/contents/code/main.js new file mode 100644 index 0000000..db996d3 --- /dev/null +++ b/kinetic_maximize/contents/code/main.js @@ -0,0 +1,125 @@ +/* + This file is part of the KDE project. + + SPDX-FileCopyrightText: 2012 Martin Gräßlin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +"use strict"; + +class MaximizeKineticEffect { + constructor() { + effect.configChanged.connect(this.loadConfig.bind(this)); + effect.animationEnded.connect(this.restoreForceBlurState.bind(this)); + + effects.windowAdded.connect(this.manage.bind(this)); + for (const window of effects.stackingOrder) { + this.manage(window); + } + + this.loadConfig(); + this.snappyness = 0.37; + } + + loadConfig() { + this.duration = animationTime(317); + } + + manage(window) { + window.windowFrameGeometryChanged.connect(this.onWindowFrameGeometryChanged.bind(this)); + window.windowMaximizedStateChanged.connect(this.onWindowMaximizedStateChanged.bind(this)); + window.windowMaximizedStateAboutToChange.connect(this.onWindowMaximizedStateAboutToChange.bind(this)); + } + + onWindowMaximizedStateAboutToChange(window) { + if (!window.visible) { + return; + } + + window.oldGeometry = Object.assign({}, window.geometry); + + if (window.maximizeAnimation1) { + cancel(window.maximizeAnimation1); + delete window.maximizeAnimation1; + } + let couldRetarget = false; + if (window.maximizeAnimation2) { + couldRetarget = retarget(window.maximizeAnimation2, 1.0, this.duration); + } + if (!couldRetarget) { + window.maximizeAnimation2 = animate({ + window: window, + duration: this.duration, + animations: [{ + type: Effect.CrossFadePrevious, + to: 1.0, + from: this.snappiness, + curve: QEasingCurve.OutExpo + }] + }); + } + } + + onWindowMaximizedStateChanged(window) { + if (!window.visible || !window.oldGeometry) { + return; + } + window.setData(Effect.WindowForceBlurRole, true); + const oldGeometry = window.oldGeometry; + const newGeometry = window.geometry; + window.maximizeAnimation1 = animate({ + window: window, + duration: this.duration, + animations: [{ + type: Effect.Size, + to: { + value1: newGeometry.width, + value2: newGeometry.height + }, + from: { + value1: oldGeometry.width + this.snappyness * (newGeometry.width - oldGeometry.width), + value2: oldGeometry.height + this.snappyness * (newGeometry.height - oldGeometry.height) + }, + curve: QEasingCurve.OutExpo + }, { + type: Effect.Translation, + to: { + value1: 0, + value2: 0 + }, + from: { + value1: (1-this.snappyness) * (oldGeometry.x - newGeometry.x - (newGeometry.width / 2 - oldGeometry.width / 2)), + value2: (1-this.snappyness) * (oldGeometry.y - newGeometry.y - (newGeometry.height / 2 - oldGeometry.height / 2)) + }, + curve: QEasingCurve.OutExpo + }] + }); + } + + restoreForceBlurState(window) { + window.setData(Effect.WindowForceBlurRole, null); + } + + onWindowFrameGeometryChanged(window, oldGeometry) { + if (!window.maximizeAnimation1 || + // Check only dimension changes. + (window.geometry.width == oldGeometry.width && window.geometry.height == oldGeometry.height) || + // Check only if last dimension isn't equal to dimension from which effect was started (window.oldGeometry). + (window.oldGeometry.width == oldGeometry.width && window.oldGeometry.height == oldGeometry.height) + ) { + return; + } + + // Cancel animation if window got resized halfway through it. + cancel(window.maximizeAnimation1); + delete window.maximizeAnimation1; + + if (window.maximizeAnimation2) { + cancel(window.maximizeAnimation2); + delete window.maximizeAnimation2; + } + } +} + +new MaximizeKineticEffect(); diff --git a/kinetic_maximize/metadata.json b/kinetic_maximize/metadata.json new file mode 100644 index 0000000..94fbc58 --- /dev/null +++ b/kinetic_maximize/metadata.json @@ -0,0 +1,139 @@ +{ + "KPackageStructure": "KWin/Effect", + "KPlugin": { + "Authors": [ + { + "Email": "mgraesslin@kde.org", + "Name": "Martin Gräßlin", + "Name[ar]": "مارتن جراجلين", + "Name[be]": "Martin Gräßlin", + "Name[bg]": "Martin Gräßlin", + "Name[ca@valencia]": "Martin Gräßlin", + "Name[ca]": "Martin Gräßlin", + "Name[cs]": "Martin Gräßlin", + "Name[de]": "Martin Gräßlin", + "Name[en_GB]": "Martin Gräßlin", + "Name[eo]": "Martin Gräßlin", + "Name[es]": "Martin Gräßlin", + "Name[et]": "Martin Gräßlin", + "Name[eu]": "Martin Gräßlin", + "Name[fi]": "Martin Gräßlin", + "Name[fr]": "Martin Gräßlin", + "Name[gl]": "Martin Gräßlin.", + "Name[he]": "מרטין גרייסלין", + "Name[hu]": "Martin Gräßlin", + "Name[ia]": "Martin Gräßlin", + "Name[is]": "Martin Gräßlin", + "Name[it]": "Martin Gräßlin", + "Name[ja]": "Martin Gräßlin", + "Name[ka]": "მარტინ გრესსლინი", + "Name[ko]": "Martin Gräßlin", + "Name[lt]": "Martin Gräßlin", + "Name[nl]": "Martin Gräßlin", + "Name[nn]": "Martin Gräßlin", + "Name[pl]": "Martin Gräßlin", + "Name[pt]": "Martin Gräßlin", + "Name[ro]": "Martin Gräßlin", + "Name[ru]": "Martin Gräßlin", + "Name[sk]": "Martin Gräßlin", + "Name[sl]": "Martin Gräßlin", + "Name[ta]": "மார்ட்டின் கிராஸ்லின்", + "Name[tr]": "Martin Gräßlin", + "Name[uk]": "Martin Gräßlin", + "Name[vi]": "Martin Gräßlin", + "Name[x-test]": "xxMartin Gräßlinxx", + "Name[zh_CN]": "Martin Gräßlin", + "Name[zh_TW]": "Martin Gräßlin" + } + ], + "Category": "Appearance", + "Description": "Animation for a window going to maximize/restore from maximize", + "Description[ar]": "تحريك النوافذ عند تكبيرها/استعادة من التكبير", + "Description[be]": "Анімацыя акон пры разгортванні і згортванні з разгорнутага рэжыму", + "Description[bg]": "Анимация за прозорец при максимизиране/възстановяване", + "Description[ca@valencia]": "Animació per a una finestra que es maximitza/restaura des de maximització", + "Description[ca]": "Animació per a una finestra que es maximitza/restaura des de maximització", + "Description[cs]": "Animace okna pro maximalizaci/obnovení z maximalizace", + "Description[de]": "Animation für ein Fenster beim Maximieren und Wiederherstellen", + "Description[en_GB]": "Animation for a window going to maximise/restore from maximise", + "Description[eo]": "Animacio por fenestro maksimumigi/restarigi de maksimumigi", + "Description[es]": "Animación para la ventana que se maximiza o restaura desde el estado de maximizada", + "Description[et]": "Maksimeeritava või maksimeeritust taastatava akna animatsioon", + "Description[eu]": "Leihoa maximizatzera/maximizatutik leheneratzera doanerako animazioa", + "Description[fi]": "Animaation ikkunaa suurennettaessa tai palautettaessa suurennetusta tilasta", + "Description[fr]": "Animation pour une fenêtre passant de maximiser / restaurer à partir de maximiser", + "Description[gl]": "Animación das xanelas que se maximizan ou restauran maximizadas.", + "Description[he]": "הנפשה לחלון שמוגדל/משוחזר מהגדלה", + "Description[hu]": "A maximalizálásra készülő/maximalizálásból visszatérő ablakok animációja", + "Description[ia]": "Animation per un fenestra va maximisar/restabilir ab maximisar", + "Description[is]": "Hreyfiáhrif fyrir glugga sem eru fullstækkaðir/teknir úr fullstækkun", + "Description[it]": "Animazione per una finestra massimizzata o ripristinata dalla massimizzazione", + "Description[ja]": "最大化/復元時のウィンドウアニメーション", + "Description[ka]": "ფანჯრის ანიმაცია ჩაკეცვის/ამოკეცვის მცდელობისას", + "Description[ko]": "최대화된 창이 최소화되거나 복원될 때 사용할 애니메이션", + "Description[lt]": "Animacija, kuri naudojama išskleidžiant langą ar gražinant jį iš išskleidimo", + "Description[nl]": "Animatie voor een venster dat gaat naar maximaliseren/herstellen vanuit maximaliseren", + "Description[nn]": "Vindaugsanimasjon i samband med bruk av maksimering/gjenoppretting", + "Description[pl]": "Okna są gładko skalowane przy maksymalizacji i przy powrocie z niej", + "Description[pt]": "Animação para uma janela ao maximizar-se/repor-se da maximização", + "Description[ro]": "Animație pentru o fereastră ce trece la maximizare/restabilire din maximizare", + "Description[ru]": "Анимация для окна, которое будет максимизировано/восстановит размер после максимизации", + "Description[sk]": "Animácia pre okno, ktoré sa maximalizuje/obnoví z maximalizácie", + "Description[sl]": "Animacija za okno, ki bo povečano/obnovljeno iz povečanja", + "Description[ta]": "சாளரத்தை அதிகபட்ச பெரிதாக்கும்போதும் பழைய அளவை மீளமர்த்தும்போதும் பயன்படுத்த வேண்டிய அசைவூட்டம்", + "Description[tr]": "Ekranı kaplayan veya geri dönen bir pencere için canlandırma", + "Description[uk]": "Анімація для вікон під час максимізації/відновлення з максимізації", + "Description[vi]": "Hiệu ứng động cho một cửa sổ chuẩn bị phóng to hoặc khôi phục từ trạng thái phóng to", + "Description[x-test]": "xxAnimation for a window going to maximize/restore from maximizexx", + "Description[zh_CN]": "窗口最大化/恢复时呈现过渡动效", + "Description[zh_TW]": "視窗最大化/回復時的動畫", + "EnabledByDefault": true, + "Icon": "preferences-system-windows-effect-maximize", + "Id": "kinetic_maximize", + "License": "GPL", + "Name": "Maximize (Kinetic)", + "Name[ar]": "كبّر (Kinetic)", + "Name[be]": "Разгарнуць (Kinetic)", + "Name[bg]": "Максимизиране (Kinetic)", + "Name[ca@valencia]": "Maximitza (Kinetic)", + "Name[ca]": "Maximitza (Kinetic)", + "Name[cs]": "Maximalizovat (Kinetic)", + "Name[de]": "Maximieren (Kinetic)", + "Name[en_GB]": "Maximise (Kinetic)", + "Name[eo]": "Maksimumigi (Kinetic)", + "Name[es]": "Maximizar (Kinetic)", + "Name[et]": "Maksimeerimine (Kinetic)", + "Name[eu]": "Maximizatzea (Kinetic)", + "Name[fi]": "Suurenna (Kinetic)", + "Name[fr]": "Maximiser (Kinetic)", + "Name[gl]": "Maximizar (Kinetic)", + "Name[he]": "הגדלה (Kinetic)", + "Name[hu]": "Maximalizálás (Kinetic)", + "Name[ia]": "Maximiza (Kinetic)", + "Name[is]": "Fullstækka (Kinetic)", + "Name[it]": "Massimizza (Kinetic)", + "Name[ja]": "最大化 (Kinetic)", + "Name[ka]": "გადიდება (Kinetic)", + "Name[ko]": "최대화 (Kinetic)", + "Name[lt]": "Išskleidimas (Kinetic)", + "Name[nl]": "Maximaliseren (Kinetic)", + "Name[nn]": "Maksimer (Kinetic)", + "Name[pl]": "Maksymalizacja (Kinetic)", + "Name[pt]": "Maximizar (Kinetic)", + "Name[pt_BR]": "Maximizar (Kinetic)", + "Name[ro]": "Maximizează (Kinetic)", + "Name[ru]": "Распахивание окон (Kinetic)", + "Name[sk]": "Maximalizovať (Kinetic)", + "Name[sl]": "Razpni (Kinetic)", + "Name[ta]": "அதிகபட்ச பெரிதாக்குவது (Kinetic)", + "Name[tr]": "Ekranı Kapla (Kinetic)", + "Name[uk]": "Максимізація (Kinetic)", + "Name[vi]": "Phóng to (Kinetic)", + "Name[x-test]": "xxMaximizexx (Kinetic)", + "Name[zh_CN]": "最大化过渡动画 (Kinetic)", + "Name[zh_TW]": "最大化 (Kinetic)" + }, + "X-KDE-Ordering": 60, + "X-KWin-Video-Url": "https://files.kde.org/plasma/kwin/effect-videos/maximize.ogv", + "X-Plasma-API": "javascript" +} diff --git a/kwin4_effect_open_close_kinetic/contents/code/main.js b/kinetic_scale/contents/code/main.js similarity index 89% rename from kwin4_effect_open_close_kinetic/contents/code/main.js rename to kinetic_scale/contents/code/main.js index 1c839bc..bc36dfc 100644 --- a/kwin4_effect_open_close_kinetic/contents/code/main.js +++ b/kinetic_scale/contents/code/main.js @@ -15,15 +15,30 @@ const blacklist = [ "ksmserver-logout-greeter ksmserver-logout-greeter", // KDE Plasma splash screen has to be animated only by the login effect. - "ksplashqml ksplashqml" + "ksplashqml ksplashqml", + + // Spectacle needs to be blacklisted in order to stay out of its own screenshots. + "spectacle spectacle", // x11 + "spectacle org.kde.spectacle", // wayland ]; class ScaleEffect { constructor() { + effect.configChanged.connect(this.loadConfig.bind(this)); effect.animationEnded.connect(this.cleanupForcedRoles.bind(this)); effects.windowAdded.connect(this.slotWindowAdded.bind(this)); effects.windowClosed.connect(this.slotWindowClosed.bind(this)); effects.windowDataChanged.connect(this.slotWindowDataChanged.bind(this)); + + this.loadConfig(); + } + + loadConfig() { + // const defaultDuration = 200; + // const duration = effect.readConfig("Duration", defaultDuration) || defaultDuration; + // this.duration = animationTime(duration); + // this.inScale = effect.readConfig("InScale", 0.8); + // this.outScale = effect.readConfig("OutScale", 0.8); } static isScaleWindow(window) { diff --git a/kinetic_scale/metadata.json b/kinetic_scale/metadata.json new file mode 100644 index 0000000..bf1c57c --- /dev/null +++ b/kinetic_scale/metadata.json @@ -0,0 +1,104 @@ +{ + "KPackageStructure": "KWin/Effect", + "KPlugin": { + "Authors": [ + { + "Email": "vlad.zahorodnii@kde.org", + "Name": "Vlad Zahorodnii" + } + ], + "Category": "Window Open/Close Animation", + "Description": "Make windows smoothly scale in and out when they are shown or hidden", + "Description[ar]": "اجعل النوافذ تكبر وتصغر بنعومة عند إظهاراها وإخفائها", + "Description[be]": "Плаўнае павелічэнне або памяншэнне акон пры з'яўленні або знікненні", + "Description[bg]": "Плавно увеличаване и намаляване на мащаба на прозорците при показване или скриване", + "Description[ca@valencia]": "Fa que les finestres entren o isquen volant quan es mostren o s'oculten", + "Description[ca]": "Fa que les finestres entrin o surtin volant quan es mostren o s'oculten", + "Description[cs]": "Nechá okna plynule zvětšit/zmenšit se, pokud jsou zobrazeny resp. skryty", + "Description[de]": "Vergrößert und verkleinert Fenster sanft beim Ein- oder Ausblenden", + "Description[en_GB]": "Make windows smoothly scale in and out when they are shown or hidden", + "Description[eo]": "Fari fenestrojn glate grimpi en kaj eksteren kiam ili estas montritaj aŭ kaŝitaj", + "Description[es]": "Hacer que las ventanas se escalen suavemente al mostrarlas y al ocultarlas", + "Description[et]": "Skaleerib aknaid sujuvalt, kui need peidetakse või nähtavale tuuakse", + "Description[eu]": "Leihoak emeki barrura eta kanpora eskalatu haiek erakutsi edo ezkutatzean", + "Description[fi]": "Skaalaa ponnahdusikkunat pehmeästi näytölle tai näytöltä", + "Description[fr]": "Faire un re-dimensionnement en avant ou en arrière des fenêtres lorsqu'elles sont affichées ou masquées", + "Description[gl]": "Facer que as xanelas crezan ou decrezan suavemente cando se mostran ou agochan.", + "Description[he]": "הפיכת הגדלת והקטנת קנה מידה של חלונות כשהם מוצגים או מוסתרים", + "Description[hu]": "Az ablakok folyamatosan méretezett módon lesznek elrejtve és megjelenítve", + "Description[ia]": "Face que fenestras pote dulcemente scalar intra e foras quando illos es monstrate o celate", + "Description[is]": "Láta glugga stækka og minnka inn og út mjúklega þegar þeir eru birtir eða faldir", + "Description[it]": "Ridimensiona le finestre dolcemente quando sono mostrate o nascoste", + "Description[ja]": "ウィンドウが表示/非表示時スムーズに拡大/縮小します", + "Description[ka]": "ფანჯრების რბილად გადიდება/დაპატარავება მათი ჩვენება/დამალვისას", + "Description[ko]": "창이 보여지거나 감춰질 때 부드러운 크기 조정을 사용합니다", + "Description[lt]": "Padaryti, kad langai glotniai keistų dydį, kai yra rodomi ar slepiami", + "Description[nl]": "Laat vensters vloeiend kleiner en groter schalen als ze worden getoond of verborgen", + "Description[nn]": "Skaler vindauge jamt inn og ut når dei vert viste eller gøymde", + "Description[pl]": "Okna gładko pomniejszają się przy otwieraniu i powiększają przy zamykaniu", + "Description[pt]": "Faz com que as janelas mudem suavemente de tamanho quando aparecem ou desaparecem", + "Description[ro]": "Face ferestrele să se scaleze lin când sunt arătate sau ascunse", + "Description[ru]": "Плавное увеличение или уменьшение окон при их появлении и скрытии", + "Description[sk]": "Plynulé zväčšovanie a zmenšovanie okien pri ich zobrazení alebo skrytí", + "Description[sl]": "Okna naj gladko spreminjajo velikost (navzven in navznoter), ko se prikažejo ali skrijejo", + "Description[ta]": "சாளரங்களை காட்டும்போதும் மறைக்கும்போதும் அவற்றின் அளவை படிப்படியாக மாற்றுவதுபோல் அசைவூட்டும்", + "Description[tr]": "Pencereler gösterilirken veya gizlenirken pürüzsüzce ölçeklendirilmelerini sağlar", + "Description[uk]": "Плавне масштабування вікон при появі або приховуванні", + "Description[vi]": "Làm cửa sổ đổi cỡ một cách êm dịu khi chúng hiện ra và biến mất", + "Description[x-test]": "xxMake windows smoothly scale in and out when they are shown or hiddenxx", + "Description[zh_CN]": "窗口显示/隐藏时呈现平滑缩放过渡动效", + "Description[zh_TW]": "讓視窗在顯示或隱藏的時候平滑地以比例縮放方式出現或消失", + "EnabledByDefault": false, + "Icon": "preferences-system-windows-effect-scale", + "Id": "kinetic_scale", + "License": "GPL", + "Name": "Scale (Kinetic)", + "Name[ar]": "حجّم (Kinetic)", + "Name[be]": "Маштабаванне (Kinetic)", + "Name[bg]": "Мащабиране (Kinetic)", + "Name[ca@valencia]": "Escala (Kinetic)", + "Name[ca]": "Escala (Kinetic)", + "Name[cs]": "Měřítko (Kinetic)", + "Name[de]": "Skalieren (Kinetic)", + "Name[en_GB]": "Scale (Kinetic)", + "Name[eo]": "Skalo (Kinetic)", + "Name[es]": "Escalar (Kinetic)", + "Name[et]": "Skaleerimine (Kinetic)", + "Name[eu]": "Eskalatu (Kinetic)", + "Name[fi]": "Skaalaus (Kinetic)", + "Name[fr]": "Échelle (Kinetic)", + "Name[gl]": "Escala (Kinetic)", + "Name[he]": "קנה מידה (Kinetic)", + "Name[hu]": "Méretezés (Kinetic)", + "Name[ia]": "Scala (Kinetic)", + "Name[is]": "Kvarði (Kinetic)", + "Name[it]": "Scala (Kinetic)", + "Name[ja]": "スケール (Kinetic)", + "Name[ka]": "მასშტაბირება (Kinetic)", + "Name[ko]": "크기 조정 (Kinetic)", + "Name[lt]": "Mastelis (Kinetic)", + "Name[nl]": "Schaal (Kinetic)", + "Name[nn]": "Skalering (Kinetic)", + "Name[pl]": "Skalowanie (Kinetic)", + "Name[pt]": "Escala (Kinetic)", + "Name[pt_BR]": "Escala (Kinetic)", + "Name[ro]": "Scalare (Kinetic)", + "Name[ru]": "Масштабирование (Kinetic)", + "Name[sk]": "Meniť mierku (Kinetic)", + "Name[sl]": "Spremeni velikost (Kinetic)", + "Name[ta]": "அளவுமாற்று (Kinetic)", + "Name[tr]": "Ölçeklendir (Kinetic)", + "Name[uk]": "Масштабування (Kinetic)", + "Name[vi]": "Đổi cỡ (Kinetic)", + "Name[x-test]": "xxScalexx (Kinetic)", + "Name[zh_CN]": "按比例缩放 (Kinetic)", + "Name[zh_TW]": " (Kinetic)縮放" + }, + "X-KDE-ConfigModule": "kcm_kwin4_genericscripted", + "X-KDE-Ordering": 60, + "X-KWin-Config-TranslationDomain": "kinetic", + "X-KWin-Exclusive-Category": "toplevel-open-close-animation", + "X-Plasma-API": "javascript" + + +} diff --git a/kinetic_squash/contents/code/main.js b/kinetic_squash/contents/code/main.js new file mode 100644 index 0000000..912042f --- /dev/null +++ b/kinetic_squash/contents/code/main.js @@ -0,0 +1,160 @@ +/* + This file is part of the KDE project. + + SPDX-FileCopyrightText: 2018 Vlad Zahorodnii + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +"use strict"; + +function interpolateRect(src, tgt, t) { + + + var itp = { + x: (1 - t) * src.x + t * tgt.x, + y: (1 - t) * src.y + t * tgt.y, + width: (1 - t) * src.width + t * tgt.width, + height: (1 - t) * src.height + t * tgt.height, + }; + return itp; +} + +var squashEffect = { + slotWindowMinimized: function (window) { + if (effects.hasActiveFullScreenEffect) { + return; + } + + // If the window doesn't have an icon in the task manager, + // don't animate it. + var iconRect = window.iconGeometry; + if (iconRect.width == 0 || iconRect.height == 0) { + return; + } + + if (window.unminimizeAnimation) { + cancel(window.unminimizeAnimation); + delete window.unminimizeAnimation; + } + + if (window.minimizeAnimation) { + cancel(window.minimizeAnimation); + } + var sourceRect = window.geometry; + var targetRect = interpolateRect(sourceRect, window.iconGeometry, 0.15); + var sclx = targetRect.width / window.geometry.width; + var scly = targetRect.height / window.geometry.height; + var scl = (sclx < scly) ? sclx : scly; + + window.minimizeAnimation = animate({ + window: window, + duration: animationTime(100), + animations: [ + { + type: Effect.Scale, + from: 1, + to: scl, + curve: QEasingCurve.Linear + }, + { + type: Effect.Opacity, + from: 10/10, + to: 0.2, + curve: QEasingCurve.Linear + }, + { + type: Effect.Translation, + from: { + value1: 0, + value2: 0 + }, + to: { + value1: -(sourceRect.x + sourceRect.width / 2 - targetRect.x - targetRect.width / 2), + value2: -(sourceRect.y + sourceRect.height / 2 - targetRect.y - targetRect.height / 2) + }, + curve: QEasingCurve.Linear + }, + ] + }); + }, + slotWindowUnminimized: function (window) { + if (effects.hasActiveFullScreenEffect) { + return; + } + + // If the window doesn't have an icon in the task manager, + // don't animate it. + var iconRect = window.iconGeometry; + if (iconRect.width == 0 || iconRect.height == 0) { + return; + } + + if (window.minimizeAnimation) { + cancel(window.minimizeAnimation); + delete window.minimizeAnimation; + } + + if (window.unminimizeAnimation) { + cancel(window.unminimizeAnimation); + } + + var windowRect = window.geometry; + var iconRect = window.iconGeometry; + + var sourceRect = window.geometry; + var snappyness = 0.4; + var targetRect = interpolateRect(sourceRect, window.iconGeometry, snappyness); + var sclx = targetRect.width / window.geometry.width; + var scly = targetRect.height / window.geometry.height; + var scl = (sclx < scly) ? sclx : scly; + + window.unminimizeAnimation = animate({ + window: window, + duration: animationTime(317), + animations: [ + { + type: Effect.Scale, + from: scl, + to: 1, + curve: QEasingCurve.OutExpo + }, + { + type: Effect.Translation, + from: { + value1: -(sourceRect.x + sourceRect.width / 2 - targetRect.x - targetRect.width / 2), + value2: -(sourceRect.y + sourceRect.height / 2 - targetRect.y - targetRect.height / 2) + }, + to: { + value1: 0, + value2: 0 + }, + curve: QEasingCurve.OutExpo + }, + { + type: Effect.Opacity, + from: 0.0, + to: 1.0, + curve: QEasingCurve.OutExpo + } + ] + }); + }, + slotWindowAdded: function (window) { + window.minimizedChanged.connect(() => { + if (window.minimized) { + squashEffect.slotWindowMinimized(window); + } else { + squashEffect.slotWindowUnminimized(window); + } + }); + }, + init: function () { + effects.windowAdded.connect(squashEffect.slotWindowAdded); + for (const window of effects.stackingOrder) { + squashEffect.slotWindowAdded(window); + } + } +}; + +squashEffect.init(); diff --git a/kinetic_squash/metadata.json b/kinetic_squash/metadata.json new file mode 100644 index 0000000..f68a3c3 --- /dev/null +++ b/kinetic_squash/metadata.json @@ -0,0 +1,138 @@ +{ + "KPackageStructure": "KWin/Effect", + "KPlugin": { + "Authors": [ + { + "Email": "rivolaks@hot.ee, vlad.zahorodnii@kde.org", + "Name": "Rivo Laks, Vlad Zahorodnii", + "Name[ar]": "ريفو لاكس، فلاد زاهورودني", + "Name[be]": "Rivo Laks, Vlad Zahorodnii", + "Name[bg]": "Rivo Laks, Vlad Zahorodnii", + "Name[ca@valencia]": "Rivo Laks, Vlad Zahorodnii", + "Name[ca]": "Rivo Laks, Vlad Zahorodnii", + "Name[cs]": "Rivo Laks, Vlad Zahorodnii", + "Name[de]": "Rivo Laks, Vlad Zahorodnii", + "Name[en_GB]": "Rivo Laks, Vlad Zahorodnii", + "Name[eo]": "Rivo Laks, Vlad Zahorodnii", + "Name[es]": "Rivo Laks, Vlad Zahorodnii", + "Name[et]": "Rivo Laks, Vlad Zahorodnii", + "Name[eu]": "Rivo Laks, Vlad Zahorodnii", + "Name[fi]": "Rivo Laks, Vlad Zahorodnii", + "Name[fr]": "Rivo Laks, Vlad Zahorodnii", + "Name[gl]": "Rivo Laks e Vlad Zahorodnii.", + "Name[he]": "ריבו לאקס, ולאד זוהורוני", + "Name[hu]": "Rivo Laks, Vlad Zahorodnii", + "Name[ia]": "Rivo Laks, Vlad Zahorodnii", + "Name[is]": "Rivo Laks, Vlad Zahorodnii", + "Name[it]": "Rivo Laks, Vlad Zahorodnii", + "Name[ja]": "Rivo Laks, Vlad Zahorodnii", + "Name[ka]": "Vlad Zahorodnii", + "Name[ko]": "Rivo Laks, Vlad Zahorodnii", + "Name[lt]": "Rivo Laks, Vlad Zahorodnii", + "Name[nl]": "Rivo Laks, Vlad Zahorodnii", + "Name[nn]": "Rivo Laks, Vlad Zahorodnii", + "Name[pl]": "Rivo Laks, Vlad Zahorodnii", + "Name[pt]": "Rivo Laks, Vlad Zahorodnii", + "Name[ro]": "Rivo Laks, Vlad Zahorodnii", + "Name[ru]": "Rivo Laks, Влад Загородний", + "Name[sk]": "Rivo Laks, Vlad Zahorodnii", + "Name[sl]": "Rivo Laks, Vlad Zahorodnii", + "Name[ta]": "ரிவோ லாக்சு, விலாட் ஜாஹொரிடுனி", + "Name[tr]": "Rivo Laks, Vlad Zahorodnii", + "Name[uk]": "Rivo Laks, Влад Завгородній", + "Name[vi]": "Rivo Laks, Vlad Zahorodnii", + "Name[x-test]": "xxRivo Laks, Vlad Zahorodniixx", + "Name[zh_CN]": "Rivo Laks, Vlad Zahorodnii", + "Name[zh_TW]": "Rivo Laks, Vlad Zahorodnii" + } + ], + "Category": "Appearance", + "Description": "Squash windows when they are minimized", + "Description[ar]": "تنكمش النوافذ عند تصغيرها", + "Description[be]": "Сціскаць вокны, калі яны згорнутыя", + "Description[bg]": "Свиване на прозорците при минимизиране", + "Description[ca@valencia]": "Amuntega les finestres quan estan minimitzades", + "Description[ca]": "Amuntega les finestres quan estan minimitzades", + "Description[de]": "Quetscht Fenster beim Minimieren zusammen", + "Description[en_GB]": "Squash windows when they are minimised", + "Description[eo]": "Squash fenestroj kiam ili estas minimumigitaj", + "Description[es]": "Aplastar las ventanas cuando se minimizan", + "Description[et]": "Minimeeritud akende taas üleshüpitamine", + "Description[eu]": "Zanpatu leihoak haiek ikonotzen direnean", + "Description[fi]": "Litistä pienennettävät ikkunat", + "Description[fr]": "Déformer les fenêtres lors de leur minimisation", + "Description[gl]": "Xuntar as xanelas cando estean minimizadas.", + "Description[he]": "למעוך את החלונות כשהם ממוזערים", + "Description[hu]": "Összevonja az ablakokat, amikor minimalizálódnak", + "Description[ia]": "Deforma fenestras durante que illes es minimisate", + "Description[is]": "Kremja saman glugga þegar þeir eru faldir", + "Description[it]": "Schiaccia le finestre quando vengono minimizzate", + "Description[ja]": "最小化されたときウィンドウが縮小します", + "Description[ka]": "ფანჯრების შეჭყლეტა ჩაკეცვისა დროს", + "Description[ko]": "창을 최소화할 때 압축시킵니다", + "Description[lt]": "Sutraiškyti langus, kai jie suskleidžiami", + "Description[nl]": "Krimp vensters wanneer ze geminimaliseerd zijn", + "Description[nn]": "Skvis vindauge når dei vert minimerte", + "Description[pl]": "Ściąga okna przy ich minimalizacji", + "Description[pt]": "Deformar as janelas quando são minimizadas", + "Description[ro]": "Strivește ferestrele când sunt minimizate", + "Description[ru]": "Сжатие окна при сворачивании", + "Description[sk]": "Stlačenie okien, keď sú minimalizované", + "Description[sl]": "Skrči okna, ko so pomanjšana", + "Description[ta]": "சாளரங்களை ஒதுக்கும்போது அவற்றை நசுக்குவது போல் அசைவூட்டும்", + "Description[tr]": "Pencereler simge durumuna küçültüldüğünde onları tıkıştır", + "Description[uk]": "Складує вікна, якщо їх мінімізовано", + "Description[vi]": "Ép nhỏ cửa sổ khi thu nhỏ", + "Description[x-test]": "xxSquash windows when they are minimizedxx", + "Description[zh_CN]": "窗口最小化时绘制收缩过渡动画", + "Description[zh_TW]": "最小化視窗時擠壓它們", + "EnabledByDefault": false, + "Icon": "preferences-system-windows-effect-squash", + "Id": "kinetic_squash", + "License": "GPL", + "Name": "Squash (Kinetic)", + "Name[ar]": "الانكماش (Kinetic)", + "Name[be]": "Сцісканне (Kinetic)", + "Name[bg]": "Свиване (Kinetic)", + "Name[ca@valencia]": "Amuntega (Kinetic)", + "Name[ca]": "Amuntega (Kinetic)", + "Name[de]": "Quetschen (Kinetic)", + "Name[en_GB]": "Squash (Kinetic)", + "Name[eo]": "Dispremi (Kinetic)", + "Name[es]": "Aplastar (Kinetic)", + "Name[et]": "Üleshüpe (Kinetic)", + "Name[eu]": "Zanpatu (Kinetic)", + "Name[fi]": "Litistys (Kinetic)", + "Name[fr]": "Compresser (Kinetic)", + "Name[gl]": "Xuntar (Kinetic)", + "Name[he]": "מעיכה (Kinetic)", + "Name[hu]": "Összevonás (Kinetic)", + "Name[ia]": "Squash (Kinetic)", + "Name[is]": "Kremja (Kinetic)", + "Name[it]": "Schiaccia (Kinetic)", + "Name[ja]": "縮小 (Kinetic)", + "Name[ka]": "დაჭმუჭნვა (Kinetic)", + "Name[ko]": "압축 (Kinetic)", + "Name[lt]": "Sutraiškymas (Kinetic)", + "Name[nl]": "Krimpen (Kinetic)", + "Name[nn]": "Skvis (Kinetic)", + "Name[pl]": "Ściąganie (Kinetic)", + "Name[pt]": "Esmagar (Kinetic)", + "Name[pt_BR]": "Achatar (Kinetic)", + "Name[ro]": "Strivire (Kinetic)", + "Name[ru]": "Сжатие (Kinetic)", + "Name[sk]": "Stlačiť (Kinetic)", + "Name[sl]": "Strni (Kinetic)", + "Name[ta]": "நசுக்கு (Kinetic)", + "Name[tr]": "Tıkıştır (Kinetic)", + "Name[uk]": "Складування (Kinetic)", + "Name[vi]": "Ép nhỏ (Kinetic)", + "Name[x-test]": "xxSquashxx (Kinetic)", + "Name[zh_CN]": "最小化过渡动画 (收缩) (Kinetic)", + "Name[zh_TW]": "壓縮 (Kinetic)" + }, + "X-KDE-Ordering": 60, + "X-KWin-Exclusive-Category": "minimize", + "X-KWin-Video-Url": "https://files.kde.org/plasma/kwin/effect-videos/minimize.ogv", + "X-Plasma-API": "javascript" +} diff --git a/kwin4_effect_fadingpopups_kinetic/metadata.desktop b/kwin4_effect_fadingpopups_kinetic/metadata.desktop deleted file mode 100644 index cb87e5c..0000000 --- a/kwin4_effect_fadingpopups_kinetic/metadata.desktop +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Name=Fading Popups Kinetic -Icon=preferences-system-windows-effect-fadingpopups -Comment=Make popups smoothly fade in and out when they are shown or hidden - -Type=Service -X-KDE-ServiceTypes=KWin/Effect -X-KDE-PluginInfo-Name=kwin4_effect_fadingpopups_kinetic -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Category=Appearance -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=false -X-KDE-Ordering=60 -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js diff --git a/kwin4_effect_fadingpopups_kinetic/metadata.json b/kwin4_effect_fadingpopups_kinetic/metadata.json deleted file mode 100644 index 76fb8a6..0000000 --- a/kwin4_effect_fadingpopups_kinetic/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "KPlugin": { - "Category": "Appearance", - "Description": "Make popups smoothly fade in and out when they are shown or hidden", - "EnabledByDefault": false, - "Icon": "preferences-system-windows-effect-fadingpopups", - "Id": "kwin4_effect_fadingpopups_kinetic", - "License": "GPL", - "Name": "Fading Popups Kinetic", - "ServiceTypes": [ - "KWin/Effect" - ], - "Version": "1.0" - }, - "X-KDE-Ordering": "60", - "X-Plasma-API": "javascript", - "X-Plasma-MainScript": "code/main.js" -} diff --git a/kwin4_effect_maximize_kinetic/contents/code/maximize.js b/kwin4_effect_maximize_kinetic/contents/code/maximize.js deleted file mode 100644 index 57e6de3..0000000 --- a/kwin4_effect_maximize_kinetic/contents/code/maximize.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of the KDE project. - - SPDX-FileCopyrightText: 2012 Martin Gräßlin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -"use strict"; - -class MaximizeEffect { - constructor() { - effect.configChanged.connect(this.loadConfig.bind(this)); - effects.windowFrameGeometryChanged.connect( - this.onWindowFrameGeometryChanged.bind(this)); - effects.windowMaximizedStateChanged.connect( - this.onWindowMaximizedStateChanged.bind(this)); - effect.animationEnded.connect(this.restoreForceBlurState.bind(this)); - - this.loadConfig(); - } - - loadConfig() { - this.duration = animationTime(317); - } - - onWindowMaximizedStateChanged(window) { - if (!window.oldGeometry) { - return; - } - window.setData(Effect.WindowForceBlurRole, true); - let oldGeometry = window.oldGeometry; - const newGeometry = window.geometry; - if (oldGeometry.width == newGeometry.width && oldGeometry.height == newGeometry.height) - oldGeometry = window.olderGeometry; - window.olderGeometry = Object.assign({}, window.oldGeometry); - window.oldGeometry = Object.assign({}, newGeometry); - window.maximizeAnimation1 = animate({ - window: window, - duration: this.duration, - animations: [{ - type: Effect.Size, - to: { - value1: newGeometry.width, - value2: newGeometry.height - }, - from: { - value1: oldGeometry.width + 0.3 * (newGeometry.width - oldGeometry.width), - value2: oldGeometry.height + 0.3 * (newGeometry.height - oldGeometry.height) - }, - curve: QEasingCurve.OutExpo - }, { - type: Effect.Translation, - to: { - value1: 0, - value2: 0 - }, - from: { - value1: 0.7*(oldGeometry.x - newGeometry.x - (newGeometry.width / 2 - oldGeometry.width / 2)), - value2: 0.7*(oldGeometry.y - newGeometry.y - (newGeometry.height / 2 - oldGeometry.height / 2)) - }, - curve: QEasingCurve.OutExpo - }] - }); - if (!window.resize) { - window.maximizeAnimation2 =animate({ - window: window, - duration: this.duration, - animations: [{ - type: Effect.CrossFadePrevious, - to: 1.0, - from: 0.0, - curve: QEasingCurve.OutExpo - }] - }); - } - } - - restoreForceBlurState(window) { - window.setData(Effect.WindowForceBlurRole, null); - } - - onWindowFrameGeometryChanged(window, oldGeometry) { - if (window.maximizeAnimation1) { - if (window.geometry.width != window.oldGeometry.width || - window.geometry.height != window.oldGeometry.height) { - cancel(window.maximizeAnimation1); - delete window.maximizeAnimation1; - if (window.maximizeAnimation2) { - cancel(window.maximizeAnimation2); - delete window.maximizeAnimation2; - } - } - } - window.oldGeometry = Object.assign({}, window.geometry); - window.olderGeometry = Object.assign({}, oldGeometry); - } -} - -new MaximizeEffect(); diff --git a/kwin4_effect_maximize_kinetic/metadata.desktop b/kwin4_effect_maximize_kinetic/metadata.desktop deleted file mode 100644 index 962bdc2..0000000 --- a/kwin4_effect_maximize_kinetic/metadata.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Comment=Animation for a window going to maximize/restore from maximize -Icon=preferences-system-windows-effect-maximize -Name=Maximize Kinetic -Type=Service -X-KDE-ParentApp= -X-KDE-PluginInfo-Category=Appearance -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=kwin4_effect_maximize_kinetic -X-KDE-PluginInfo-Version=1 -X-KDE-PluginInfo-Website= -X-KDE-ServiceTypes=KWin/Effect -X-KDE-PluginInfo-EnabledByDefault=false -X-KDE-Ordering=60 -X-Plasma-API=javascript -X-Plasma-MainScript=code/maximize.js -X-KWin-Video-Url=https://files.kde.org/plasma/kwin/effect-videos/maximize.ogv diff --git a/kwin4_effect_maximize_kinetic/metadata.json b/kwin4_effect_maximize_kinetic/metadata.json deleted file mode 100644 index 5d9e986..0000000 --- a/kwin4_effect_maximize_kinetic/metadata.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "KPlugin": { - "Category": "Appearance", - "Description": "Animation for a window going to maximize/restore from maximize", - "EnabledByDefault": false, - "Icon": "preferences-system-windows-effect-maximize", - "Id": "kwin4_effect_maximize_kinetic", - "License": "GPL", - "Name": "Maximize Kinetic", - "ServiceTypes": [ - "KWin/Effect" - ], - "Version": "1", - "Website": "" - }, - "X-KDE-Ordering": "60", - "X-KDE-ParentApp": "", - "X-KWin-Video-Url": "https://files.kde.org/plasma/kwin/effect-videos/maximize.ogv", - "X-Plasma-API": "javascript", - "X-Plasma-MainScript": "code/maximize.js" -} diff --git a/kwin4_effect_minimize_kinetic/contents/code/main.js b/kwin4_effect_minimize_kinetic/contents/code/main.js deleted file mode 100644 index eef41fd..0000000 --- a/kwin4_effect_minimize_kinetic/contents/code/main.js +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2018 Vlad Zagorodniy - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -function interpolate(from, to, t) { - return from * (1 - t) + to * t; -} - -function morphRect(fromRect, toRect, t) { - var targetScale = (toRect.width > toRect.height) - ? toRect.width / fromRect.width - : toRect.height / fromRect.height; - var toCenter = { - x: toRect.x + toRect.width / 2, - y: toRect.y + toRect.height / 2 - }; - - var targetRect = { - x: toCenter.x - targetScale * fromRect.width / 2, - y: toCenter.y - targetScale * fromRect.height / 2, - width: targetScale * fromRect.width, - height: targetScale * fromRect.height - }; - - var morphedRect = { - x: interpolate(fromRect.x, targetRect.x, t), - y: interpolate(fromRect.y, targetRect.y, t), - width: interpolate(fromRect.width, targetRect.width, t), - height: interpolate(fromRect.height, targetRect.height, t) - }; - - return morphedRect; -} - -var minimizeScaleEffect = { - duration: animationTime(317), - minimizeScale: 0.05, - unminimizeScale: 0.05, - slotWindowMinimized: function (window) { - "use strict"; - var iconRect = window.iconGeometry; - if (iconRect.width == 0 || iconRect.height == 0) { - return; - } - - var windowRect = window.geometry; - if (windowRect.width == 0 || windowRect.height == 0) { - return; - } - - if (window.unminimizeAnimation) { - cancel(window.unminimizeAnimation); - delete window.unminimizeAnimation; - } - - var targetRect = morphRect(windowRect, iconRect, 1.0 - minimizeScaleEffect.minimizeScale); - - window.minimizeAnimation = animate({ - window: window, - duration: minimizeScaleEffect.duration, - animations: [ - { - type: Effect.Size, - from: { - value1: windowRect.width + 0.3 * (targetRect.width - windowRect.width), - value2: windowRect.height + 0.3 * (targetRect.height - windowRect.height) - }, - to: { - value1: targetRect.width, - value2: targetRect.height - }, - curve: QEasingCurve.OutExpo - }, - { - type: Effect.Translation, - from: { - value1: 0.3 * (targetRect.x - windowRect.x - (windowRect.width - targetRect.width) / 2), - value2: 0.3 * (targetRect.y - windowRect.y - (windowRect.height - targetRect.height) / 2) - }, - to: { - value1: targetRect.x - windowRect.x - (windowRect.width - targetRect.width) / 2, - value2: targetRect.y - windowRect.y - (windowRect.height - targetRect.height) / 2 - }, - curve: QEasingCurve.OutExpo - }, - { - type: Effect.Opacity, - from: 0.9, - to: 0.0, - curve: QEasingCurve.OutQuad, - } - ] - }); - }, - slotWindowUnminimized: function (window) { - "use strict"; - var iconRect = window.iconGeometry; - if (iconRect.width == 0 || iconRect.height == 0) { - return; - } - - var windowRect = window.geometry; - if (windowRect.width == 0 || windowRect.height == 0) { - return; - } - - if (window.minimizeAnimation) { - cancel(window.minimizeAnimation); - delete window.minimizeAnimation; - } - - var targetRect = morphRect(windowRect, iconRect, 1.0 - minimizeScaleEffect.unminimizeScale); - - window.unminimizeAnimation = animate({ - window: window, - curve: QEasingCurve.OutExpo, - duration: minimizeScaleEffect.duration, - animations: [ - { - type: Effect.Size, - from: { - value1: targetRect.width + 0.3 * (windowRect.width - targetRect.width), - value2: targetRect.height + 0.3 * (windowRect.height - targetRect.height) - }, - to: { - value1: windowRect.width, - value2: windowRect.height - } - }, - { - type: Effect.Translation, - from: { - value1: 0.7 * (targetRect.x - windowRect.x - (windowRect.width - targetRect.width) / 2), - value2: 0.7 * (targetRect.y - windowRect.y - (windowRect.height - targetRect.height) / 2) - }, - to: { - value1: 0.0, - value2: 0.0 - } - }, - { - type: Effect.Opacity, - from: 0.1, - to: 1.0, - curve: QEasingCurve.Linear, - duration: 150 - } - ] - }); - }, - init: function () { - "use strict"; - effects.windowMinimized.connect(minimizeScaleEffect.slotWindowMinimized); - effects.windowUnminimized.connect(minimizeScaleEffect.slotWindowUnminimized); - } -}; - -minimizeScaleEffect.init(); diff --git a/kwin4_effect_minimize_kinetic/metadata.desktop b/kwin4_effect_minimize_kinetic/metadata.desktop deleted file mode 100644 index e0aaa2e..0000000 --- a/kwin4_effect_minimize_kinetic/metadata.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Comment=Squash windows when they are minimized - -Icon=preferences-system-windows-effect-squash -Name=Minimize Kinetic - -Type=Service -X-KDE-ParentApp= -X-KDE-PluginInfo-Category=Appearance -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=kwin4_effect_minimize_kinetic -X-KDE-PluginInfo-Version=1 -X-KDE-PluginInfo-Website= -X-KDE-ServiceTypes=KWin/Effect -X-KDE-PluginInfo-EnabledByDefault=false -X-KDE-Ordering=60 -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js -X-KWin-Exclusive-Category=minimize diff --git a/kwin4_effect_minimize_kinetic/metadata.json b/kwin4_effect_minimize_kinetic/metadata.json deleted file mode 100644 index bff572f..0000000 --- a/kwin4_effect_minimize_kinetic/metadata.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "KPlugin": { - "Category": "Appearance", - "Description": "Squash windows when they are minimized", - "EnabledByDefault": false, - "Icon": "preferences-system-windows-effect-squash", - "Id": "kwin4_effect_minimize_kinetic", - "License": "GPL", - "Name": "Minimize Kinetic", - "ServiceTypes": [ - "KWin/Effect" - ], - "Version": "1", - "Website": "" - }, - "X-KDE-Ordering": "60", - "X-KDE-ParentApp": "", - "X-KWin-Exclusive-Category": "minimize", - "X-KWin-Video-Url": "https://files.kde.org/plasma/kwin/effect-videos/minimize.ogv", - "X-Plasma-API": "javascript", - "X-Plasma-MainScript": "code/main.js" -} diff --git a/kwin4_effect_open_close_kinetic/metadata.desktop b/kwin4_effect_open_close_kinetic/metadata.desktop deleted file mode 100644 index c2aa555..0000000 --- a/kwin4_effect_open_close_kinetic/metadata.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Name=Open/Close Kinetic -Icon=preferences-system-windows-effect-scale -Comment=Make windows smoothly scale in and out when they are shown or hidden - -Type=Service -X-KDE-ServiceTypes=KWin/Effect,KCModule -X-KDE-PluginInfo-Name=kwin4_effect_open_close_kinetic -X-KDE-PluginInfo-Version=1 -X-KDE-PluginInfo-Category=Window Open/Close Animation -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=false -X-KDE-Ordering=60 -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js -X-KDE-PluginKeyword=kwin4_effect_open_close_kinetic -X-KDE-Library=kcm_kwin4_genericscripted -X-KWin-Config-TranslationDomain=kwin_effects -X-KWin-Exclusive-Category=toplevel-open-close-animation diff --git a/kwin4_effect_open_close_kinetic/metadata.json b/kwin4_effect_open_close_kinetic/metadata.json deleted file mode 100644 index d06d90f..0000000 --- a/kwin4_effect_open_close_kinetic/metadata.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "KPlugin": { - "Category": "Window Open/Close Animation", - "Description": "Make windows smoothly scale in and out when they are shown or hidden", - "EnabledByDefault": false, - "Icon": "preferences-system-windows-effect-scale", - "Id": "kwin4_effect_open_close_kinetic", - "License": "GPL", - "Name": "Open/Close Kinetic", - "ServiceTypes": [ - "KWin/Effect" - ], - "Version": "1" - }, - "X-KDE-Ordering": "60", - "X-KDE-PluginKeyword": "kwin4_effect_open_close_kinetic", - "X-KWin-Config-TranslationDomain": "kwin_effects", - "X-KWin-Exclusive-Category": "toplevel-open-close-animation", - "X-Plasma-API": "javascript", - "X-Plasma-MainScript": "code/main.js" -}