From 088e870d54356030dc578a3dff6c39d0f2f5582f Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Tue, 4 Jan 2022 20:07:45 +0000 Subject: [PATCH] TabBox: Add SwitcherItem to declarative API 3.0 Not sure if this was left out on purpose as a kind of deprecation. It would be necessary to allow port the tabbox switchers to the newer 3.0 API and use their components (such as `Workspace`) Probably for `Plasma/5.25` now. --- src/kcmkwin/kwintabbox/layoutpreview.cpp | 2 ++ src/tabbox/tabboxhandler.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/kcmkwin/kwintabbox/layoutpreview.cpp b/src/kcmkwin/kwintabbox/layoutpreview.cpp index 3ed2e25c76..aa8b6bb83e 100644 --- a/src/kcmkwin/kwintabbox/layoutpreview.cpp +++ b/src/kcmkwin/kwintabbox/layoutpreview.cpp @@ -33,6 +33,8 @@ LayoutPreview::LayoutPreview(const QString &path, bool showDesktopThumbnail, QOb QQmlComponent *component = new QQmlComponent(engine, this); qmlRegisterType("org.kde.kwin", 2, 0, "ThumbnailItem"); qmlRegisterType("org.kde.kwin", 2, 0, "Switcher"); + qmlRegisterType("org.kde.kwin", 3, 0, "WindowThumbnailItem"); + qmlRegisterType("org.kde.kwin", 3, 0, "TabBoxSwitcher"); qmlRegisterType(); component->loadUrl(QUrl::fromLocalFile(path)); if (component->isError()) { diff --git a/src/tabbox/tabboxhandler.cpp b/src/tabbox/tabboxhandler.cpp index 80de2285aa..494699af17 100644 --- a/src/tabbox/tabboxhandler.cpp +++ b/src/tabbox/tabboxhandler.cpp @@ -291,6 +291,7 @@ void TabBoxHandlerPrivate::show() #ifndef KWIN_UNIT_TEST if (m_qmlContext.isNull()) { qmlRegisterType("org.kde.kwin", 2, 0, "Switcher"); + qmlRegisterType("org.kde.kwin", 3, 0, "TabBoxSwitcher"); m_qmlContext.reset(new QQmlContext(Scripting::self()->qmlEngine())); } if (m_qmlComponent.isNull()) {