2021-03-01 20:03:25 +00:00
|
|
|
/*
|
|
|
|
|
SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
2015-05-14 16:05:01 +00:00
|
|
|
|
|
|
|
|
#include "homescreen.h"
|
|
|
|
|
|
|
|
|
|
#include <QDebug>
|
2019-09-04 16:39:31 +00:00
|
|
|
#include <QQuickItem>
|
2015-05-14 16:05:01 +00:00
|
|
|
#include <QtQml>
|
|
|
|
|
|
|
|
|
|
HomeScreen::HomeScreen(QObject *parent, const QVariantList &args)
|
|
|
|
|
: Plasma::Containment(parent, args)
|
|
|
|
|
{
|
2019-09-04 16:39:31 +00:00
|
|
|
|
2015-05-14 16:05:01 +00:00
|
|
|
setHasConfigurationInterface(true);
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-20 00:08:59 +00:00
|
|
|
HomeScreen::~HomeScreen() = default;
|
2015-05-14 16:05:01 +00:00
|
|
|
|
2019-09-16 17:13:52 +00:00
|
|
|
void HomeScreen::configChanged()
|
|
|
|
|
{
|
|
|
|
|
Plasma::Containment::configChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-14 16:05:01 +00:00
|
|
|
|
2019-09-04 16:39:31 +00:00
|
|
|
void HomeScreen::stackBefore(QQuickItem *item1, QQuickItem *item2)
|
|
|
|
|
{
|
2019-10-17 11:05:48 +00:00
|
|
|
if (!item1 || !item2 || item1 == item2 || item1->parentItem() != item2->parentItem()) {
|
2019-09-04 16:39:31 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item1->stackBefore(item2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HomeScreen::stackAfter(QQuickItem *item1, QQuickItem *item2)
|
|
|
|
|
{
|
2019-10-17 11:05:48 +00:00
|
|
|
if (!item1 || !item2 || item1 == item2 || item1->parentItem() != item2->parentItem()) {
|
2019-09-04 16:39:31 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item1->stackAfter(item2);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-14 16:05:01 +00:00
|
|
|
K_EXPORT_PLASMA_APPLET_WITH_JSON(homescreen, HomeScreen, "metadata.json")
|
|
|
|
|
|
|
|
|
|
#include "homescreen.moc"
|