diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -701,6 +701,8 @@ add_subdirectory(doc) endif() +add_subdirectory(kconf_update) + feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) include(CMakePackageConfigHelpers) diff --git a/autotests/test_builtin_effectloader.cpp b/autotests/test_builtin_effectloader.cpp --- a/autotests/test_builtin_effectloader.cpp +++ b/autotests/test_builtin_effectloader.cpp @@ -87,6 +87,7 @@ QTest::newRow("Cube") << QStringLiteral("cube") << true; QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << true; QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true; + QTest::newRow("DialogParent") << QStringLiteral("dialogparent") << true; QTest::newRow("DimInactive") << QStringLiteral("diminactive") << true; QTest::newRow("DimScreen") << QStringLiteral("dimscreen") << true; QTest::newRow("FallApart") << QStringLiteral("fallapart") << true; @@ -143,6 +144,7 @@ << QStringLiteral("cube") << QStringLiteral("cubeslide") << QStringLiteral("desktopgrid") + << QStringLiteral("dialogparent") << QStringLiteral("diminactive") << QStringLiteral("dimscreen") << QStringLiteral("fallapart") @@ -212,6 +214,7 @@ QTest::newRow("CubeSlide-GL") << QStringLiteral("cubeslide") << true << oc << true; QTest::newRow("CubeSlide-GL-no-anim") << QStringLiteral("cubeslide") << false << oc << false; QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true << xc << true; + QTest::newRow("DialogParent") << QStringLiteral("dialogparent") << true << xc << true; QTest::newRow("DimInactive") << QStringLiteral("diminactive") << true << xc << true; QTest::newRow("DimScreen") << QStringLiteral("dimscreen") << true << xc << true; QTest::newRow("FallApart") << QStringLiteral("fallapart") << false << xc << true; @@ -303,6 +306,7 @@ QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false << xc; QTest::newRow("CubeSlide-GL") << QStringLiteral("cubeslide") << true << oc; QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true << xc; + QTest::newRow("DialogParent") << QStringLiteral("dialogparent") << true << xc; QTest::newRow("DimInactive") << QStringLiteral("diminactive") << true << xc; QTest::newRow("DimScreen") << QStringLiteral("dimScreen") << true << xc; QTest::newRow("FallApart") << QStringLiteral("fallapart") << false << xc; @@ -502,6 +506,7 @@ // prepare the configuration to hard enable/disable the effects we want to load KConfigGroup plugins = config->group("Plugins"); plugins.writeEntry(QStringLiteral("desktopgridEnabled"), false); + plugins.writeEntry(QStringLiteral("dialogparentEnabled"), false); plugins.writeEntry(QStringLiteral("highlightwindowEnabled"), false); plugins.writeEntry(QStringLiteral("kscreenEnabled"), false); plugins.writeEntry(QStringLiteral("minimizeanimationEnabled"), false); diff --git a/autotests/test_plugin_effectloader.cpp b/autotests/test_plugin_effectloader.cpp --- a/autotests/test_plugin_effectloader.cpp +++ b/autotests/test_plugin_effectloader.cpp @@ -79,6 +79,7 @@ QTest::newRow("Cube") << QStringLiteral("cube") << false; QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false; QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false; + QTest::newRow("DialogParent") << QStringLiteral("dialogparent") << false; QTest::newRow("DimInactive") << QStringLiteral("diminactive") << false; QTest::newRow("DimScreen") << QStringLiteral("dimscreen") << false; QTest::newRow("FallApart") << QStringLiteral("fallapart") << false; @@ -114,7 +115,6 @@ // all the scripted effects should fail QTest::newRow("Fade") << QStringLiteral("kwin4_effect_fade") << false; QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << false; - QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << false; QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << false; QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << false; QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << false; diff --git a/autotests/test_scripted_effectloader.cpp b/autotests/test_scripted_effectloader.cpp --- a/autotests/test_scripted_effectloader.cpp +++ b/autotests/test_scripted_effectloader.cpp @@ -108,6 +108,7 @@ QTest::newRow("Cube") << QStringLiteral("cube") << false; QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false; QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false; + QTest::newRow("DialogParent") << QStringLiteral("dialogparent") << false; QTest::newRow("DimInactive") << QStringLiteral("diminactive") << false; QTest::newRow("DimScreen") << QStringLiteral("dimscreen") << false; QTest::newRow("FallApart") << QStringLiteral("fallapart") << false; @@ -146,7 +147,6 @@ QTest::newRow("Fade + kwin4_effect + CS") << QStringLiteral("kwin4_eFfect_fAde") << true; QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true; QTest::newRow("FrozenApp") << QStringLiteral("kwin4_effect_frozenapp") << true; - QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true; QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true; QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true; QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true; @@ -175,8 +175,7 @@ void TestScriptedEffectLoader::testKnownEffects() { QStringList expectedEffects; - expectedEffects << QStringLiteral("kwin4_effect_dialogparent") - << QStringLiteral("kwin4_effect_fade") + expectedEffects << QStringLiteral("kwin4_effect_fade") << QStringLiteral("kwin4_effect_fadedesktop") << QStringLiteral("kwin4_effect_frozenapp") << QStringLiteral("kwin4_effect_login") @@ -205,7 +204,6 @@ QTest::newRow("Fade + kwin4_effect + CS") << QStringLiteral("kwin4_eFfect_fAde") << true; QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true; QTest::newRow("FrozenApp") << QStringLiteral("kwin4_effect_frozenapp") << true; - QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true; QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true; QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true; QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true; @@ -354,7 +352,6 @@ // prepare the configuration to hard enable/disable the effects we want to load KConfigGroup plugins = config->group("Plugins"); - plugins.writeEntry(kwin4 + QStringLiteral("dialogparentEnabled"), false); plugins.writeEntry(kwin4 + QStringLiteral("fadeEnabled"), false); plugins.writeEntry(kwin4 + QStringLiteral("fadedesktopEnabled"), false); plugins.writeEntry(kwin4 + QStringLiteral("frozenappEnabled"), false); diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -130,7 +130,6 @@ ) # scripted effects -add_subdirectory( dialogparent ) add_subdirectory( eyeonscreen ) add_subdirectory( fade ) add_subdirectory( fadedesktop ) @@ -148,6 +147,7 @@ # Common effects add_subdirectory( desktopgrid ) +include( dialogparent/CMakeLists.txt ) add_subdirectory( diminactive ) include( dimscreen/CMakeLists.txt ) include( fallapart/CMakeLists.txt ) diff --git a/effects/dialogparent/CMakeLists.txt b/effects/dialogparent/CMakeLists.txt --- a/effects/dialogparent/CMakeLists.txt +++ b/effects/dialogparent/CMakeLists.txt @@ -1 +1,7 @@ -add_subdirectory(package) +####################################### +# Effect + +# Source files +set( kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources} + dialogparent/dialogparent.cpp + ) diff --git a/effects/dialogparent/dialogparent.h b/effects/dialogparent/dialogparent.h new file mode 100644 --- /dev/null +++ b/effects/dialogparent/dialogparent.h @@ -0,0 +1,78 @@ +/******************************************************************** + KWin - the KDE window manager + This file is part of the KDE project. + +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 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 . +*********************************************************************/ + +#ifndef KWIN_DIALOG_PARENT_H +#define KWIN_DIALOG_PARENT_H + +// kwineffects +#include + +namespace KWin +{ + +class DialogParentEffect : public Effect +{ + Q_OBJECT + +public: + DialogParentEffect(); + ~DialogParentEffect() override; + + void reconfigure(ReconfigureFlags flags) override; + + void prePaintScreen(ScreenPrePaintData &data, int time) override; + void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; + void postPaintScreen() override; + + bool isActive() const override; + int requestedEffectChainPosition() const override; + +private Q_SLOTS: + void windowAdded(EffectWindow *w); + void windowClosed(EffectWindow *w); + void windowDeleted(EffectWindow *w); + void windowModalityChanged(EffectWindow *w); + void activeFullScreenEffectChanged(); + +private: + void addModal(EffectWindow *m); + void removeModal(EffectWindow *m); + +private: + std::chrono::milliseconds m_duration; + qreal m_dimStrength = 0.33; + + struct Transition { + TimeLine timeLine; + qreal dimStrength; + }; + + QHash m_transitions; + QHash m_dimmedWindows; +}; + +inline int DialogParentEffect::requestedEffectChainPosition() const +{ + return 70; +} + +} // namespace KWin + +#endif diff --git a/effects/dialogparent/dialogparent.cpp b/effects/dialogparent/dialogparent.cpp new file mode 100644 --- /dev/null +++ b/effects/dialogparent/dialogparent.cpp @@ -0,0 +1,240 @@ +/******************************************************************** + KWin - the KDE window manager + This file is part of the KDE project. + +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 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 . +*********************************************************************/ + +// own +#include "dialogparent.h" + +namespace KWin +{ + +DialogParentEffect::DialogParentEffect() +{ + reconfigure(ReconfigureAll); + + connect(effects, &EffectsHandler::windowAdded, + this, &DialogParentEffect::windowAdded); + connect(effects, &EffectsHandler::windowClosed, + this, &DialogParentEffect::windowClosed); + connect(effects, &EffectsHandler::windowDeleted, + this, &DialogParentEffect::windowDeleted); + connect(effects, &EffectsHandler::windowModalityChanged, + this, &DialogParentEffect::windowModalityChanged); + connect(effects, &EffectsHandler::activeFullScreenEffectChanged, + this, &DialogParentEffect::activeFullScreenEffectChanged); + + const auto windows = effects->stackingOrder(); + for (EffectWindow *w : windows) { + if (!w->isModal()) { + continue; + } + addModal(w); + } +} + +DialogParentEffect::~DialogParentEffect() +{ +} + +void DialogParentEffect::reconfigure(ReconfigureFlags flags) +{ + Q_UNUSED(flags) + + m_duration = std::chrono::milliseconds(static_cast(animationTime(250))); + + auto transitionIt = m_transitions.begin(); + while (transitionIt != m_transitions.end()) { + (*transitionIt).timeLine.setDuration(m_duration); + ++transitionIt; + } +} + +void DialogParentEffect::prePaintScreen(ScreenPrePaintData &data, int time) +{ + const std::chrono::milliseconds delta(time); + + auto transitionIt = m_transitions.begin(); + while (transitionIt != m_transitions.end()) { + (*transitionIt).timeLine.update(delta); + ++transitionIt; + } + + effects->prePaintScreen(data, time); +} + +void DialogParentEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) +{ + auto transitionIt = m_transitions.constFind(w); + if (transitionIt != m_transitions.constEnd()) { + const qreal strength = (*transitionIt).dimStrength * (*transitionIt).timeLine.value(); + data.multiplyBrightness(1.0 - strength); + data.multiplySaturation(1.0 - strength); + effects->paintWindow(w, mask, region, data); + return; + } + + if (!effects->activeFullScreenEffect()) { + auto dimIt = m_dimmedWindows.constFind(w); + if (dimIt != m_dimmedWindows.constEnd()) { + const qreal strength = (*dimIt); + data.multiplyBrightness(1.0 - strength); + data.multiplySaturation(1.0 - strength); + } + } + + effects->paintWindow(w, mask, region, data); +} + +void DialogParentEffect::postPaintScreen() +{ + auto transitionIt = m_transitions.begin(); + while (transitionIt != m_transitions.end()) { + EffectWindow *w = transitionIt.key(); + w->addRepaintFull(); + if ((*transitionIt).timeLine.done()) { + transitionIt = m_transitions.erase(transitionIt); + } else { + ++transitionIt; + } + } + + effects->postPaintScreen(); +} + +bool DialogParentEffect::isActive() const +{ + return !m_dimmedWindows.isEmpty() + || !m_transitions.isEmpty(); +} + +void DialogParentEffect::windowAdded(EffectWindow *w) +{ + if (w->isModal()) { + addModal(w); + } +} + +void DialogParentEffect::windowClosed(EffectWindow *w) +{ + if (w->isModal()) { + removeModal(w); + return; + } + + auto transitionIt = m_transitions.find(w); + if (transitionIt != m_transitions.end()) { + m_dimmedWindows[w] = (*transitionIt).dimStrength * (*transitionIt).timeLine.value(); + m_transitions.erase(transitionIt); + } +} + +void DialogParentEffect::windowDeleted(EffectWindow *w) +{ + m_dimmedWindows.remove(w); + m_transitions.remove(w); +} + +void DialogParentEffect::windowModalityChanged(EffectWindow *w) +{ + if (w->isModal()) { + addModal(w); + } else { + removeModal(w); + } +} + +void DialogParentEffect::activeFullScreenEffectChanged() +{ + if (!isActive()) { + return; + } + + const auto direction = effects->activeFullScreenEffect() + ? TimeLine::Backward + : TimeLine::Forward; + + auto dimIt = m_dimmedWindows.constBegin(); + while (dimIt != m_dimmedWindows.constEnd()) { + EffectWindow *w = dimIt.key(); + Transition &transition = m_transitions[w]; + + if (transition.timeLine.running()) { + transition.timeLine.setDirection(direction); + } else { + transition.dimStrength = (*dimIt); + transition.timeLine.reset(); + transition.timeLine.setDuration(m_duration); + transition.timeLine.setDirection(direction); + } + + ++dimIt; + } + + effects->addRepaintFull(); +} + +void DialogParentEffect::addModal(EffectWindow *m) +{ + const auto windows = m->mainWindows(); + for (EffectWindow *w : windows) { + m_dimmedWindows[w] = m_dimStrength; + w->addRepaintFull(); + + if (effects->activeFullScreenEffect()) { + continue; + } + + Transition &transition = m_transitions[w]; + + if (transition.timeLine.running()) { + transition.timeLine.toggleDirection(); + continue; + } + + transition.dimStrength = m_dimStrength; + transition.timeLine.setDuration(m_duration); + transition.timeLine.setDirection(TimeLine::Forward); + } +} + +void DialogParentEffect::removeModal(EffectWindow *m) +{ + const auto windows = m->mainWindows(); + for (EffectWindow *w : windows) { + m_dimmedWindows.remove(w); + w->addRepaintFull(); + + if (effects->activeFullScreenEffect()) { + continue; + } + + Transition &transition = m_transitions[w]; + + if (transition.timeLine.running()) { + transition.timeLine.toggleDirection(); + continue; + } + + transition.dimStrength = m_dimStrength; + transition.timeLine.setDuration(m_duration); + transition.timeLine.setDirection(TimeLine::Backward); + } +} + +} // namespace KWin diff --git a/effects/dialogparent/package/CMakeLists.txt b/effects/dialogparent/package/CMakeLists.txt deleted file mode 100644 --- a/effects/dialogparent/package/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -install(DIRECTORY contents DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effects/kwin4_effect_dialogparent) -install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effects/kwin4_effect_dialogparent) - -install(FILES metadata.desktop - DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} - RENAME kwin4_effect_dialogparent.desktop) diff --git a/effects/dialogparent/package/contents/code/main.js b/effects/dialogparent/package/contents/code/main.js deleted file mode 100644 --- a/effects/dialogparent/package/contents/code/main.js +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - - Copyright (C) 2013 Martin Gräßlin - -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 . -*********************************************************************/ -/*global effect, effects, animate, cancel, set, animationTime, Effect, QEasingCurve */ -/*jslint continue: true */ -var dialogParentEffect = { - duration: animationTime(300), - windowAdded: function (window) { - "use strict"; - var mainWindows, i, w; - if (window === null || window.modal === false) { - return; - } - dialogParentEffect.dialogGotModality(window) - }, - dialogGotModality: function (window) { - "use strict"; - mainWindows = window.mainWindows(); - for (i = 0; i < mainWindows.length; i += 1) { - w = mainWindows[i]; - if (w.dialogParentAnimation !== undefined) { - continue; - } - dialogParentEffect.startAnimation(w, dialogParentEffect.duration); - } - }, - startAnimation: function (window, duration) { - "use strict"; - if (window.visible === false) { - return; - } - window.dialogParentAnimation = set({ - window: window, - duration: duration, - animations: [{ - type: Effect.Saturation, - to: 0.4 - }, { - type: Effect.Brightness, - to: 0.6 - }] - }); - }, - windowClosed: function (window) { - "use strict"; - var mainWindows, i, w; - dialogParentEffect.cancelAnimation(window); - if (window.modal === false) { - return; - } - dialogParentEffect.dialogLostModality(window); - }, - dialogLostModality: function (window) { - "use strict"; - mainWindows = window.mainWindows(); - for (i = 0; i < mainWindows.length; i += 1) { - w = mainWindows[i]; - if (w.dialogParentAnimation === undefined) { - continue; - } - cancel(w.dialogParentAnimation); - w.dialogParentAnimation = undefined; - animate({ - window: w, - duration: dialogParentEffect.duration, - animations: [{ - type: Effect.Saturation, - from: 0.4, - to: 1.0 - }, { - type: Effect.Brightness, - from: 0.6, - to: 1.0 - }] - }); - } - }, - cancelAnimation: function (window) { - "use strict"; - if (window.dialogParentAnimation !== undefined) { - cancel(window.dialogParentAnimation); - window.dialogParentAnimation = undefined; - } - }, - desktopChanged: function () { - "use strict"; - var i, windows, window; - windows = effects.stackingOrder; - for (i = 0; i < windows.length; i += 1) { - window = windows[i]; - dialogParentEffect.cancelAnimation(window); - dialogParentEffect.restartAnimation(window); - } - }, - modalDialogChanged: function(dialog) { - "use strict"; - if (dialog.modal === false) - dialogParentEffect.dialogLostModality(dialog); - else if (dialog.modal === true) - dialogParentEffect.dialogGotModality(dialog); - }, - restartAnimation: function (window) { - "use strict"; - if (window === null || window.findModal() === null) { - return; - } - dialogParentEffect.startAnimation(window, 1); - }, - init: function () { - "use strict"; - var i, windows; - effects.windowAdded.connect(dialogParentEffect.windowAdded); - effects.windowClosed.connect(dialogParentEffect.windowClosed); - effects.windowMinimized.connect(dialogParentEffect.cancelAnimation); - effects.windowUnminimized.connect(dialogParentEffect.restartAnimation); - effects.windowModalityChanged.connect(dialogParentEffect.modalDialogChanged) - effects['desktopChanged(int,int)'].connect(dialogParentEffect.desktopChanged); - effects.desktopPresenceChanged.connect(dialogParentEffect.cancelAnimation); - effects.desktopPresenceChanged.connect(dialogParentEffect.restartAnimation); - - // start animation - windows = effects.stackingOrder; - for (i = 0; i < windows.length; i += 1) { - dialogParentEffect.restartAnimation(windows[i]); - } - } -}; -dialogParentEffect.init(); diff --git a/effects/dialogparent/package/metadata.desktop b/effects/dialogparent/package/metadata.desktop deleted file mode 100644 --- a/effects/dialogparent/package/metadata.desktop +++ /dev/null @@ -1,159 +0,0 @@ -[Desktop Entry] -Name=Dialog Parent -Name[af]=Voorafgaande dialoog -Name[ar]=مولدة الحوار -Name[be]=Бацькоўскае акно -Name[bg]=Основен прозорец -Name[bs]=Roditelj dijaloga -Name[ca]=Diàleg principal -Name[ca@valencia]=Diàleg principal -Name[cs]=Předek dialogu -Name[da]=Dialogens forældrevindue -Name[de]=Eltern-Fenster abdunkeln -Name[el]=Γονικός διάλογος -Name[en_GB]=Dialogue Box Parent -Name[eo]=Dialoga patro -Name[es]=Padre de la ventana -Name[et]=Dialoogi eellane -Name[eu]=Elkarrizketa-koadroaren gurasoa -Name[fa]=پدر محاوره -Name[fi]=Isäikkuna -Name[fr]=Boîte de dialogue parente -Name[fy]=Dialooch eigner -Name[ga]=Máthairdialóg -Name[gl]=Pai do diálogo -Name[gu]=સંવાદ પિતૃ -Name[he]=חלון־האב של תיבת דו־שיח -Name[hi]=मूल संवाद -Name[hne]=मूल गोठ -Name[hr]=Dialog Roditelj -Name[hu]=Párbeszédablak-tartó -Name[ia]=Dialogo genitor -Name[id]=Induk Dialog -Name[is]=Dekking undir valglugga -Name[it]=Finestra madre -Name[ja]=ダイアログの親 -Name[kk]=Диалогтың аталығы -Name[km]=ប្រអប់​មេ​ -Name[kn]=ಸಂವಾದ ಪೂರ್ವಜ (ಪೇರೆಂಟ್) -Name[ko]=대화 상자 부모 -Name[lt]=Dialogo savininkas -Name[lv]=Dialoga vecāks -Name[mai]=मूल संवाद -Name[ml]=മാതൃജാലകം -Name[mr]=मूळ संवाद -Name[nb]=Dialog-mor -Name[nds]=Överornt Finster -Name[ne]=प्रमूल संवाद -Name[nl]=Dialoogeigenaar -Name[nn]=Mørklegg foreldrevindauge -Name[pa]=ਡਾਈਲਾਗ ਪੇਰੈਂਟ -Name[pl]=Rodzic okna dialogowego -Name[pt]=Pai da Janela -Name[pt_BR]=Diálogo pai -Name[ro]=Părinte dialog -Name[ru]=Затемнение основного окна -Name[se]=Lásešváhnen -Name[si]=සංවාදය අයත් -Name[sk]=Nadradený dialóg -Name[sl]=Nadrejeno pogovorno okno -Name[sr]=Родитељ дијалога -Name[sr@ijekavian]=Родитељ дијалога -Name[sr@ijekavianlatin]=Roditelj dijaloga -Name[sr@latin]=Roditelj dijaloga -Name[sv]=Dialogrutors ägare -Name[ta]=தாய் பலகம் -Name[te]=డైలాగ్ మాత్రుక -Name[tg]=Соҳиби диалог -Name[th]=กล่องโต้ตอบหลัก -Name[tr]=İletişim Kutusu Sahibi -Name[ug]=ئاتا سۆزلەشكۈ -Name[uk]=Батьківське вікно -Name[vi]=Cha hộp thoại -Name[wa]=Parint del divize -Name[x-test]=xxDialog Parentxx -Name[zh_CN]=暗淡父级对话框 -Name[zh_TW]=上層對話框 -Icon=preferences-system-windows-effect-dialog-parent -Comment=Darkens the parent window of the currently active dialog -Comment[ar]=تعتم النافذة المولدة للحوار النشط حالياً -Comment[bg]=Затъмняване на главния от активните прозорци -Comment[bs]=Zatamnjuje roditeljski prozor trenutno aktivnog dijaloga -Comment[ca]=Enfosqueix la finestra principal del diàleg actual actiu -Comment[ca@valencia]=Enfosqueix la finestra principal del diàleg actual actiu -Comment[cs]=Ztmaví okno nadřazené aktivnímu dialogu -Comment[da]=Gør forældrevindue til aktuelt aktiv dialog mørkere -Comment[de]=Dunkelt das Eltern-Fenster des aktiven Dialogs ab. -Comment[el]=Σκίαση του γονικού παραθύρου του τρέχοντος ενεργού διαλόγου -Comment[en_GB]=Darkens the parent window of the currently active dialogue box -Comment[eo]=Malheligas patrajn fenestrojn de la aktuala aktiva dialogo -Comment[es]=Oscurece la ventana madre de los diálogos activos -Comment[et]=Tumendab aktiivse dialoogi eellasakna -Comment[eu]=Unean aktibo dagoen elkarrizketa-koadroaren leiho gurasoa iluntzen du -Comment[fi]=Himmentää aktiivisen kyselyikkunan isäntäikkunan -Comment[fr]=Assombrit la fenêtre parente de la fenêtre active courante -Comment[fy]=Fertsjustert it haadfinster fan aktive dialogen -Comment[ga]=Dorchaigh máthairfhuinneog na dialóige atá gníomhach faoi láthair -Comment[gl]=Escurece a xanela pai do diálogo activo -Comment[gu]=સક્રિય સંવાદની મુખ્ય વિન્ડોને ઘાટી બનાવે છે -Comment[he]=מחשיך את חלון האב של תיבת הדו־שיח הפעילה -Comment[hi]=वर्तमान सक्रिय संवाद के मुख्य विंडो को गाढ़ा करता है -Comment[hne]=हाल के सक्रिय गोठ के असली विंडो ल गाढ़ा करथे -Comment[hr]=Zatamnjenje prozora-roditelja trenutno aktivnog dialoga -Comment[hu]=Elsötétíti az aktív párbeszédablak szülőablakát -Comment[ia]=Il obscura le fenestra genitor del dialogo currentemente active -Comment[id]=Pergelap jendela induk dari dialog yang saat ini aktif -Comment[is]=Dekkir upprunaglugga (foreldri) virka gluggans -Comment[it]=Scurisce la finestra madre di quella attiva -Comment[ja]=現在アクティブなダイアログの親ウィンドウを暗くします -Comment[kk]=Белсенді диалогтың аталық терезесін күңгірттеп көрсету -Comment[km]=ធ្វើ​ឲ្យ​បង្អួច​មេ​របស់​ប្រអប់​សកម្ម​បច្ចុប្បន្ន​ងងឹត​ -Comment[kn]=ಸಕ್ರಿಯವಾಗಿರುವ ಸಂವಾದದ ಪೂರ್ವಜ ಕಿಟಕಿಯನ್ನು ಮಸುಕಾಗಿಸುತ್ತದೆ -Comment[ko]=현재 활성 대화 상자의 부모 창을 어둡게 합니다 -Comment[lt]=Užtemdo dialogo savininką kai aktyvuojamas dialogo langas -Comment[lv]=Satumšina aktīvā loga vecāka logu -Comment[ml]=സജീവഡയലോഗിന്റെ മാതൃജാലകം കറുപ്പിക്കുക -Comment[mr]=वर्तमान सक्रिय संवादची मुख्य चौकट गडद करा -Comment[nb]=Gjør mor-vinduet til den aktive dialogen mørkere -Comment[nds]=Maakt dat Moderfinstern vun den aktiven Dialoog düüsterer -Comment[nl]=Maakt het venster dat bij de ouder van de actieve dialoog hoort donkerder -Comment[nn]=Gjer foreldrevindauget til det aktive dialogvindauget mørkare -Comment[pa]=ਮੌਜੂਦਾ ਐਕਟਿਵ ਡਾਈਲਾਗ ਉੱਤੇ ਮੁੱਢਲੇ ਵਿੰਡੋ ਦਾ ਪਰਛਾਵਾਂ -Comment[pl]=Przyciemnia nadrzędne okna obecnie aktywnego okna dialogowego -Comment[pt]=Escurece a janela-mãe da janela activa de momento -Comment[pt_BR]=Escurece as janelas pai do diálogo ativo atual -Comment[ro]=Întunecă fereastra-părinte a dialogului activ -Comment[ru]=Затемнение основного окна при показе диалога -Comment[si]=වත්මන් සක්‍රීය සංවාදය අයත් කවුළුව අඳුරු කරන්න -Comment[sk]=Stmaví nadradené okno aktívneho dialógu -Comment[sl]=Potemni nadrejeno okno za trenutno dejavno pogovorno okno -Comment[sr]=Затамњује родитељски прозор тренутно активног дијалога -Comment[sr@ijekavian]=Затамњује родитељски прозор тренутно активног дијалога -Comment[sr@ijekavianlatin]=Zatamnjuje roditeljski prozor trenutno aktivnog dijaloga -Comment[sr@latin]=Zatamnjuje roditeljski prozor trenutno aktivnog dijaloga -Comment[sv]=Gör fönstret som äger den för närvarande aktiva dialogrutan mörkare -Comment[ta]=தற்போது செயலில் உள்ள பலகத்தில் தாய் சாளரத்தை இருளாக்கும் -Comment[th]=ทำให้หน้าต่างหลักมืดลงจากกล่องโต้ตอบที่ใช้อยู่ -Comment[tr]=Etkin iletişim kutularının sahibi olan pencereleri koyulaştır -Comment[ug]=نۆۋەتتىكى ئاكتىپ كۆزنەكنىڭ ئاتا سۆزلەشكۈ كۆزنىكى خىرەلىشىدۇ -Comment[uk]=Затемнення батьківських вікон активних діалогових вікон -Comment[vi]=Làm tối cửa sổ cha của hộp thoại hiện đang hoạt động -Comment[wa]=Fwait pus noer li finiesse parint do purnea di dvize ovrant pol moumint -Comment[x-test]=xxDarkens the parent window of the currently active dialogxx -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=Rivo Laks, Martin Gräßlin -X-KDE-PluginInfo-Email=rivolaks@hot.ee, mgraesslin@kde.org -X-KDE-PluginInfo-Name=kwin4_effect_dialogparent -X-KDE-PluginInfo-Version=0.1.0 -X-KDE-PluginInfo-Category=Focus -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-Library=kwin4_effect_dialogparent -X-KDE-Ordering=70 diff --git a/effects/effect_builtins.h b/effects/effect_builtins.h --- a/effects/effect_builtins.h +++ b/effects/effect_builtins.h @@ -41,6 +41,7 @@ Cube, CubeSlide, DesktopGrid, + DialogParent, DimInactive, DimScreen, FallApart, diff --git a/effects/effect_builtins.cpp b/effects/effect_builtins.cpp --- a/effects/effect_builtins.cpp +++ b/effects/effect_builtins.cpp @@ -30,6 +30,7 @@ #include "slidingpopups/slidingpopups.h" // Common effects only relevant to desktop #include "desktopgrid/desktopgrid.h" +#include "dialogparent/dialogparent.h" #include "diminactive/diminactive.h" #include "dimscreen/dimscreen.h" #include "fallapart/fallapart.h" @@ -201,6 +202,21 @@ nullptr, nullptr #endif +EFFECT_FALLBACK + }, { + QStringLiteral("dialogparent"), + i18ndc("kwin_effects", "Name of a KWin Effect", "Dialog Parent"), + i18ndc("kwin_effects", "Comment describing the KWin Effect", "Darkens the parent window of the currently active dialog"), + QStringLiteral("Focus"), + QString(), + QUrl(), + true, + false, +#ifdef EFFECT_BUILTINS + &createHelper, + nullptr, + nullptr +#endif EFFECT_FALLBACK }, { QStringLiteral("diminactive"), diff --git a/kconf_update/CMakeLists.txt b/kconf_update/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/kconf_update/CMakeLists.txt @@ -0,0 +1,2 @@ +install(FILES kwin.upd + DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) diff --git a/kconf_update/kwin.upd b/kconf_update/kwin.upd new file mode 100644 --- /dev/null +++ b/kconf_update/kwin.upd @@ -0,0 +1,7 @@ +Version=5 + +# Replace scripted dialog parent effect with builtin dialog parent effect. +Id=replace-scripted-dialogparent-with-builtin-dialogparent +File=kwinrc +Group=Plugins +Key=kwin4_effect_dialogparentEnabled,dialogparentEnabled