mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
fix landscape favourites bar drag and drop, and cleanup folder fix drawer scrolling add settings
89 lines
4.3 KiB
C++
89 lines
4.3 KiB
C++
/*
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "mobileshellplugin.h"
|
|
|
|
#include <QQmlContext>
|
|
#include <QQuickItem>
|
|
|
|
#include "components/direction.h"
|
|
#include "components/swipearea.h"
|
|
|
|
#include "notifications/notificationfilemenu.h"
|
|
#include "notifications/notificationthumbnailer.h"
|
|
|
|
#include "shellutil.h"
|
|
|
|
QUrl resolvePath(std::string str)
|
|
{
|
|
return QUrl("qrc:/org/kde/plasma/private/mobileshell/qml/" + QString::fromStdString(str));
|
|
}
|
|
|
|
void MobileShellPlugin::registerTypes(const char *uri)
|
|
{
|
|
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell"));
|
|
|
|
qmlRegisterSingletonType<ShellUtil>(uri, 1, 0, "ShellUtil", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
|
return ShellUtil::instance();
|
|
});
|
|
|
|
// components
|
|
qmlRegisterType<Direction>(uri, 1, 0, "Direction");
|
|
qmlRegisterType<SwipeArea>(uri, 1, 0, "SwipeArea");
|
|
|
|
// notifications
|
|
qmlRegisterType<NotificationThumbnailer>(uri, 1, 0, "NotificationThumbnailer");
|
|
qmlRegisterType<NotificationFileMenu>(uri, 1, 0, "NotificationFileMenu");
|
|
|
|
// qml modules
|
|
|
|
// /actiondrawer
|
|
qmlRegisterType(resolvePath("actiondrawer/ActionDrawer.qml"), uri, 1, 0, "ActionDrawer");
|
|
qmlRegisterType(resolvePath("actiondrawer/ActionDrawerOpenSurface.qml"), uri, 1, 0, "ActionDrawerOpenSurface");
|
|
qmlRegisterType(resolvePath("actiondrawer/ActionDrawerWindow.qml"), uri, 1, 0, "ActionDrawerWindow");
|
|
|
|
// /components
|
|
qmlRegisterSingletonType(resolvePath("components/AppLaunch.qml"), uri, 1, 0, "AppLaunch");
|
|
qmlRegisterType(resolvePath("components/BaseItem.qml"), uri, 1, 0, "BaseItem");
|
|
qmlRegisterSingletonType(resolvePath("components/Constants.qml"), uri, 1, 0, "Constants");
|
|
qmlRegisterType(resolvePath("components/ExtendedAbstractButton.qml"), uri, 1, 0, "ExtendedAbstractButton");
|
|
qmlRegisterType(resolvePath("components/Flickable.qml"), uri, 1, 0, "Flickable");
|
|
qmlRegisterType(resolvePath("components/GridView.qml"), uri, 1, 0, "GridView");
|
|
qmlRegisterType(resolvePath("components/HapticsEffectLoader.qml"), uri, 1, 0, "HapticsEffectLoader");
|
|
qmlRegisterType(resolvePath("components/ListView.qml"), uri, 1, 0, "ListView");
|
|
qmlRegisterType(resolvePath("components/PopupMenu.qml"), uri, 1, 0, "PopupMenu");
|
|
qmlRegisterType(resolvePath("components/StartupFeedback.qml"), uri, 1, 0, "StartupFeedback");
|
|
qmlRegisterType(resolvePath("components/TextDropShadow.qml"), uri, 1, 0, "TextDropShadow");
|
|
qmlRegisterType(resolvePath("components/VelocityCalculator.qml"), uri, 1, 0, "VelocityCalculator");
|
|
|
|
// /dataproviders
|
|
qmlRegisterSingletonType(resolvePath("dataproviders/AudioInfo.qml"), uri, 1, 0, "AudioInfo");
|
|
qmlRegisterSingletonType(resolvePath("dataproviders/BatteryInfo.qml"), uri, 1, 0, "BatteryInfo");
|
|
qmlRegisterSingletonType(resolvePath("dataproviders/BluetoothInfo.qml"), uri, 1, 0, "BluetoothInfo");
|
|
qmlRegisterSingletonType(resolvePath("dataproviders/SignalStrengthInfo.qml"), uri, 1, 0, "SignalStrengthInfo");
|
|
|
|
// /homescreen
|
|
qmlRegisterType(resolvePath("homescreen/HomeScreen.qml"), uri, 1, 0, "HomeScreen");
|
|
|
|
// /navigationpanel
|
|
qmlRegisterType(resolvePath("navigationpanel/NavigationPanel.qml"), uri, 1, 0, "NavigationPanel");
|
|
qmlRegisterType(resolvePath("navigationpanel/NavigationPanelAction.qml"), uri, 1, 0, "NavigationPanelAction");
|
|
|
|
// /statusbar
|
|
qmlRegisterType(resolvePath("statusbar/StatusBar.qml"), uri, 1, 0, "StatusBar");
|
|
|
|
// /volumeosd
|
|
qmlRegisterType(resolvePath("volumeosd/VolumeOSD.qml"), uri, 1, 0, "VolumeOSD");
|
|
qmlRegisterType(resolvePath("volumeosd/VolumeOSDProvider.qml"), uri, 1, 0, "VolumeOSDProvider");
|
|
qmlRegisterSingletonType(resolvePath("volumeosd/VolumeOSDProviderLoader.qml"), uri, 1, 0, "VolumeOSDProviderLoader");
|
|
|
|
// /widgets
|
|
qmlRegisterType(resolvePath("widgets/krunner/KRunnerScreen.qml"), uri, 1, 0, "KRunnerScreen");
|
|
qmlRegisterType(resolvePath("widgets/krunner/KRunnerWidget.qml"), uri, 1, 0, "KRunnerWidget");
|
|
qmlRegisterType(resolvePath("widgets/mediacontrols/MediaControlsWidget.qml"), uri, 1, 0, "MediaControlsWidget");
|
|
qmlRegisterType(resolvePath("widgets/notifications/NotificationsWidget.qml"), uri, 1, 0, "NotificationsWidget");
|
|
qmlRegisterType(resolvePath("widgets/notifications/NotificationsModelType.qml"), uri, 1, 0, "NotificationsModelType");
|
|
}
|