mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Move most of the homescreen pieces in a QML import that can be reused making it easier to do alternative homescreens
47 lines
1,004 B
C++
47 lines
1,004 B
C++
/*
|
|
SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "homescreen.h"
|
|
|
|
#include <QDebug>
|
|
#include <QQuickItem>
|
|
#include <QtQml>
|
|
|
|
HomeScreen::HomeScreen(QObject *parent, const QVariantList &args)
|
|
: Plasma::Containment(parent, args)
|
|
{
|
|
|
|
setHasConfigurationInterface(true);
|
|
}
|
|
|
|
HomeScreen::~HomeScreen() = default;
|
|
|
|
void HomeScreen::configChanged()
|
|
{
|
|
Plasma::Containment::configChanged();
|
|
}
|
|
|
|
|
|
void HomeScreen::stackBefore(QQuickItem *item1, QQuickItem *item2)
|
|
{
|
|
if (!item1 || !item2 || item1 == item2 || item1->parentItem() != item2->parentItem()) {
|
|
return;
|
|
}
|
|
|
|
item1->stackBefore(item2);
|
|
}
|
|
|
|
void HomeScreen::stackAfter(QQuickItem *item1, QQuickItem *item2)
|
|
{
|
|
if (!item1 || !item2 || item1 == item2 || item1->parentItem() != item2->parentItem()) {
|
|
return;
|
|
}
|
|
|
|
item1->stackAfter(item2);
|
|
}
|
|
|
|
K_EXPORT_PLASMA_APPLET_WITH_JSON(homescreen, HomeScreen, "metadata.json")
|
|
|
|
#include "homescreen.moc"
|