Very early KDE 6 release.

This commit is contained in:
wackyideas 2024-08-09 03:20:25 +02:00
parent 7cc4ccabbc
commit 686046d4f7
6272 changed files with 140920 additions and 529657 deletions

View file

@ -0,0 +1,176 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2018, 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
"use strict";
const blacklist = [
// The logout screen has to be animated only by the logout effect.
"ksmserver ksmserver",
"ksmserver-logout-greeter ksmserver-logout-greeter",
// KDE Plasma splash screen has to be animated only by the login effect.
"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) {
// We don't want to animate most of plasmashell's windows, yet, some
// of them we want to, for example, Task Manager Settings window.
// The problem is that all those window share single window class.
// So, the only way to decide whether a window should be animated is
// to use a heuristic: if a window has decoration, then it's most
// likely a dialog or a settings window so we have to animate it.
if (window.windowClass == "plasmashell plasmashell"
|| window.windowClass == "plasmashell org.kde.plasmashell") {
return window.hasDecoration;
}
if (blacklist.indexOf(window.windowClass) != -1) {
return false;
}
if (window.hasDecoration) {
return true;
}
// Don't animate combobox popups, tooltips, popup menus, etc.
if (window.popupWindow) {
return false;
}
// Dont't animate the outline and the screenlocker as it looks bad.
if (window.lockScreen || window.outline) {
return false;
}
// Override-redirect windows are usually used for user interface
// concepts that are not expected to be animated by this effect.
if (!window.managed) {
return false;
}
return window.normalWindow || window.dialog;
}
setupForcedRoles(window) {
window.setData(Effect.WindowForceBackgroundContrastRole, true);
window.setData(Effect.WindowForceBlurRole, true);
}
cleanupForcedRoles(window) {
window.setData(Effect.WindowForceBackgroundContrastRole, null);
window.setData(Effect.WindowForceBlurRole, null);
}
slotWindowAdded(window) {
if (effects.hasActiveFullScreenEffect) {
return;
}
if (!ScaleEffect.isScaleWindow(window)) {
return;
}
if (!window.visible) {
return;
}
if (effect.isGrabbed(window, Effect.WindowAddedGrabRole)) {
return;
}
this.setupForcedRoles(window);
window.scaleInAnimation = animate({
window: window,
curve: QEasingCurve.OutCubic,
duration: this.duration,
animations: [
{
type: Effect.Scale,
from: this.inScale
},
{
type: Effect.Opacity,
from: 0
}
]
});
}
slotWindowClosed(window) {
if (effects.hasActiveFullScreenEffect) {
return;
}
if (!ScaleEffect.isScaleWindow(window)) {
return;
}
if (!window.visible || window.skipsCloseAnimation) {
return;
}
if (effect.isGrabbed(window, Effect.WindowClosedGrabRole)) {
return;
}
if (window.scaleInAnimation) {
cancel(window.scaleInAnimation);
delete window.scaleInAnimation;
}
this.setupForcedRoles(window);
window.scaleOutAnimation = animate({
window: window,
curve: QEasingCurve.InCubic,
duration: this.duration,
animations: [
{
type: Effect.Scale,
to: this.outScale
},
{
type: Effect.Opacity,
to: 0
}
]
});
}
slotWindowDataChanged(window, role) {
if (role == Effect.WindowAddedGrabRole) {
if (window.scaleInAnimation && effect.isGrabbed(window, role)) {
cancel(window.scaleInAnimation);
delete window.scaleInAnimation;
this.cleanupForcedRoles(window);
}
} else if (role == Effect.WindowClosedGrabRole) {
if (window.scaleOutAnimation && effect.isGrabbed(window, role)) {
cancel(window.scaleOutAnimation);
delete window.scaleOutAnimation;
this.cleanupForcedRoles(window);
}
}
}
}
new ScaleEffect();

View file

@ -0,0 +1,18 @@
<?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=""/>
<group name="">
<entry name="Duration" type="UInt">
<default>0</default>
</entry>
<entry name="InScale" type="Double">
<default>0.8</default>
</entry>
<entry name="OutScale" type="Double">
<default>0.8</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ScaleEffectConfig</class>
<widget class="QWidget" name="ScaleEffectConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>455</width>
<height>177</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="1" column="0">
<widget class="QLabel" name="label_Duration">
<property name="text">
<string>Duration:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="kcfg_Duration">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="specialValueText">
<string>Default</string>
</property>
<property name="suffix">
<string> milliseconds</string>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_InScale">
<property name="text">
<string>Window open scale:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_OutScale">
<property name="text">
<string>Window close scale:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="kcfg_InScale">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<double>9.990000000000000</double>
</property>
<property name="singleStep">
<double>0.050000000000000</double>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="kcfg_OutScale">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<double>9.990000000000000</double>
</property>
<property name="singleStep">
<double>0.050000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,145 @@
{
"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": "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": true,
"Icon": "preferences-system-windows-effect-scale",
"Id": "scale",
"License": "GPL",
"Name": "Scale",
"Name[ar]": "حجّم",
"Name[be]": "Маштабаванне",
"Name[bg]": "Мащабиране",
"Name[ca@valencia]": "Escala",
"Name[ca]": "Escala",
"Name[cs]": "Měřítko",
"Name[de]": "Skalieren",
"Name[en_GB]": "Scale",
"Name[eo]": "Skalo",
"Name[es]": "Escalar",
"Name[et]": "Skaleerimine",
"Name[eu]": "Eskalatu",
"Name[fi]": "Skaalaus",
"Name[fr]": "Échelle",
"Name[gl]": "Escala",
"Name[he]": "קנה מידה",
"Name[hu]": "Méretezés",
"Name[ia]": "Scala",
"Name[is]": "Kvarði",
"Name[it]": "Scala",
"Name[ja]": "スケール",
"Name[ka]": "მასშტაბირება",
"Name[ko]": "크기 조정",
"Name[lt]": "Mastelis",
"Name[nl]": "Schaal",
"Name[nn]": "Skalering",
"Name[pl]": "Skalowanie",
"Name[pt]": "Escala",
"Name[pt_BR]": "Escala",
"Name[ro]": "Scalare",
"Name[ru]": "Масштабирование",
"Name[sk]": "Meniť mierku",
"Name[sl]": "Spremeni velikost",
"Name[ta]": "அளவுமாற்று",
"Name[tr]": "Ölçeklendir",
"Name[uk]": "Масштабування",
"Name[vi]": "Đổi cỡ",
"Name[x-test]": "xxScalexx",
"Name[zh_CN]": "按比例缩放",
"Name[zh_TW]": "縮放"
},
"X-KDE-ConfigModule": "kcm_kwin4_genericscripted",
"X-KDE-Ordering": 60,
"X-KWin-Config-TranslationDomain": "kwin",
"X-KWin-Exclusive-Category": "toplevel-open-close-animation",
"X-Plasma-API": "javascript"
}