[effects] Drop the Scale in effect

Summary:
It's superseded by the new scale effect(D13461).

Existing users of this effect will be migrated to the new scale effect.

Depends on D13461

Reviewers: #kwin, #plasma, #vdg, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13462
This commit is contained in:
Vlad Zagorodniy 2018-06-10 14:02:57 +03:00
parent 9d197e8cb6
commit 4299b81f65
11 changed files with 21 additions and 267 deletions

View file

@ -701,6 +701,8 @@ if (KF5DocTools_FOUND)
add_subdirectory(doc)
endif()
add_subdirectory(kconf_update)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
include(CMakePackageConfigHelpers)

View file

@ -120,8 +120,6 @@ void SlidingPopupsTest::testWithOtherEffect_data()
{
QTest::addColumn<QStringList>("effectsToLoad");
QTest::newRow("scale, slide") << QStringList{QStringLiteral("kwin4_effect_scalein"), QStringLiteral("slidingpopups")};
QTest::newRow("slide, scale") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_scalein")};
QTest::newRow("fade, slide") << QStringList{QStringLiteral("kwin4_effect_fade"), QStringLiteral("slidingpopups")};
QTest::newRow("slide, fade") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_fade")};
@ -257,8 +255,6 @@ void SlidingPopupsTest::testWithOtherEffectWayland_data()
{
QTest::addColumn<QStringList>("effectsToLoad");
QTest::newRow("scale, slide") << QStringList{QStringLiteral("kwin4_effect_scalein"), QStringLiteral("slidingpopups")};
QTest::newRow("slide, scale") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_scalein")};
QTest::newRow("fade, slide") << QStringList{QStringLiteral("kwin4_effect_fade"), QStringLiteral("slidingpopups")};
QTest::newRow("slide, fade") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_fade")};

View file

@ -119,7 +119,6 @@ void TestPluginEffectLoader::testHasEffect_data()
QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << false;
QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << false;
QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << false;
QTest::newRow("ScaleIn") << QStringLiteral("kwin4_effect_scalein") << false;
QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << false;
// and the fake effects we use here
QTest::newRow("fakeeffectplugin") << QStringLiteral("fakeeffectplugin") << true;

View file

@ -151,7 +151,6 @@ void TestScriptedEffectLoader::testHasEffect_data()
QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true;
QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true;
QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true;
QTest::newRow("ScaleIn") << QStringLiteral("kwin4_effect_scalein") << true;
QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true;
}
@ -183,7 +182,6 @@ void TestScriptedEffectLoader::testKnownEffects()
<< QStringLiteral("kwin4_effect_login")
<< QStringLiteral("kwin4_effect_logout")
<< QStringLiteral("kwin4_effect_maximize")
<< QStringLiteral("kwin4_effect_scalein")
<< QStringLiteral("kwin4_effect_translucency");
KWin::ScriptedEffectLoader loader;
@ -210,7 +208,6 @@ void TestScriptedEffectLoader::testLoadEffect_data()
QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true;
QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true;
QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true;
QTest::newRow("ScaleIn") << QStringLiteral("kwin4_effect_scalein") << true;
QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true;
}
@ -275,15 +272,15 @@ void TestScriptedEffectLoader::testLoadScriptedEffect_data()
const KWin::LoadEffectFlags dontLoadFlags = KWin::LoadEffectFlags();
// enabled by default
QTest::newRow("Fade") << QStringLiteral("kwin4_effect_fade") << true << checkDefault;
QTest::newRow("Fade") << QStringLiteral("kwin4_effect_fade") << true << checkDefault;
// not enabled by default
QTest::newRow("Scalein") << QStringLiteral("kwin4_effect_scalein") << true << checkDefault;
QTest::newRow("EyeOnScreen") << QStringLiteral("kwin4_effect_eyeonscreen") << true << checkDefault;
// Force an Effect which will load
QTest::newRow("Scalein-Force") << QStringLiteral("kwin4_effect_scalein") << true << forceFlags;
QTest::newRow("EyeOnScreen-Force") << QStringLiteral("kwin4_effect_eyeonscreen") << true << forceFlags;
// Enforce no load of effect which is enabled by default
QTest::newRow("Fade-DontLoad") << QStringLiteral("kwin4_effect_fade") << false << dontLoadFlags;
QTest::newRow("Fade-DontLoad") << QStringLiteral("kwin4_effect_fade") << false << dontLoadFlags;
// Enforce no load of effect which is not enabled by default, but enforced
QTest::newRow("Scalein-DontLoad") << QStringLiteral("kwin4_effect_scalein") << false << dontLoadFlags;
QTest::newRow("EyeOnScreen-DontLoad") << QStringLiteral("kwin4_effect_eyeonscreen") << false << dontLoadFlags;
}
void TestScriptedEffectLoader::testLoadScriptedEffect()
@ -363,7 +360,6 @@ void TestScriptedEffectLoader::testLoadAllEffects()
plugins.writeEntry(kwin4 + QStringLiteral("logoutEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("maximizeEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("minimizeanimationEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("scaleinEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("translucencyEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("eyeonscreenEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("windowapertureEnabled"), false);
@ -388,7 +384,7 @@ void TestScriptedEffectLoader::testLoadAllEffects()
QVERIFY(!spy.wait(100));
// now let's prepare a config which has one effect explicitly enabled
plugins.writeEntry(kwin4 + QStringLiteral("scaleinEnabled"), true);
plugins.writeEntry(kwin4 + QStringLiteral("eyeonscreenEnabled"), true);
plugins.sync();
loader.queryAndLoadAll();
@ -401,7 +397,7 @@ void TestScriptedEffectLoader::testLoadAllEffects()
// if we caught a signal it should have the effect name we passed in
QList<QVariant> arguments = spy.takeFirst();
QCOMPARE(arguments.count(), 2);
QCOMPARE(arguments.at(1).toString(), kwin4 + QStringLiteral("scalein"));
QCOMPARE(arguments.at(1).toString(), kwin4 + QStringLiteral("eyeonscreen"));
spy.clear();
// let's delete one of the default entries
@ -419,8 +415,8 @@ void TestScriptedEffectLoader::testLoadAllEffects()
loadedEffects << list.at(1).toString();
}
qSort(loadedEffects);
QCOMPARE(loadedEffects.at(0), kwin4 + QStringLiteral("fade"));
QCOMPARE(loadedEffects.at(1), kwin4 + QStringLiteral("scalein"));
QCOMPARE(loadedEffects.at(0), kwin4 + QStringLiteral("eyeonscreen"));
QCOMPARE(loadedEffects.at(1), kwin4 + QStringLiteral("fade"));
}
void TestScriptedEffectLoader::testCancelLoadAllEffects()
@ -433,7 +429,7 @@ void TestScriptedEffectLoader::testCancelLoadAllEffects()
KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
const QString kwin4 = QStringLiteral("kwin4_effect_");
KConfigGroup plugins = config->group("Plugins");
plugins.writeEntry(kwin4 + QStringLiteral("scaleinEnabled"), true);
plugins.writeEntry(kwin4 + QStringLiteral("eyeonscreenEnabled"), true);
plugins.sync();
loader.setConfig(config);

View file

@ -141,7 +141,6 @@ add_subdirectory( login )
add_subdirectory( logout )
add_subdirectory( maximize )
add_subdirectory( morphingpopups )
add_subdirectory( scalein )
add_subdirectory( translucency )
add_subdirectory( windowaperture )

View file

@ -1 +0,0 @@
add_subdirectory( package )

View file

@ -1,6 +0,0 @@
install(DIRECTORY contents DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effects/kwin4_effect_scalein)
install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effects/kwin4_effect_scalein)
install(FILES metadata.desktop
DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME}
RENAME kwin4_effect_scalein.desktop)

View file

@ -1,77 +0,0 @@
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2013 Kai Uwe Broulik <kde@privat.broulik.de>
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 2 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 <http://www.gnu.org/licenses/>.
*********************************************************************/
/*global effect, effects, animate, animationTime, Effect, QEasingCurve */
var scaleInEffect = {
duration: animationTime(150),
loadConfig: function () {
"use strict";
scaleInEffect.duration = animationTime(150);
},
isScaleWindow: function (window) {
"use strict";
if (window.popupMenu || window.specialWindow || window.utility || window.minimized ||
effect.isGrabbed(window, Effect.WindowAddedGrabRole)) {
return false;
}
return true;
},
scaleIn: function (window) {
"use strict";
window.scaleInWindowTypeAnimation = animate({
window: window,
duration: scaleInEffect.duration,
curve: QEasingCurve.InOutQuad,
animations: [{
type: Effect.Opacity,
from: 0.0,
to: 1.0
}, {
type: Effect.Scale,
from: 0.75,
to: 1.0
}]
});
},
added: function (window) {
"use strict";
if (!scaleInEffect.isScaleWindow(window)) {
return;
}
scaleInEffect.scaleIn(window);
},
dataChanged: function (window, role) {
"use strict";
if (role == Effect.WindowAddedGrabRole) {
if (effect.isGrabbed(window, Effect.WindowAddedGrabRole)) {
if (window.scaleInWindowTypeAnimation !== undefined) {
cancel(window.scaleInWindowTypeAnimation);
window.scaleInWindowTypeAnimation = undefined;
}
}
}
},
init: function () {
"use strict";
effect.configChanged.connect(scaleInEffect.loadConfig);
effects.windowAdded.connect(scaleInEffect.added);
effects.windowDataChanged.connect(scaleInEffect.dataChanged);
}
};
scaleInEffect.init();

View file

@ -1,163 +0,0 @@
[Desktop Entry]
Name=Scale In
Name[af]=Rek-verskyn
Name[ar]=تحجيم النوافذ
Name[bg]=Увеличаване
Name[bs]=Uvećana razmjera
Name[ca]=Escalat
Name[ca@valencia]=Escalat
Name[cs]=Zvětšení
Name[csb]=Skalowanié
Name[da]=Skalér ind
Name[de]=Hineinzoomen
Name[el]=Εστίαση
Name[en_GB]=Scale In
Name[eo]=Enskali
Name[es]=Escalar
Name[et]=Skaleerimine
Name[eu]=Eskalatu
Name[fa]=مقیاس در
Name[fi]=Skaalaus
Name[fr]=Gradation
Name[fy]=Ynskale
Name[ga]=Scálaigh Isteach
Name[gl]=Ampliar
Name[gu]=
Name[he]=התקרבות
Name[hi]=
Name[hne]=
Name[hr]=Skaliranje
Name[hu]=Felbukkanás
Name[ia]=Scala intra
Name[id]=Scale In
Name[is]=Kvarða niður
Name[it]=Espandi
Name[ja]=
Name[kk]=Масштабтау
Name[km]=
Name[kn]=
Name[ko]=
Name[lt]=Išdidėjimas
Name[lv]=Mērogot iekšā
Name[mai]=
Name[mk]=Зголемување
Name[ml]=ി
Name[mr]=
Name[nb]=Skaler inn
Name[nds]=Inpassen
Name[ne]=ि
Name[nl]=Inschalen
Name[nn]=Skaler inn
Name[pa]=
Name[pl]=Skalowanie
Name[pt]=Escala
Name[pt_BR]=Dimensionar
Name[ro]=Scalează interior
Name[ru]=Анимация появления окна
Name[se]=Skálere sisa
Name[si]=
Name[sk]=Škálovať
Name[sl]=Animirano pojavljanje
Name[sr]=Увећана размера
Name[sr@ijekavian]=Увећана размјера
Name[sr@ijekavianlatin]=Uvećana razmjera
Name[sr@latin]=Uvećana razmera
Name[sv]=Skala in
Name[ta]= ி
Name[te]=
Name[tg]=Масштабирование (увеличение)
Name[th]=
Name[tr]=Açılan Pencereleri Canlandır
Name[ug]=يېقىنلاشتۇر
Name[uk]=Збільшення
Name[vi]=Co dãn vào
Name[wa]=Agrandi l' schåle
Name[x-test]=xxScale Inxx
Name[zh_CN]=
Name[zh_TW]=
Icon=preferences-system-windows-effect-scale-in
Comment=Animate the appearing of windows
Comment[ar]=يحرك عملية ظهور النوافذ
Comment[be@latin]=Animuje źjaŭleńnie akon.
Comment[bg]=Анимирано показване на прозорците
Comment[bs]=Animira pojavljivanje prozora
Comment[ca]=Anima l'aparició de les finestres
Comment[ca@valencia]=Anima l'aparició de les finestres
Comment[cs]=Animuje objevení oken
Comment[csb]=Animùjë pòkazëwanié sã òkna
Comment[da]=Animér vinduers fremkomst
Comment[de]=Animiert das Erscheinen von Fenstern.
Comment[el]=Εφέ κίνησης της εμφάνισης των παραθύρων
Comment[en_GB]=Animate the appearing of windows
Comment[eo]=Animigas la aperon de fenestroj
Comment[es]=Anima la aparición de ventanas
Comment[et]=Animeerib akende ilmumise
Comment[eu]=Leihoak agertzeko modua animatzen du
Comment[fi]=Animoi ikkunoiden ilmestymisen
Comment[fr]=Anime l'apparition des fenêtres
Comment[fy]=Bringt it ferskinen fan finsters ta libben
Comment[ga]=Déan beochan agus fuinneog á taispeáint
Comment[gl]=Anima a aparición das xanelas
Comment[gu]=િ િ
Comment[he]=הנפשת ההופעה של חלונות
Comment[hi]=ि ि
Comment[hne]=ि
Comment[hr]=Animacija pojavljivanja prozora
Comment[hu]=Animáció történik ablakok megjelenésekor
Comment[ia]=Anima le apparentia de fenestras
Comment[id]=Animasikan munculnya jendela
Comment[is]=Hreyfingaráhrif við birtingu glugga
Comment[it]=Anima l'apparizione delle finestre
Comment[ja]=
Comment[kk]=Терезеледің пайда болуын анимациялау
Comment[km]=
Comment[kn]=ಿಿ ಿಿ ಿ
Comment[ko]=
Comment[lt]=Animuoja langų atsiradimą
Comment[lv]=Animē logu parādīšanos
Comment[mk]=Го анимира појавувањето прозорци
Comment[ml]= ി .
Comment[mr]= ि
Comment[nb]=Animer vinduer som dukker opp
Comment[nds]=Dat Opduken vun Finstern animeren
Comment[nl]=Voorziet het verschijnen van vensters van een animatie
Comment[nn]=Animer opning av vindauge
Comment[pa]=ਿ
Comment[pl]=Efekt skalowania okien przy ich otwieraniu i zamykaniu
Comment[pt]=Animar a aparição das janelas
Comment[pt_BR]=Anima o aparecimento de janelas
Comment[ro]=Animează apariția ferestrelor
Comment[ru]=Анимация появления нового окна
Comment[si]=
Comment[sk]=Animuje objavenie okien
Comment[sl]=Pojavljanje oken je animirano
Comment[sr]=Анимира појављивање прозора
Comment[sr@ijekavian]=Анимира појављивање прозора
Comment[sr@ijekavianlatin]=Animira pojavljivanje prozora
Comment[sr@latin]=Animira pojavljivanje prozora
Comment[sv]=Animera när fönster framträder
Comment[ta]=Animate the appearing of windows
Comment[tg]=Анимация появления окон
Comment[th]=
Comment[tr]=Pencerelerin açılışını canlandır
Comment[ug]=كۆزنەكلەرنىڭ ئېچىلىشىنى جانلاندۇر
Comment[uk]=Анімація появи вікон
Comment[vi]=To hiu ng xut hin ca s
Comment[wa]=Animer l' aparexhaedje des fniesses
Comment[x-test]=xxAnimate the appearing of windowsxx
Comment[zh_CN]=
Comment[zh_TW]=
Type=Service
X-Plasma-API=javascript
X-Plasma-MainScript=code/main.js
X-KDE-ServiceTypes=KWin/Effect
X-KDE-PluginInfo-Author=Luboš Luňák, Kai Uwe Broulik
X-KDE-PluginInfo-Email=l.lunak@kde.org, kde@privat.broulik.de
X-KDE-PluginInfo-Name=kwin4_effect_scalein
X-KDE-PluginInfo-Version=0.2.0
X-KDE-PluginInfo-Category=Appearance
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=false
X-KDE-Ordering=50

View file

@ -0,0 +1,2 @@
install(FILES kwin.upd
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})

7
kconf_update/kwin.upd Normal file
View file

@ -0,0 +1,7 @@
Version=5
# Replace old Scale in effect with Scale effect.
Id=replace-scalein-with-scale
File=kwinrc
Group=Plugins
Key=kwin4_effect_scaleinEnabled,scaleEnabled